The Wayback Machine - https://web.archive.org/web/20170508194613/http://cs.umd.edu/class/sum2003/cmsc311/Notes//Comb/onebitALU.html

How to Create a 1-bit ALU

Introduction

One lesson about building hardware is that we can build big components out of small ones. Thus, by using k full-adders, we can create a k-bit ripple carry adder which sums two k bit numbers.

We can use the same idea to build an ALU. We can perform operations on two k-bit numbers by chaining together k one-bit ALUs.

This turns out to be much easier than you might expect.

Operations for an ALU

ALU perform basic operations on up to two numbers. We imagine that ALUs operate on two 32-bit representations. These can be built up from 32 1-bit ALUs.

Here's a list of operations we might perform:

con1 con0 Operation
0 0 xi + yi + ci-1
0 1 xi AND yi
1 0 xi OR yi
1 1 xi

The operations are:

You can imagine adding other operations to make the ALU more useful. The point of this 1-bit ALU is to show how you can handle at least two operations.

To implement this 1-bit ALU, we will have the following inputs and outputs:

The circuit is easy enough to implement. Since we want to choose between one of four possible operations, the obvious choice is to use a 4-1 MUX.

Here's the circuit diagram of a one-bit ALU.

Creating a 3-bit ALU

Here's how you would put three 1-bit ALU to create a 3-bit ALU. Notice that it looks just like a 3-bit ripple carry adder.

The diagram isn't quite complete. In particular, we need to add the control bits con1 and con0, on the outside of the black box, then hook them up to each of the 1-bit ALU. As an exercise, redraw the diagram, and add these control bits in.

Summary

We can design a k-bit ALU, similar to the way we design a k-bit ripple carry adder. We build it from a 1-bit version. In this case, we create a 1-bit ALU, built up from a MUX, adders, and any gates needed to perform the operation.

Then, we hook up k 1-bit ALUs together to create a k-bit ALU.