Japanese crossword «Full Adder with Sum and Carry»
| Size: 38x29 | Picture: | Difficulty: | Added: | 17.04.21 | Author: mindscrub |
COMMENTS
I enjoyed that one. Very logical, ha ha! thanks a million.
replyshow: 3 🗨
it's a logic diagram.
https://en.wikipedia.org/wiki/Logic_gate
This is a digital circuit that performs addition of numbers.
replyhttps://en.wikipedia.org/wiki/Logic_gate
This is a digital circuit that performs addition of numbers.
show: 2 🗨
spoiler
Important to note, this operates on one bit, so this is repeated perhaps 16, 32, or 64 times to add two entire numbers. The C output on the right is connected to the next C input on the left. Let's say we want to add 1+3. One can be represented as 01 in binary and 3 as 11. The initial carry is 0. We go from right to left, so the first time we are adding the right digits, so A is 1 and B is 1.
show: 1 🗨
spoiler
The top gate is Xor which is 1 of the inputs are different, but here A and B are the same so the output is 0. Now Xor that with the carry, initially 0, and those are not different, so S is 0 for the rightmost digit.
The bottom gates are a pair of Ands feeding an Or. The same 0 from the first Xor above Anded with the input Carry is 0. A And B on the other hand is 1. 1 or 0 is 1, so the output carry is 1.
The next digits to add (moving left) are 0 and 1.
For the Sum, their Xor is 1 this time, but so is the Carry from last time, so S still gets a value of 0.
For the carry, the first Xor has 1, the input Carry is 1, so the top And is 1, that makes the Or 1 as well, so the output Carry is 1 again.
We are now out of input digits. We had two zeros for the Sums, and the last Carry was one, so building the output right to left, it's 100. That's 4 in binary, which is what we wanted!
The bottom gates are a pair of Ands feeding an Or. The same 0 from the first Xor above Anded with the input Carry is 0. A And B on the other hand is 1. 1 or 0 is 1, so the output carry is 1.
The next digits to add (moving left) are 0 and 1.
For the Sum, their Xor is 1 this time, but so is the Carry from last time, so S still gets a value of 0.
For the carry, the first Xor has 1, the input Carry is 1, so the top And is 1, that makes the Or 1 as well, so the output Carry is 1 again.
We are now out of input digits. We had two zeros for the Sums, and the last Carry was one, so building the output right to left, it's 100. That's 4 in binary, which is what we wanted!
show: 2 🗨
show: 1 🗨

