This preview shows page 1. Sign up to view the full content.
Unformatted text preview: signal size: integer:=length; signal size1: integer:=length; signal num_of_stage :integer:=0; signal xor_signal :std_logic_vector(length-1) ; begin --Sequential logic to confirm if the length is in power of 2 stage_calc:process(size1) begin while size1 !=0 loop assert size1 mod 2 !=0 report "Cannont be computed using Tree" severity error; size1 <= size1/2; num_of_stage <=num_of_stage+1; end loop; end process stage_calc; --Combitatorial logic to calculate the Xor of N-inputs xor_signal <=rx; xor_output <=xor_signal(0); stage_first:For j in 0 to num_of_stage-1 generate size<=size/2; stage:For i in 0 to size-1 generate xor_signal(i)<=xor_signal(2*i) xor xor_signal(2*i+1); end generate Output_calc; end generate stage_first; end architecture beh;...
View Full Document
This note was uploaded on 09/29/2008 for the course ECE 333 taught by Professor Cao during the Spring '08 term at ASU.
- Spring '08