CS125- PROJECT-Building an 8-bit ALU

Total points: 10 points

Due date: 11/4 /2021 - 11:59 pm

Building an 8-bit ALU

In this project, you are required to design a simple ALU circuit for two 8-bit numbers using Logisim that can add and subtract and compute bitwise AND, OR, XOR and XNOR for 8-bit numbers.

Task 1: One-bit Full Adder

For this task, you should build a one-bit Full Adder circuit. Note that Logisim already has a full adder circuit, but you should build your own.

You are required to create a 1-bit Full Adder circuit that can add three input bits (A, B, and Cin) and produce a sum bit and a carry bit as output.

  • Make sure that it is working correctly before task 2!
  • Add your (Full name) at the top of the circuit.
  • Use the "Add Circuit" command in the "Project" menu and enter "FA-1Bit" as the name of the new circuit for the first task.

Task 2: 1-bit ALU

For the second task, add another circuit to the project, name the new circuit "ALU-1bit".

The purpose of this circuit is to build a 1bit ALU that will do five operations on 1-bit numbers: AND, OR, XOR, XNOR and ADD/SUB. The circuit takes two single bit inputs A and B. To select which operation to perform on these inputs, there will be three wires, which can be represented by one 3-bit input "OP". The result of the operation is always assigned to the output "R". The operation control wires are set according to the following table:

Op CodeOperationFunction
000ANDA.B
001ORA+B
010XORAÅB
011XNOR
100ADD/SUBA+B   or    A-B

The block diagram for 1bit ALU will look like:

The input OP is used to select the performed operation. Cin and Cout are used to represents the input and output carry resulted from the ADD/SUB operation.

The Sub input is used when (OP=100) to perform either the add or subtract process (as learned in lecture). It must be 0 for addition and 1 for subtraction. (use the “FA-1Bit” you created in task 1)

Diagram, schematic

Description automatically generatedThe 5 operations used as input to a Multiplexer. The selectors (OP) control wires determine which of the results gets to the output "R". (You are required to use a Multiplexer component built into Logisim);

  • Make sure that it is working correctly before task 3!
  • Add your (Full name) at the top of the circuit.

Task 3: ALU

For this Task, you will build an ALU. You can construct it in the circuit named "main" that was originally the only circuit listed in the Logisim window. Later, Rename it to be "ALU".

The purpose of the circuit is to take two eight-bit numbers and a one-bit carry-in and to produce an eight-bit Result and a one-bit carry-out as output. to construct an 8-bit ALU you will need to use eight copies of the (ALU-1bit) that you created for task 2.

In Logisim, it is possible to have multi-bit inputs, multi-bit outputs, and wires that carry multiple bits of data. To make an eight-bit input, for example, add an input to your circuit, then change the value of the "Data Bits" property of the input to 8 (in the properties list in the lower left section of the window). An eight-bit input and an eight-bit output are shown at the left. The poke tool has been used to change the value of the input to 01100111. The values of the output bits are undefined, since the output is not connected to anything. You should use eight-bit inputs and outputs for your ALU.

But you need single-bit wires to feed into your individual 1bit ALU circuits. For that, you need a "Splitter". A Splitter splits a multi-bit bundle of wires into smaller bundles of wires or into individual wires. You can find "Splitter" in the "Wiring" section of the component palette. The picture at left shows a splitter connected to the multi-bit wire going into an 8-bit output; the splitter splits that 8-bit wire into 8 individual one-bit wires. In this case, the properties of the splitter have been set so that it is "Facing" North, has a "Bit Width In" of 8, and a "Fan Out" of 8. Each of the eight wires can be connected, for example, to the output from an Adder.

The 8-bit ALU circuit that you build should look approximately as follows. (Note that the figure shows only 3 circuit, you will need to complete it to 8 circuits connected together.)

  • Make sure that it is working correctly before you turn in your file!
  • Add your (Full name) at the top of the circuit.

Bonus Task: Shift operations ( 2 points)

                        Add two more operations to the ALU, shr and shl as the following

Op CodeOperation
101Shr
110Shl

Hints:

  • In Logisim, you can build new circuits, and then use the circuits as components in other circuits. This allows you to build up complex circuits from simpler circuits (just like you make complex programs from simpler subroutines). To create a new circuit, use the "Add Circuit" command in the "Project" menu. You will be asked for a circuit name. Enter a name. The circuit that you have created is added to the palette of circuit elements in the upper left portion of the window, under the name of the file that you are working in (probably "Untitled"). To view and edit a circuit that you have created, double-click its name in the list.) you can use this created circuit in other complex circuits.
  • Sometime, you may find Logisim giving you blue "error" wires, sometimes because they haven't been connected yet, but sometimes it seems like it does this for no reason at all. If there is not an actual problem with the circuit, you can try this: Give the "Reset Simulation" command (Control-R, or find it in the "Simulate" menu). Try turning simulation off and on, using Control-E (or "Enable Simulation" in the "Simulate" menu). And make sure that you haven't connected two inputs of some circuit with a wire.

REPORTING REQUIREMENTS

The project is due (11/4/2021- at 11:59 pm). You will save all of your work in one Logisim file named Project-125.circ.).

You will need to submit two files, the Logisim file for your design and a project report file. The project report includes the following in exactly the order given:

  1. A cover page giving:
    1. The title, (ALU Circuit Design Project)
    1. your Full name
    1. your student ID number
    1. The course number (CS 125)
    1. your Section numbers.
  • Take a snapshot of the following modules and paste it in the file with the following titles:
    • FA-1bit (Showing your full name that you added at the top of the circuit)
    • ALU-1Bit (Showing your full name that you added at the top of the circuit)
    • ALU-8 Bit (Showing your full name that you added at the top of the circuit)

The two files, Logisim and the project report, will be submitted via blackboard as one compressed file.

This project is to be performed by individuals, NOT by teams of students. Interactions between students are to be limited to discussions of understanding of the specifications or to understanding of how to use the tools. All design and simulation work and files used should be yours.