Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.68 KB | None | 0 0
  1. entity ext is
  2.     port
  3.     (
  4.         a, b        : in std_logic_vector(3 downto 0);
  5.         x,y,z       : in std_logic;
  6.         ia,ib,cin   : out std_logic_vector(3 downto 0)
  7.     );
  8. end ext;
  9.  
  10. architecture fluxo_dados of ext is
  11. begin
  12.     ia(0) <= (not(x) and a(0)) or (x and y and z and not(a(0)));
  13.     ia(1) <= (not(x) and a(1)) or (x and y and z and not(a(1)));
  14.     ia(2) <= (not(x) and a(2)) or (x and y and z and not(a(2)));
  15.     ia(3) <= (not(x) and a(3)) or (x and y and z and not(a(3)));
  16.     ib(0) <= (not(x) and not(y) and not(z) and b(0)) or (not(x) and not(y) and z and not(b(0)));
  17.     ib(1) <= (not(x) and not(y) and not(z) and b(1)) or (not(x) and not(y) and z and not(b(1)));
  18.     ib(2) <= (not(x) and not(y) and not(z) and b(2)) or (not(x) and not(y) and z and not(b(2)));
  19.     ib(3) <= (not(x) and not(y) and not(z) and b(3)) or (not(x) and not(y) and z and not(b(3)));
  20.     cin(0) <= (y and not(z) and not(a(0)) and b(0)) or (x and not(y) and a(0) and b(0)) or (not(x) and y and not(z)) or (not(x) and not(y) and z) or (not(y) and z and b(0)) or (not (y) and z and a(0)) or (y and not(z) and a(0) and not(b(0)));
  21.     cin(1) <= (x and y and not(z) and not(a(1)) and b(1)) or (x and y and not(z) and a(1) and not(b(1))) or (x and not(y) and z and b(1)) or (x and not (y) and z and a(1)) or (x and not (y) and a(1) and b(1));  
  22.     cin(2) <= (x and y and not(z) and not(a(2)) and b(2)) or (x and y and not(z) and a(2) and not(b(2))) or (x and not(y) and z and b(2)) or (x and not (y) and z and a(2)) or (x and not (y) and a(2) and b(2));
  23.     cin(3) <= (x and y and not(z) and not(a(3)) and b(3)) or (x and y and not(z) and a(3) and not(b(3))) or (x and not(y) and z and b(3)) or (x and not (y) and z and a(3)) or (x and not (y) and a(3) and b(3));
  24. end fluxo_dados;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement