Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- C(0) <= FS(0);
- small_numberA <= ( A(15) and A(14)and A(13) and A(12) and A(11) and A(10) and A(9) and A(8)and A(7) ) or ( not A(15) and not A(14) and not A(13) and not A(12) and not A(11) and not A(10) and not A(9) and not A(8)and not A(7));
- small_numberB <= ( B(15) and B(14)and B(13) and B(12) and B(11) and B(10) and B(9) and B(8)and B(7) ) or ( not B(15) and not B(14) and not B(13) and not B(12) and not B(11) and not B(10) and not B(9) and not B(8)and not B(7));
- small_number <= small_numberA and small_numberB;
- Af<= '0'&'0'&'0'&'0'&'0'&'0'&'0'&'0' & A(7)& A(6) & A(5) & A(4) & A(3) & A(2)& A(1) & A(0) when small_number='1' else
- A when small_number= '0';
- Bf<= '0'&'0'&'0'&'0'&'0'&'0'&'0'&'0' & B(7)& B(6) & B(5) & B(4) & B(3) & B(2)& B(1) & B(0) when small_number='1' else
- B when small_number='0';
- aritGen: for I in 15 downto 0 generate
- AUi: ArithmeticUnitI port map (Ai=>Af(I), Bi=>Bf(I), FS=>FS, CI=>C(I), Di=>Z(I), CO=>C(I+1));
- end generate aritGen;
- Df <= Z(7) & Z(7) & Z(7) & Z(7) & Z(7) & Z(7) & Z(7) & Z(7) & Z(7) & Z(6) & Z(5) & Z(4) & Z(3) & Z(2) & Z(1) & Z(0) when small_number='1' else
- Z when small_number='0';
- D <= Df;
- -- cary
- CO <= C(16);
- -- overflow
- Yn <= (B(15) and not FS(1)) or (not B(15) and FS(1));
- OV <= (A(15) and Yn and not Z(15)) or (not A(15) and not Yn and Z(15));
- end structural;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement