Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Looking for VHDL code for adder

Status
Not open for further replies.

avimit

Banned
Joined
Nov 16, 2005
Messages
413
Helped
91
Reputation
182
Reaction score
23
Trophy points
1,298
Location
Fleet, UK
Activity points
0
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;
 

YenYu

Member level 5
Joined
Jul 2, 2007
Messages
92
Helped
6
Reputation
12
Reaction score
0
Trophy points
1,286
Activity points
2,046
vhdl adder

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

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
full adder vhdl code

Use VHDL's "+" operator.
 

rsrinivas

Advanced Member level 1
Joined
Oct 10, 2006
Messages
415
Helped
50
Reputation
100
Reaction score
12
Trophy points
1,298
Location
bengalooru
Activity points
3,704
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)
 

darylz

Full Member level 2
Joined
Mar 24, 2005
Messages
129
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
1,975
vhdl code for adder

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

dinaganesh

Junior Member level 1
Joined
Apr 17, 2007
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,376
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 ;
 

eng_aq

Junior Member level 2
Joined
Oct 15, 2006
Messages
23
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,384
verilog code for adder

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

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top