The video is on YouTube, which needs a VPN on most networks in mainland China. It is extra: the lesson works without it.
Try before notes
What operation could an ALU perform using logic gates?
Build the idea
A CPU contains units that do different jobs. The control unit coordinates steps. The ALU performs arithmetic and logic. Registers hold small amounts of immediately needed information. These parts cooperate; the CPU is not just the ALU.
Separate an address from the value stored there. MAR holds the memory address being accessed. MDR holds the instruction or data moving to or from that address. PC holds the next instruction address, while IR holds the current instruction.
An address bus selects a location. A data bus carries the value. Control signals specify operations such as read or write. In a memory read the requested value travels from memory toward the CPU.
CPU [CU | ALU | registers]
address → MEMORY
data ↔ MEMORY
control ↔ MEMORY
See the method
The control unit coordinates work. The ALU performs arithmetic and logic. PC holds the address of the next instruction. MAR holds a memory address. MDR holds data transferred to or from memory. IR holds the current instruction. AC holds a working result in this model. Address, data and control buses have different jobs.
Predict then reveal
Memory location 30 contains 84. A read is requested. What do MAR and MDR hold once the read completes?
Reveal reasoning
MAR=30 identifies the location. MDR=84 contains the value returned. The data bus carried 84; the address bus selected 30.
The current instruction is ADD 9 and the next instruction is at address 6. Which belongs in IR and which in PC?
Reveal reasoning
IR holds ADD 9, the current instruction. PC holds 6, the address of the next instruction. Neither description says that PC contains the instruction itself.
Work one step together
Read the first task. Each learner predicts the first step privately. Compare the method, then complete one intermediate row or one code iteration together. Do not display a finished workbook answer.
Practice
A CPU needs the value at memory address 12. Name the register that holds 12 and the register that receives the value. Explain the address, data and control bus roles in this read.
Your turn
Complete the remaining steps of task 1 alone, then the next tasks. Predict before running code. Save your own evidence before comparing.
Practice
A CPU needs the value at memory address 12. Name the register that holds 12 and the register that receives the value. Explain the address, data and control bus roles in this read.
Draw CPU and main memory. Inside CPU label CU, ALU, PC, MAR, MDR, IR and AC. Add the three bus labels and arrows for a memory read. Use the diagram to explain one addition.
Check and explain
A register name identifies its job, not a kind of value that is interchangeable with every other register.
Point to the first step, row, condition or requirement that supports your answer. If results differ, find the first different state and repair one cause.
Show what you know
How does a memory address differ from the data at that address?
HL challenge when ready
Compare a single core, multiple cores and a co-processor.
Week 3 homework
Show working. Keep code and output. Stop at 25 minutes and mark where you reached.
In the toy machine PC=4. Memory 4 contains LOAD 20 and memory 20 holds 9. Trace the fetch and execute.
Explain why cache, RAM and SSD are not interchangeable. Use one job for each.
Six independent instructions use F,D,E,W with no stalls. Find the ideal cycles and compare with no overlap. Write ideal_cycles(n) in Python for n >= 1. Test n = 1, 4 and 6.
Retrieve logic: simplify (A AND B) OR (A AND NOT B). Give one proof step.
Spend about 3 minutes on each during practice time. Predict, run, change one thing, then explain. These prompts do not add homework.
A starter is runnable code to explore or complete. If the playground restores your saved code, the linked starter is selected in Example: use Load example when ready. Download your work before confirming replacement.
Prompt 1
Model reading an addressed memory location into a register. Change the address.
No imports needed.
Hint and starter code
A register is a small CPU storage location; the list is only a memory model.
# A register is a small CPU storage location; the list is only a memory model.
memory = [10, 20, 30]
address = 1
register = memory[address]
print(address, register)