Turing Complete

Turing Complete

View Stats:
GenJeFT Nov 11, 2021 @ 7:31pm
Adding Bytes Problem.
Hello.

I am having a problem with Adding Bytes where the output is supposed to be 100 but comes out to 90.

https://imgur.com/a/cUj9Mgn

Also in general some of the uses of things like the Full Adder are poorly explained the first time you use them so it takes forever to figure out.
< >
Showing 1-6 of 6 comments
Arnavion Nov 11, 2021 @ 7:44pm 
Decimal addition:

56 + 78 --- ??? (6 + 8 == 14, so write 4 and carry a 1) 1 56 + 78 --- ??4 (1 + 5 + 7 == 13) 1 56 + 78 --- 134

Notice how the first addition adds two digits and produces one sum digit and one carry digit. The second addition adds three digits, one of which is the carry from the previous addition, and produces one sum digit and one carry digit. And so on.
Last edited by Arnavion; Nov 11, 2021 @ 7:53pm
wbradley Nov 11, 2021 @ 8:07pm 
The way that you're trying to connect both the sum output of one stage and the carry output of the previous stage to the same output pin doesn't work -- that's a wired OR connection, but doesn't calculate correctly if both of them would be high.

Here's a simple illustration of that: https://imgur.com/NVRzgt4

We all know that 7+3 cannot be 6, so what went wrong? In the third digit (the "4's place"), the 7 has its bit set while the 3 has its bit clear. When you add them, you don't get a carry, so the fourth digit (the "8's place") of the final result does not get set.

The sum outputs all go to the output pins. Where, then, can you connect the carry outputs to ensure that they get involved in the next digit's addition?
Last edited by wbradley; Nov 11, 2021 @ 8:08pm
GenJeFT Nov 11, 2021 @ 8:32pm 
Thank you wbradley.

Your image and your spoiler tip provided me with what I needed to solve the problem. My rather ugly looking solution is linked here. What I needed to do was instead of carrying the output to the same output pin I needed to put it into the next adder.

https://imgur.com/a/oHh6qPL

Who thought circuits were this much fun.
wbradley Nov 12, 2021 @ 4:34am 
Originally posted by Tsukasa:
What I needed to do was instead of carrying the output to the same output pin I needed to put it into the next adder.

Happy to help!

What you have here is a "ripple carry" adder, where the carries "ripple" across the sum as it's being generated. There are other adders that are faster at the expense of extra circuitry, but this is a great introduction.
thelegendofmew Nov 20, 2021 @ 1:11pm 
thanks
cleopete Oct 16, 2023 @ 4:39pm 
I've been working on this since last night, and only after looking at the OP's image did I realize the adder had been condensed into a component. I've been trying to do it with logic gates and wondering if I'd have enough room.

Thanks!
< >
Showing 1-6 of 6 comments
Per page: 1530 50