Assignment
Lab assignment 1 - ALU
Lab assignment 1 - ALU
Completion requirements
Lab Assignment 1
In this assignment, students will create a simple CPU that implements very basic arithmetic and logical functions.
READ THE GUIDELINES BEFORE YOU START WITH YOUR ASSIGNMENT. READ EACH SECTION BEFORE YOU START WORKING ON IT. THIS LAB MUST FINISHED INDIVIDUALLY.
The assignment is divided into three parts as follows:
Part 1 -
Create digital circuits for the following CPU components:
Use the LogiSim tool to create these circuits.
4 - The Encoder:
5 - The Multiplexer:
Save each of those circuits to your computer. When you submit those circuits, the naming must be as follows:
FIRSTNAME_LASTNAME_GROUP_COMPONENTNAME_LAB1_PART1.circ
Part 2 -
Create the Truth Table for each of the above logical expressions. The truth tables must be created in an external text editor and uploaded with names as follows:
FIRSTNAME_LASTNAME_GROUP_COMPONENT_LAB1_PART2.png
Part 3 -
In this part, you are expected to use some of the components you have simulated in Part 1 to create a more complex circuit. The circuit you need to create is made out of two sections as follows:
SECTION 1: This Section must be done by both groups.

SECTION 2: Each group (IASM) and (MAHM) will create an additional circuit that will be connected to the circuit from Section 1.


Save the complete circuit (SECTION1 and 2) to your computer and submit the file. The naming of your file must be as follows: FIRSTNAME_LASTNAME_GROUP_LAB1_PART3.circ
To solve this bonus point, change the inputs A and B and observe how Y changes.
This bonus point can be submitted in the text box of this assignment.
Guidelines
1- Label all the inputs and outputs in the circuits.
2- Once you complete SECTION 1, I recommend that you save it seperately. This will help you save any progress you make throughout this Lab. Please use that so that you do not lose your progress.
3- NO EXCEPTIONS/EXTENSIONS WILL BE GIVEN TO ANYONE WHO LOSES THEIR PROGRESS IF THEY DO NOT SAVE THEIR WORK. THAT IS YOUR RESPONSIBILITY AND YOU ARE ACCOUNTABLE FOR IT.
4- Check each part and section for the submission naming required. There will be no limit to how many files you can submit. So submit all the circuits required for this assignment with their proper naming as indicated in each part/section of this assignment. If you fail to name the files as required, I might not see the circuit and you will lose points. It is advised for you to keep a copy of your work somewhere safe just in case.
5- DO NOT FORGET TO CLICK THE SUBMIT BUTTON WHEN YOU FINISH YOUR ANSWERS. OTHERWISE, I WILL NOT SEE YOUR ANSWERS.
6- Deadline is Oct. 14.
In this assignment, students will create a simple CPU that implements very basic arithmetic and logical functions.
READ THE GUIDELINES BEFORE YOU START WITH YOUR ASSIGNMENT. READ EACH SECTION BEFORE YOU START WORKING ON IT. THIS LAB MUST FINISHED INDIVIDUALLY.
The assignment is divided into three parts as follows:
Part 1 -
Create digital circuits for the following CPU components:
Use the LogiSim tool to create these circuits.
1 - The Subtractor: You are required to create two circuits, one for the half subtractor and the other for the full subtractor.
- Half subtractor:
D = A XOR B
Bout = NOT A AND B
- Full Subtractor:
D
= A XOR
B XOR
Bin
Bout
= (NOT
A AND
Bin) OR
(NOT
A AND
B) OR
(B AND
Bin)
2 - The Comparator:
C
= NOT
A AND
B
D
= NOT
((NOT
A AND
B) OR
(A AND
NOT
B))
E
= A AND
NOT
B
3 - The Decoder:
Q0 = NOT
A AND
NOT
B
Q1 = NOT
A AND
B
Q2 = A AND
NOT
B
Q3 = A AND
B
A1 = Y3 OR
Y2
A0 = Y3 OR
Y1
- What would the output be when the inputs of this circuit are as follows:
Y3 = 0
Y2 = 1
Y1 = 1
Y0 = 0
Would the circuit yield to an erroneous case now? Why? If this is an unwanted scenario, what can be done to correct the output?
This question can be answered in the text box of this assignment.
- BONUS QUESTION: Create the circuit in LogiSim which is capable of a workaround for the issue in the previous part. Name your circuit as: FIRSTNAME_LASTNAME_GROUP_ENCODER_BONUS_LAB1_PART1.circ
Y
= ( (NOT
S1 AND NOT
S0) AND
I0 ) OR ( (NOT S1 AND S0) AND I1 ) OR ( (S1 AND NOT S0) AND I2 ) OR ( (S1
AND
S0) AND
I3)
Save each of those circuits to your computer. When you submit those circuits, the naming must be as follows:
FIRSTNAME_LASTNAME_GROUP_COMPONENTNAME_LAB1_PART1.circ
Part 2 -
Create the Truth Table for each of the above logical expressions. The truth tables must be created in an external text editor and uploaded with names as follows:
FIRSTNAME_LASTNAME_GROUP_COMPONENT_LAB1_PART2.png
Part 3 -
In this part, you are expected to use some of the components you have simulated in Part 1 to create a more complex circuit. The circuit you need to create is made out of two sections as follows:
SECTION 1: This Section must be done by both groups.
In this section, you MUST use the digital circuits of the components you created in Part 1 and HOME TASK 1 to recreate the below digital circuit.
There are Five inputs: A and B will be connected to a Decoder. R0, R1, and R2, are connected to a 3-bit register. There is a multiplexer connecting the decoder and the register as shown in the illustration below. The Input A will be used as the S0 bit and Input B will be used as the S1 bit for the multiplexer. The Y output of the multiplexer should be used as the Set bit "s" for the register. Output Q3 of the decoder will be used as the Enable bit "e" for the register. The register will have three output bits O0, O1, and O2.
Take note of the input/output labels and match them exactly as shown in the below illustration as the inputs must match to what is shown for the circuit to function as needed to complete this lab.

SECTION 2: Each group (IASM) and (MAHM) will create an additional circuit that will be connected to the circuit from Section 1.
In this section, group1 (IASM) and group2 (MAHM) will complete different circuits.
group1 (IASM):
For the IASM group1, you will need to create a simple ALU with one 3-bit adder, one 3-bit subtractor, and one comparator.
Tasks and descriptions:
- The ALU will have two 3-bit input:
1- The first will be called C and it is made out of three bits C0, C1, and C2.
2- The second input will be the output of the register from SECTION 1.
- The comparator will be connected to the Cout of the adder and the Bout of the subtractor.
- The output of the ALU does not need to be connected to anything. Use a Logic Output in the simulator.
The below illustration should clarify the structure of the ALU.

Note The following for this section:
1- The adder will add the ALU input C0, C1, and C2 with the output of the Register O0, O1, and O2 respectively.
2- The subtractor will be implemented with C0, C1, and C2 as the minuend and O0, O1, and O2 as the subtrahend.
3- When testing your 3-bit subtractor, do not forget that the minuend must always be larger than the subtrahend in order for the subtractor to give accurate results.
Take note of the input/output labels and match them exactly.
group2 (MAHM):
For the MAHM group2, you will need to create a 3-bit subtractor where the input C0, C1, and C2 as the minuend and O0, O1, and O2 as the subtrahend.

Take note of the input/output labels and match them exactly.
Save the complete circuit (SECTION1 and 2) to your computer and submit the file. The naming of your file must be as follows: FIRSTNAME_LASTNAME_GROUP_LAB1_PART3.circ
10 BONUS POINTS:
What does Y equal in relation to inputs A and B. Write the logical expression in which Y is represented by inputs A and B.To solve this bonus point, change the inputs A and B and observe how Y changes.
This bonus point can be submitted in the text box of this assignment.
Guidelines
1- Label all the inputs and outputs in the circuits.
2- Once you complete SECTION 1, I recommend that you save it seperately. This will help you save any progress you make throughout this Lab. Please use that so that you do not lose your progress.
3- NO EXCEPTIONS/EXTENSIONS WILL BE GIVEN TO ANYONE WHO LOSES THEIR PROGRESS IF THEY DO NOT SAVE THEIR WORK. THAT IS YOUR RESPONSIBILITY AND YOU ARE ACCOUNTABLE FOR IT.
4- Check each part and section for the submission naming required. There will be no limit to how many files you can submit. So submit all the circuits required for this assignment with their proper naming as indicated in each part/section of this assignment. If you fail to name the files as required, I might not see the circuit and you will lose points. It is advised for you to keep a copy of your work somewhere safe just in case.
5- DO NOT FORGET TO CLICK THE SUBMIT BUTTON WHEN YOU FINISH YOUR ANSWERS. OTHERWISE, I WILL NOT SEE YOUR ANSWERS.
6- Deadline is Oct. 14.
If you have any questions, please post them on the Course participant's forum (ask questions from a teacher/other participants). Other students are encouraged to participate in asking and answering questions.