# Building own Computer with Nand2Tetris: Project II

This week's project includes creating an adder circuit, an increment circuit, and combining all the things into an arithmetic logic unit that we have created so far.

The ones whose interested in with Nand2Tetris-HDL, please check the manual.

From the truth table, we can easily recognize that $\text{sum} = A \oplus B$ and $\text{carry} = AB$ for inputs A and B. Creation of such circuit will be very easy for us in HDL.

Half adder can only add two bits, and give us the sum and the carry. To create a circuit which can add more than one bit, we will need a three-input adder circuit, since we also need to add previous carry.

Think about this: 28 + 94. Adding of less significant character (8 and 4) can be done with half adder. It'll give us a sum of 2, and a carry of 1. To add second characters, we have to add three different numbers now: 2 + 9 + 1 (carry). That's the reason we require full adder.

A full adder can be implemented using two half adders, and a OR  gate for combination of carries.

It is time to create a 16-bit adder, then!

### Incrementer

The line you see on the Add16 part written as b=true means that make the input's first bit equal to 1, and we are sure b will be a 16-bit value because of the implementation of it.

### Arithmetic Logic Unit

In the course, we are asked to implement a ALU which can do these functions within given inputs: