10 December 2011

VHDL code for Full-Adder

1 comment

Q. How do I write VHDL code for Full Adder


Ans:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity fa1 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
cin : in STD_LOGIC;
cout : out STD_LOGIC;
sum : out STD_LOGIC);
end fa1;
architecture Behavioral of fa1 is
begin
sum<=a xor b xor cin;
cout<=(b and cin)or(a and b)or(a and cin);
end Behavioral;


If You Liked This Post Please Take a Time To Share This Post

You May Also Like...

1 comment:

  1. I’m truly thankful for your useful and well-written post. Read this article for more detailed info. The Teste Do Mouse helps gamers improve their mouse precision and performance.

    ReplyDelete