Login  Register

Re: FullAdder imp.

Posted by cadet1620 on Nov 23, 2012; 2:22pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/FullAdder-imp-tp4025675p4025677.html

[Edit: fix typo.]

ysh443 wrote
Hi
im trying to implement the FuallAdder usind two H.A.
when adding the C bit using a H.A. , i conclude that the carry_out
is not important so i want to leave it unwired

but the Hardware simulator is crying that its the carry output
shoul be connected

how can i cause it be unconnected?

regards
You do need to do something with the carry outputs from both half adders to make a correct full adder. Consider adding a=0, b=1 and c=1.

The first half adder produces sum1=1, carry1=0.
The second half adder adds sum1 and c producing sum2=0, carry2=1.

sum2 is the sum output from the full adder. carry1 and carry2 need to be combined in some fashion to produce the full adder's carry output.

It is OK to leave out the connection to an unused output in a part line. For instance the full adder for bit 15 in your Add16 won't have its carry connected so you can write:     FullAdder(a=a[15], b=b[15], c=c14, sum=out[15]);

--Mark