Advertisement
Guest User

Untitled

a guest
May 27th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.42 KB | None | 0 0
  1. library ieee;
  2. USE ieee.std_logic_1164.all;
  3. ENTITY adder IS PORT (
  4.      a, b: IN std_logic_vector (3 DOWNTO 0);
  5.      sum: OUT std_logic_vector (3 DOWNTO 0);
  6.      cout: OUT std_logic);
  7. END adder;
  8.  
  9. ARCHITECTURE struct OFadder IS
  10. SIGNAL c : std_logic_vector (4 DOWNTO 0);
  11. BEGIN
  12.      interm<=a XOR b;
  13.      c<=((a AND b) OR (interm AND c(3 DOWNTO 0))) & '0';
  14.      sum<= interm XOR c(3 DOWNTO 0);
  15.      cout<=c(4);
  16. END struct;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement