CSC 480 Lab #7

"Lucky seven" Lab

Purpose

bullet Explore the operation of an Arithmetic Logic Unit (ALU)

Components used

bullet 74181 Arithmetic Logic Unit

Pinouts are attached.

Lab Problems

This lab focuses on the Arithmetic Logic Unit, or ALU, as described in Chapter 10 of our text.

Setup

Grab a 181 and hook it up. The ALU interface is a little more complex than we've seen:

bullet A0:A3 - 4-bit data input A
bullet B0:B3 - 4-bit data input B
bullet F0:F3 - 4 bit function output F
bullet S0:S3 - 4-bit ALU select to control ALU operation
bullet M - mode select input
bullet Cn, Cn+4 - carry-in and carry-out bits for arithmetic operations
bullet P, G - propagate-generate outputs for chaining multiple ALU's
bullet A=B - comparison output bit

To complete the lab, I recommend the following:

bullet Connect ALU data inputs A3-A0 to switches S3-S0
bullet Connect ALU select inputs S3-S0 to switches S7-S4
bullet Connect ALU function outputs F3-F0 to LEDs L3-L0
bullet 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.
bullet 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 all active high, and the carry values Cn and Cn+4 are active low.

1. Test the logic functions of the ALU

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...

2. Test the arithmetic functions of the ALU

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.