Lab 8: K-Maps with Don't Cares, Multiplexers, and ALUs

Due Thursday, August 25 at 11:59 PM

Goals for This Lab

By the time you have completed this work, you should be able to:

Provided files:

Step 1: Edit the lab8problems.txt File

Using a text editor of your choice, open the lab8problems.txt file. The file contains a series of questions for you to answer. The answers should be placed directly in the file itself, except where noted. All questions must be answered correctly for full credit. Make sure you save your answers before you exit.

Step 2: Build a Two-Bit ALU

The last question in lab8problems.txt required you to write out a circuit for part of a single-bit adder (that is, a circuit that adds two individual bits together). In this part, you will build a 2-bit ALU (that is, each operand is two bits large) with support for addition and subtraction. To this end, you are given the component below:

The above component takes the following single-bit inputs:

Given the above inputs, the circuit produces the following single-bit outputs:

In making your 2-bit ALU, you may use as many of the above components as you want, along with any number of AND, OR, NOT, and 2-input MUXs. Overall, your 2-bit ALU takes the following single-bit inputs:

Given the above inputs, your ALU must produce the following outputs:

You must draw your circuit, and submit it as “lab8alu.jpg”. You may find the following hints helpful as part of this process:

  1. While not strictly required, 2-input MUXs will simplify things.
  2. To add with multiple bits, you will need to chain multiple “+” components together.
  3. Recall that you can effectively subtract via addition by flipping all the bits of the second operand, and then adding one. For this addition of one, the initial carry-in bit can be set to 1.
  4. There are two general approaches to implement this, and either will work:
    1. Do both the addition and subtraction in parallel, then use a multiplexer to select between the results. This requires a 2-input MUX for each output bit. This is straightforward, but it requires a lot of components.
    2. Adjust the inputs to the “+” component, based on the value of Op. This requires more thinking about exactly what values are fed to the “+” components, but the resulting circuit is much smaller.

Step 3: Turn in Your Answers Using Canvas

Log into Canvas, and go to the COMP 122 class. Click “Assignments” on the left pane, then click “Lab 8”. From here, you can submit the following files:

You can turn in the assignment multiple times, but only the last version you submitted will be graded.