I'm new to computer science and came across an issue while learning about ripple carry adders. I'm trying to add binary 1+1+1 below (excuse the poor photoshopping). I know the answer should be binary 11, but my sums were 0 and 0 with a carry of 1. Shouldn't my sums be 1 and 1 with a carry of 0? What am I doing wrong?
1 Answer
You're misinterpreting the action of a ripple-carry adder. Each of the two boxed circuits takes in two 1-bit numbers (the top two inputs) and a carry bit (the left input) and returns a sum bit (the lower output) and a carry (the right output). In this example, you are adding $a_0+b_0$ (the 1, 1 left pair of inputs) and $a_1+b_1$ (the 1, 0 right pair of inputs). In other words, reading from least significant bits on the left, you're adding $a=11$ to $b=01$, i.e., $11+01$ which gives you the sum bits $s_0=0,s_1=0$ and a carry of 1, as you observed. In decimal terms, your example adds $3+1$ and correctly produces $4$.