Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. begin
  2. C(0) <= FS(0);
  3.  
  4. 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));
  5. 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));
  6. small_number <= small_numberA and small_numberB;
  7.  
  8. 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
  9. A when small_number= '0';
  10. 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
  11. B when small_number='0';
  12.  
  13. aritGen: for I in 15 downto 0 generate
  14. AUi: ArithmeticUnitI port map (Ai=>Af(I), Bi=>Bf(I), FS=>FS, CI=>C(I), Di=>Z(I), CO=>C(I+1));
  15. end generate aritGen;
  16.  
  17. 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
  18. Z when small_number='0';
  19.  
  20. D <= Df;
  21.  
  22. -- cary
  23. CO <= C(16);
  24. -- overflow
  25. Yn <= (B(15) and not FS(1)) or (not B(15) and FS(1));
  26. OV <= (A(15) and Yn and not Z(15)) or (not A(15) and not Yn and Z(15));
  27.  
  28. end structural;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement