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.

full adder vhdl program using for loop only

Status
Not open for further replies.

balayoga

Newbie level 1
Joined
Apr 13, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
can any one understand how i want to write program of full adder and give me solution
entity adder is
Port ( a : in STD_LOGIC_vector(2 downto 0);
b : in STD_LOGIC_vector(2 downto 0);
c : in STD_LOGIC_vector(2 downto 0);
so : out STD_LOGIC_vector(2 downto 0);
co : out STD_LOGIC_vector(2 downto 0));
end adder;

architecture Behavioral of adder is

begin
process(a,b,c)

begin

for k in "000" to "111" loop

so[k] <= [a[k] and b[k] and c[k]];
co[k] <= [(a[k] and b[k]) or (b[k] and c[k]) or (c[k] and a[k])];
--j<= i-1;
--k <= conv_binary(j);
end for;
end proces;


end Behavioral;
 

for k in "000" to "111" loop

so[k] <= [a[k] and b[k] and c[k]];
co[k] <= [(a[k] and b[k]) or (b[k] and c[k]) or (c[k] and a[k])];
--j<= i-1;
--k <= conv_binary(j);
end for;
this wont do full adder
what you want give more information....
so[k] <= [a[k] and b[k] and c[k]]; this wont do sum you have to use "XOR" in place of "and"
for k in "000" to "111" loop you can just use "for k in 0 to 7 loop"
 

sum of full adder needs a xor gate not a and gate

and as far as i think your loop wont work that way
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top