SHARE
TWEET

Untitled

a guest Jan 24th, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top