CSE/EEE 120
Lab 4 Answer Sheet
The Complete Microprocessor
Name:
Instructor/Time: Dr. Steven Millman / T & Th (3:00 pm-4:15 pm) Date: 06 April 2023
Task 4-1: Build and Test the Memory-Address-Generation Circuit
Include a picture of your Digital circuit here:
Please comment on the single biggest issue you were facing when designing the circuit.
I faced no such issues when designing the circuit.
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaves as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
No such issues were faced when simulating the circuit.
Task 4-2: Build and Test the Controller Circuit
Include a picture of your two_bit_mux circuit here:
Please comment on the single biggest issue you were facing when designing the circuit.
I faced no such issues when designing the circuit.
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaves as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
No such issues were faced when simulating the circuit.
Include a picture of your two_bit_reg circuit here:
Please comment on the single biggest issue you were facing when designing the circuit.
I faced no such issues when designing the circuit.
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaves as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
No such issues were faced when simulating the circuit.
Include a picture of your controller circuit here:
Please comment on the single biggest issue you were facing when designing the circuit.
Loading the ROM values into the circuit.
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaves as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
Understanding the ROM values.
Task 4-3: Build the Complete Microprocessor Circuit
Include a picture of your Digital circuit here (make sure to show final values as shown in figure 17):
Please comment on the single biggest issue you were facing when designing the circuit.
Connecting all the wires to the correct ports.
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaves as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
Fixing issues in the circuits used in the microprocessor circuit.
Task 4-4: Simulate the Design in Verilog
Include a picture of your waveforms here:
Please comment on the single biggest issue you were facing when simulating the processor.
I faced no such issues when simulating the processor.
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaved as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
I faced no such issue when simulating the circuit.
Task 4-5: Add the AND, ZERO, SUB, and STORE ACC Instructions
Use Table 1 and Table 2 to enter your values into the microinstruction definition table for each of the
four instructions asked for in the laboratory manual. Be sure to label the name of each and every
instruction.
Table 1
Instruction
AND
ZERO
Opcode
3
4
step
00
01
02
03
00
01
02
03
Description
Bit #
next_step[1:0]
13:12
01
00
00
00
01
00
00
00
unused
11:10
00
00
00
00
00
00
00
00
use_pc
9
1
1
0
0
1
0
0
0
load_mar
8
0
0
0
0
0
0
0
0
arith
7
0
0
0
0
0
1
0
0
invert
6
0
0
0
0
0
1
0
0
pass
5
0
0
0
0
0
0
0
0
load_acc
4
0
1
0
0
0
1
0
0
acc_to_db
3
0
0
0
0
0
1
0
0
read
2
1
1
0
0
1
0
0
0
write
1
0
0
0
0
0
0
0
0
load_ir
0
1
0
0
0
1
0
0
0
Table 2
Instruction
SUB
STORE ACC
Opcode
5
6
step
00
01
02
03
00
01
02
03
Description
Bit #
next_step[1:0]
13:12
01
00
00
00
01
10
00
00
unused
11:10
00
00
00
00
00
00
00
00
use_pc
9
1
1
0
0
1
1
0
0
load_mar
8
0
0
0
0
0
1
0
0
arith
7
0
1
0
0
0
0
0
0
invert
6
0
1
0
0
0
0
0
0
pass
5
0
0
0
0
0
0
0
0
load_acc
4
0
1
0
0
0
0
0
0
acc_to_db
3
0
0
0
0
0
0
1
0
read
2
1
1
0
0
1
1
0
0
write
1
0
0
0
0
0
0
1
0
load_ir
0
1
0
0
0
1
0
0
0
Test your instructions by writing and executing programs. Record at least programs and the output four
of each program in tables like that of Table 3.
Table 3
Program #1 (AND)
Address
Value
Operation (In English)
0
0
The 'Load ACC' Opcode
1
3
The number '3' to be loaded into the Accumulator
2
3
The 'AND function' Opcode
3
5
The number '5' to be ANDed with 3
4
2
The 'Stop' Opcode
What was the final output of your program? ___1__
Was the program successful? YES_
If not what error(s) did you find in your circuit?
Table 4
Program #2 (ZERO)
Address
Value
Operation (In English)
0
0
The 'Load ACC' Opcode
1
3
The number '3' to be loaded into the Accumulator
2
4
The ZERO function' Opcode
3
2
The 'Stop' Opcode
What was the final output of your program? ___0__
Was the program successful? YES_
If not what error(s) did you find in your circuit?
Table 5
Program #3 (SUBTRACT)
Address
Value
Operation (In English)
0
0
The 'Load ACC' Opcode
1
7
The number '7' to be loaded into the Accumulator
2
5
The ‘SUBTRACT function' Opcode
3
4
The number '4' to be SUBtracted from 7
4
2
The 'Stop' Opcode
What was the final output of your program? ___3__
Was the program successful? YES_
If not what error(s) did you find in your circuit?
Table 6
Program #4 (LOAD ACC)
Address
Value
Operation (In English)
0
0
The 'Load ACC' Opcode
1
9
The number '9' to be loaded into the Accumulator
2
6
The ‘STORE ACC function' Opcode
3
7
The number '9' to be written to address ‘7’
4
2
The 'Stop' Opcode
What was the final output of your program? ___9__
Was the program successful? YES_
If not what error(s) did you find in your circuit?
Include a picture of your AND here: waveforms
Include a picture of your ZERO here: waveforms
Include a picture of your SUB here: waveforms
Include a picture of your STORE ACC here: waveforms
Did the circuit behave as expected? If no, what was wrong?
Yes, the circuit behaves as expected.
Please comment on the single biggest issue you were facing when simulating the circuit.
Making the opcodes for each of the functions.
Include a picture of your rom_vals.hex if your made choice 1 or 2 or a picture of the ROM for choice 3
here:
Include your program from ram_vals.txt:
AND
ZERO
SUBTRACT
STORE ACC
Task 4-6: Invent Your Own Instruction (Extra Credit)
Table 7
Instruction
Opcode
7
step
00
01
02
03
Description
Bit #
next_step[1:0]
13:12
01
00
00
00
unused
11:10
00
00
00
00
use_pc
9
1
0
0
0
load_mar
8
0
0
0
0
arith
7
0
1
0
0
invert
6
0
0
0
0
pass
5
0
0
0
0
load_acc
4
0
1
0
0
acc_to_db
3
0
1
0
0
read
2
1
0
0
0
write
1
0
0
0
0
load_ir
0
1
0
0
0
Table 4
Program #2 (DOUBLE)
Address
Value
Operation (In English)
0
0
The 'Load ACC' Opcode
1
5
The number '5' to be loaded into the Accumulator
2
7
The DOUBLE function' Opcode
3
2
The 'Stop' Opcode
What was the final output of your program? ___A__
Was the program successful? YES_
If not what error(s) did you find in your circuit?
DOUBLE
Include your Verilog program here: iverilog -o microprocessor.exe microprocessor.v micro_top.v
micro_stim.v
Include a picture of your waveforms here:
Include a picture of your ROM contents here:
Task 4-7: Create a video and submit your report
Record a short video showing your schematics in Digital and your waveforms in GTKWave. Be sure to
show yourself in the video and show your screen. Explain how your circuit works – you need to convince
the grader you did the lab and understand it! Copy and paste the link to your video below. Make sure
the link is working and pointing to the correct video. Remember to include the password if required.
Do NOT upload your video to Canvas or YouTube. If your circuit is not working as expected, explain in
the video how it is not working and why you think it is not working.
Video Link:
https://drive.google.com/file/d/16jU9vGTl_2XDXKASXeS1bGWOs__HzuyZ/view?usp=sharing
L LAB 4: AB REPORT RADE G SHEET
Name:
NOTE: You submit the zip file in order to show your work.
If the zip file is not submitted there is a 5 point deduction!
Instructor Assessment
Grading Criteria
Max Points
Points Lost
Description of Assigned Tasks, Work Performed & Outcomes Met
Task 4-1: Build and Test the Memory-Address-Generation
Circuit
10
Task 4-2: Build and Test the Controller Circuit
10
Task 4-3: Build the Complete Microprocessor Circuit
10
Task 4-4: Write and Execute a Simple Program for Your
Microprocessor in Simulation
10
Task 4-5: Add the ‘AND’, ‘Zero’, ‘Subtract’, and ‘Store ACC’
Instructions
30
Task 4-6: Invent Your Own Instruction (Extra Credit)
10
Task 4-7: Record your video
10
Points Lost
Lab Score (80 points total)
Late Lab
Lab Score