Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Looking for VHDL code for adder

Status
Not open for further replies.
vhdl code for full adder

Dear Sumant, there are countless types of adders, what kind do you want. pls specify. Nevertheless, I paste a fulladder code here
Kr,
avi
http://www.vlsiip.com

Library ieee;
Use ieee.std_logic_1164.all;

ENTITY fulladder IS
PORT( A,B,Cin : IN std_logic;
sum,Cout: OUT std_logic);
END ENTITY;

ARCHITECTURE functional OF fulladder IS
BEGIN
PROCESS(A,B,Cin)
BEGIN
If (Cin = '0' and A = '0' and B = '0' ) then
sum<= '0'; Cout <= '0';
elsif(Cin = '0' and A = '0' and B = '1') then
sum <= '1' ; Cout <= '0';
elsif(Cin = '0' and A = '1' and B = '0' ) then
sum <= '1' ; Cout <= '0';
elsif(Cin = '0' and A = '1' and B = '1' ) then
sum<= '0'; Cout <= '1';
elsif(Cin = '1' and A = '0' and B = '0' ) then
sum <= '1' ; Cout <= '0';
elsif(Cin = '1' and A = '0' and B = '1' ) then
sum<= '0'; Cout <= '1';
elsif(Cin = '1' and A = '1' and B = '0' ) then
sum<= '0'; Cout <= '1';
elsif(Cin = '1' and A = '1' and B = '1' ) then
sum <= '1' ; Cout <= '1';
else
sum <= 'X' ; Cout <= 'X';
end if;
END PROCESS;
END functional;
 
vhdl adder

U can also use the adder in the COREGEN if ur're using Xilinx
 

full adder vhdl code

Use VHDL's "+" operator.
 

vhdl full adder

echo47 said:
Use VHDL's "+" operator.
this would be the simplest and the best implementation.
if u r using any synthesis tool it can infer the adder u want(not for FPGA though,only for ASIC)
 

vhdl code for adder

just use "+"! adder is widely used in designs, you cannot use adder module for it everywhere.
 

adder vhdl

hi friend ,,

i think u can use this code for full adder !!! its easy

library ieee;
use ieee.std_logic_1164.all;
entity full is
port ( a,b,c : in std_logic ;
sum , carry : out std_logic);
end full ;

architecture fulladder of full is
begin
sum <= a xor b xor c ;
carry <= (a and b) or ( b and c) or (c and a);
end fulladder ;
 

verilog code for adder

Please I need the verilog code(HDL) for Full Adder by using CMOS technology
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top