# Lab 4 - Building an ALU

### Step 1 - build an 8-bit ALU

Review the ALU in fig 3-19 and 3-20 in the text. See problem 15 in Chapter 3. Our goal is to build a single slice of the ALU, and then save as a subcircuit (from homework)

Create the single bit circuit as a new circuit, and test it. Then create a new 8-bit ALU with 8 of these devices (as in figure 3-20). Connect to inputs and outputs, and test each function.

Recall that in two's-compliment:

### -A = INV(A) + 1B - A = B + (-A)

(Hint - the A can be negated by inverting it and adding one).

(Another hint - you can force a carry in of the lowest bit to cause the ALU add a 1 to a sum between A and B)

### Step 2 - create an enhanced 8-bit ALU

We now want to take the 8-bit ALU from step 1 and convert it into a circuit of it's own. We want to simplify it, hiding the INVA, INA and INB lines. What we really want is a circuit with the following inputs and outputs:

• 2 x 8-bit inputs (A and B)
• 8 bits of output
• a single carry in
• a single carry out
• 3 function bits.

The three function bits should cause the 8-bit ALU to do the following operations:

Input (F0,F1,F2) Function Output
0 (0,0,0) A ^ B
1 (0,0,1) A v B
2 (0,1,0) B '
3 (0,1,1) A + B + Cin
4 (1,0,0) A
5 (1,0,1) B
6 (1,1,0) - A
7 (1,1,1) B - A

Create the 8-bit ALU, save, and test all functions.

### Step 3

Create a lab report showing examples of each circuit being tested. (You can export the circuits to jpeg, and paste them in a document). Write a paragraph stating you observations about surprises, difficulties, and major concepts learned. How could this lab be improved?

Topic revision: r5 - 2014-09-15 - JimSkon

TWiki

* Webs

Copyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback