A8 — Memory and hardware wrap-up
Learn about your own computer and practice writing machine code.
Due Oct 21, 2026
Estimated time to complete (just the assignment, excluding the prep materials): 1.5–2.5 hours if you do all the parts.
Prep materials: Week 8: Memory and hardware wrap-up
What to do
Submit all your answers to Assignment 8 Submission on Brightspace. You can use a text response field, a text file, or a Markdown file for the main response, and you need to attach any screenshots you’ve taken.
Part 1: Your computer
Find out the memory hierarchy of your own computer. On Windows, open Task Manager (Ctrl+Shift+Esc), go to Performance, and look at CPU, Memory, and Disk. If you use another operating system, you can find similar instructions online or ask the instructor for help on Discord.
- Attach a screenshot (or several) and write down:
- the sizes of the L1, L2, and L3 caches;
- the size of the main memory (RAM);
- the size of your main disk, and whether it is an SSD or an HDD.
Based on what you’ve learned in the prep materials, arrange the memory levels from the previous question from fastest to slowest, and specify where the CPU registers fit in this hierarchy.
Do you notice any relationship between the size and the speed? Write down your observations and why you think that is.
Find out which processor your computer uses, what its clock speed is, and how many cores it has. Write down the answers and attach a screenshot (or several).
Part 2: Microprogramming simulator
In the Microprogramming simulator, create a microprogram that implements the following:
- Load the value from memory address 9 into register R0.
- Load the value from memory address 10 into register R1.
- Add the value of R1 to R0.
- Subtract the value of R1 from R0.
- Store the result from R0 into memory address 0.
Test this program with different values in memory addresses 9 and 10 and make a screenshot of the browser window.
Write a response to the following:
Pick one of the load/store instructions and describe it relates to the knobs&switches simulator in the right panel.
Pick one of add/subtract instruction and describe how it relates to the knobs&switches simulator in the right panel.
Describe what this program does to the memory.
Part 3. Instructions and programs
Consider a CPU similar to the one in Instructions & Programs: Crash Course Computer Science #8. It has two registers, A and B, and the following instructions:
| Instruction | What it does |
|---|---|
LOAD_A addr |
Copy the value from memory address addr into register A |
LOAD_B addr |
Copy the value from memory address addr into register B |
STORE_A addr |
Copy the value from register A into memory address addr |
ADD |
A ← A + B |
SUB |
A ← A − B |
JUMP addr |
Continue with the instruction at address addr |
JUMP_NEG addr |
Continue with the instruction at address addr if A is negative; otherwise, continue with the next instruction |
HALT |
Stop the program |
The memory holds the following program and data:
0: LOAD_A 14
1: LOAD_B 15
2: SUB
3: JUMP_NEG 5
4: JUMP 2
5: ADD
6: STORE_A 13
7: HALT
...
13: 0
14: 17
15: 5Trace the program step by step. For every instruction executed, write down its address, the instruction, and the values of registers A and B after it runs. Start with both registers holding 0.
Write a response to the following:
What value is in memory address 13 when the program halts?
How many instructions does the CPU execute in total, counting
HALT?In general, what does this program compute from the values at addresses 14 and 15? Check your answer by tracing the program (in your head or on paper) with different values, for example, 9 and 3.
What happens if address 15 holds 0? Why?
Grading
Part 1 is graded for completion (40% of the grade); parts 2 (50% of the grade) and 3 (10% of the grade) are graded for correctness.