CSCI 370: Computer Architecture
ALU Lab


Overview

Download Logisim-evolution, specifically version 3.9. Do NOT download the older Logisim as it will NOT be compatible! Hereafter, I will refer to Logisim-evolution as Logisim for brevity.

Implement an eight-function arithmetic logic unit (ALU) that performs bitwise OR, bitwise AND, addition, subtraction, shift left, logical shift right, arithmetic shift right, and less than. Your ALU should use components from Logisim whenever possible. For example, you do NOT need to build an adder circuit — simply use the one provided by Logisim.

Requirements

Your ALU will perform eight arithmetic functions on two 8-bit inputs (labeled "X" and "Y"), producing one 8-bit output (labeled "R"). In addition it will have one 3-bit input (labeled "Opcode"), which will select which of the eight arithmetic functions to perform. Implement this in your circuit using a multiplexor with eight inputs, one for each function result, and three select lines. The function you perform will depend on the value of the three select lines. Given inputs X and Y, you will perform:

Circuit Layout

Your final ALU circuit should have X on the left, Y below it, Opcode on top, and R on the right. If your circuit does not match this layout you will receive a ZERO!

Implementation and Testing Hints

I suggest that you test your ALU curcuit as you go; add a little functionality, stop and test that functionality by trying out different input values using the poke tool, once that part works, then add a little more functionality, etc.

What to Submit

Submit your Logisim "*.circ" file to Autolab.

Hints

To use an 8-bit adder, open the Arithmetic folder and select Adder. The default Adder has "Data Bits" set to 8. That is an 8-bit adder. The inputs to an 8-bit adder are also 8-bits, so you need to hook up an 8-bit input pin. The output is 8-bits, so you need to hook up an 8-bit output pin. The carry-in and carry-out bits are only 1-bit each.

If you have an 8-bit number and you want to access just the bits individually, you can use the Splitter located under Wiring. If you set "Fan Out" to 8 and "Bit Width In" to 8, you'll be able to turn any 8-bit input into 8 1-bit outputs. You can also do the reverse by simply connecting 8 1-bit inputs to one side of the splitter and getting 1 8-bit output back out.


Gary M. Zoppetti, Ph.D.