Silicon to Scripting 6

Now that we half a Half Adder, something that can add two 1 bit numbers (into a 2 bit number), we can make a full adder that also takes a carry. This will allow us to chain together Full Adders to add arbitrary long sequences of bits, and thus arbitrary large numbers.

Full Adder

The truth table for this level may seem a bit confusing. It’s just describing a formal specification for adding three 1 bit numbers together into a 2 bit number.

Let’s start with an Add (half adder) that’s hooked up to the a and b inputs. The h of this Add has an implicit 212^1 and the l has an implicit 202^0.

full adder solution part 1

Now we need to take into account the c input. Since the c has an implicit 202^0, we can Add it with the l output of the first Add we added.

full adder solution part 2

Now we have three outlets, but two outputs.

Since both h outlets of the Add have an implicit 212^1, we can OR them together (because they can never both be on). And for the l output, we can use the other l outlet of the second Add.

full adder solution part 3

Multi-bit Adder

Now we are going to make a component that can add two 2 bit numbers and a carry into a 2 bit number and a carry. The key to this level is keeping track of the implicit value behind a bit (e.g. 202^0, 212^1). Note: the c output of this level has an implicit value of 222^2 instead of 202^0.

Let’s connect the bits with the same “value” to some Adds.

multibit adder 1

Now we can connect the outlets with the same “value” with another Add.

multibit adder 2

The max number we can make is 55, which means that the two outlets with a “value” of 222^2 will never both be on at the same time, so we can OR them together. The other two outlets are self explanitory if you know what their “value” is.

multibit adder 3

part 7