Comopletato sommatore-sottrattore con test

This commit is contained in:
2019-08-29 16:38:19 +02:00
parent b6c1d7abe2
commit 6c5accaabe
196 changed files with 231 additions and 16789 deletions

View File

@@ -22,15 +22,18 @@ begin
propagation <= X or Y;
sum_no_carry <= X xor Y;
carry_look_ahead: process (generation, propagation, carry, carry_in)
carry_look_ahead: process (generation, propagation, carry_in)
variable C: std_logic;
begin
carry(0) <= carry_in;
for i in (BITCOUNT-1) downto 1 loop
carry(i) <= generation(i) or (propagation(i) and carry(i-1));
C := carry_in;
carry(0) <= C;
for i in 1 to (BITCOUNT-1) loop
C := generation(i-1) or (propagation(i-1) and C);
carry(i) <= C;
end loop;
end process;
result <= sum_no_carry xor carry;
carry_out <= sum_no_carry(BITCOUNT-1) xor carry(BITCOUNT-1);
carry_out <= (X(BITCOUNT-1) and Y(BITCOUNT-1)) or (X(BITCOUNT-1) and carry(BITCOUNT-1)) or (carry(BITCOUNT-1) and Y(BITCOUNT-1));
end CarryLookAheadArch;