Advertisement
Henry-Galleguillos

ALUS - ALU de un bit

Dec 14th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. entity ALUS is
  5. Port ( A, B: in std_logic;
  6. Cin: in std_logic;
  7. Cout: out std_logic;
  8. Bnegado: in std_logic;
  9. Puntaje: out std_logic);
  10. end ALUS;
  11.  
  12. architecture Behavioral of ALUS is
  13.  
  14. signal puntos: std_logic;
  15. signal notB: std_logic;
  16. signal Muxo: std_logic;
  17.  
  18. component elmux
  19. Port (D0: in std_logic;
  20. D1: in std_logic;
  21. Bneg: in std_logic;
  22. nout: out std_logic);
  23. end component;
  24.  
  25. component operaciones
  26. Port ( x : in std_logic;
  27. y : in std_logic;
  28. Carry_in : in std_logic;
  29. Sum : out std_logic;
  30. Carry_out : out std_logic);
  31. end component;
  32.  
  33. begin
  34.  
  35. notB <= not B;
  36.  
  37. Negador: elmux port map( D0 => B,
  38. D1 => notB,
  39. Bneg => Bnegado,
  40. nout=> Muxo);
  41.  
  42. Calculadora: operaciones port map( x => A,
  43. y => Muxo,
  44. Carry_in => Cin,
  45. Sum => Puntaje,
  46. Carry_out =>Cout);
  47. end Behavioral;
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement