Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.std_logic_1164.all;
  3. use IEEE.numeric_std.all;
  4.  
  5. entity adder4std is
  6. port (
  7. inA, inB : in unsigned(3 downto 0);
  8. cin : in std_logic;
  9. s : out unsigned(3 downto 0);
  10. cout : out std_logic
  11. );
  12. end entity;
  13.  
  14. architecture arc of adder4std is
  15.  
  16. signal resultat : unsigned(4 downto 0);
  17.  
  18. begin
  19.  
  20. resultat <= ('0' & inA) + ('0' & inB);
  21. s <= resultat(3 downto 0);
  22. cout <= resultat(4);
  23.  
  24. end arc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement