"Lucky seven" Lab
Explore the operation of an Arithmetic Logic Unit (ALU) |
74181 Arithmetic Logic Unit |
Pinouts are attached.
The deliverables are defined for each part of the lab below.
This lab focuses on the Arithmetic Logic Unit, or ALU, as described in Chapter 7 of our text.
Grab a 181 and hook it up. The ALU interface is a little more complex than we've seen:
A0:A3 - 4-bit data input A | |
B0:B3 - 4-bit data input B | |
F0:F3 - 4 bit function output F | |
S0:S3 - 4-bit ALU select to control ALU operation | |
M - mode select input | |
Cn, Cn+4 - carry-in and carry-out bits for arithmetic operations | |
P, G - propagate-generate outputs for chaining multiple ALU's | |
A=B - comparison output bit |
To complete the lab, I recommend the following:
Connect ALU data inputs A3-A0 to switches S3-S0 | |
Connect ALU select inputs S3-S0 to switches S7-S4 | |
Connect ALU function outputs F3-F0 to LEDs L3-L0 | |
With a scarcity of switches (as in, there aren't any left), we will hard-code a value into the B data inputs of the ALU. For this lab, B will always (unless otherwise specified) be set to 0101 (or 5). So, connect B0 and B2 to Vcc... B1 and B3 to ground. | |
Connect the carry-in bit, Cn, to logic 1. |
The ALU diagram describes the operation of the ALU in active high and active low mode. We will use active high. As a result, ALU values A, B, and F are
Logic functions are activated in the ALU by setting the mode bit, M, to logic 1. With mode set to 1, complete the table exercising the logic mode operations of the ALU.
Deliverable: Complete a table exercising all 16 logic functions of the ALU, for select inputs 0000 - 1111, for 3 values of A=0000, A=1111, and A=0010. The value of B in all cases will be 0101. Your table should look like:
Select Bits | Function | A input | B input | F output |
0000 | A' | 0000
1111 0010 |
0101
0101 0101 |
|
0001 | (A+B)' | 0000
1111 0010 |
0101
0101 0101 |
|
and so on... |
Connect the mode input, M, to logic 0 to set the ALU in arithmetic mode.
Disconnect the carry-in bit, Cn, of the ALU from logic 0, and connect it to one of the pulse buttons, like PB1.
Connect the Carry out bit, Cn+4, to an LED to watch for carry-out, i.e. overflow, during your arithmetic operations.
Remember that carry-in and carry-out are active low, so you are setting and seeing the complements of these values.
Deliverable: Now, complete a similar table for all 16 arithmetic operations.
Deliverable: Test your carry-in pulse button on a number of cases and document the effect of carry-in on the function outputs.
Deliverable: Test your carry-out bit for a number of different cases, where you expect and don't expect overflow. Note these on your table.
Ala section 7-10 in our textbook, please "execute" the following control words. You'll be most interested in Figure 7-19 on page 372 and Table 7-11 on page 373 as a starting point.
Include the following changes for Prof. Bill's control word:
All registers are 4 bits wide | |
The function select bits, FS, map onto M, S3, S2, S1, S0 for our 181 ALUs. | |
Assume that the constant input to MUXB is 0101. | |
Assume that the data input to MUXD is 0000. | |
Assume the following are the starting values contained in our 8 registers: |
Register | Value |
000 | 0000 |
001 | 0001 |
010 | 0010 |
011 | 0011 |
100 | 0100 |
101 | 0101 |
110 | 0110 |
111 | 0111 |
Execute the following control words (in order)... using your ALU setup:
DA | AA | BA | MB | FS | MD | RW |
110 | 011 | 101 | 0 | 10011 | 0 | 1 |
000 | 011 | 101 | 0 | 11001 | 1 | 1 |
010 | 111 | 101 | 0 | 00110 | 0 | 1 |
001 | 011 | 101 | 0 | 10111 | 0 | 1 |
011 | 100 | 101 | 0 | 01111 | 0 | 1 |
100 | 011 | 000 | 1 | 10111 | 0 | 1 |
111 | 111 | 101 | 0 | 10110 | 0 | 1 |
101 | 000 | 000 | 1 | 11011 | 0 | 1 |
Deliverable: List the contents of each register after execution of these control words, from register 000 to 111.
What is the significance of the binary values in register 0-7 (in that order) after performing these control words.
Show me your tables, answers and your ALU testbed before disassembly.