Can you write a full VHDL code Where a and b are 4 bit digit
Solution
VHDL Code is shown below
LIBRARY ieee ;
 USE ieee.std_logic_1164.all ;
 USE ieee.std_logic_arith.all ;
ENTITY Fulladder IS
 PORT (        a : in std_logic_vector(3 downto 0);
    constant b : std_logic_vector(3 downto 0) := \"1011\";
        c : out std_logic_vector(3 downto 0) ) ;
 END Fulladder ;
 ARCHITECTURE Behavior OF Fulladder IS
 BEGIN
 c(0) <= a(0) and b(0);
 c(1) <= (a(1) and b(0)) xor (a(0) and b(1));
 c(2) <= c(1) xor ((a(2) and b(0)) xor (a(1) and b(1)) xor (a(0) and b(2)));
 c(3) <= c(2) xor ((not(a(3) and b(0))) xor (a(2) and b(1)) xor (a(1) and b(2)) xor (not(a(0) and b(3))));
 c(4) <= c(3) xor (\'1\' xor (not(a(3) and b(a))) xor (a(2) and b(2)) xor (not(a(1) and b(3))));
 c(5) <= c(4) xor ((not(a(3) and b(2))) xor (not(a(2) and b(3))));
 c(6) <= c(5) xor (a(3) and b(3));
 c(7) <= c(6) xor (\'1\');
 END Behavior ;

