top of page
Search

Start of the CPU Project

  • Writer: Derek Borden
    Derek Borden
  • Sep 14, 2025
  • 3 min read

Today I have started on a project that is probably the most exciting that I have ever done. Alongside three friends, Andrew Fateev, Gavrilo Odievich, and Derek Weiss, I will be building an 8-bit CPU for our CS3 class as well as for the Technology Student Association. This is not one of those projects where you write some code, run it, and call it a day. We are building this thing from the ground up, literally at the logic gate level.

When we were first discussing how to approach the CPU, we quickly realized that everything really revolves around the ALU, the Arithmetic Logic Unit. If a CPU cannot add, subtract, or manipulate bits, then it is not much of a CPU at all. Because of that, we decided to start the entire project by designing the logic for the ALU before worrying about registers, control logic, or instruction decoding.

Starting with Addition:

We began with the simplest possible building block, the half adder. A half adder takes two single-bit inputs and produces two outputs. The XOR gate gives the sum, and the AND gate gives the carry. It is almost funny how simple it looks, considering that this circuit is the foundation of all arithmetic in a computer.

Half Adder: Top output is carry and bottom output is base addition. Ex. 1 + 1 = 10 and 1 + 0 = 01

Once that was working, we moved on to a full adder. A full adder does the same thing as a half adder, but it also includes a carry-in from the previous bit. This is implemented by stacking two half adders together, where the first one adds the two input bits, and the second one adds the carry-in to the intermediate sum. The carry outputs are then combined to form the carry-out. It is very modular, which makes it easy to understand and expand.


Full-Adder made up of half-adders: Top two inputs are regular inputs and the bottom is the carry-in. Ex. 1 + 1 + 1 = 11


Building the 8-Bit Adder:


With the full-adder finished, we scaled everything up to an 8-bit adder. This was done by chaining eight full adders together so that the carry-out of one feeds into the carry-in of the next. This setup is called a ripple-carry adder, because the carry literally ripples from the least significant bit all the way to the most significant bit.

This adder allows us to take two 8-bit numbers and add them together. It is not the fastest design in the world, but it is simple and intuitive, exactly what we want for this foray into electrical engineering. After we finished this design, we literally stood up and high fived: it really started to feel like we were building something that could actually do stuff.


Negation and Subtraction


Of course, addition is not the only thing we need. Subtraction is the other side to the coin. Instead of building an entirely new subtraction circuit, we used two’s complement arithmetic. The idea is simple. To negate a number, you flip every bit and then add one.

We built a negation circuit that takes an 8-bit number, runs it through an inverter, and then feeds that result into the adder with a carry-in of one. This allows the same adder circuit to handle both addition and subtraction. Negative numbers just fall out naturally because of how binary overflow works, which is honestly still a little bit insane every time I think about it.


 
 
 

Comments


bottom of page