register: Small fast storage inside the CPU; scheduler: The OS part that decides which ready process runs; time slice: A maximum turn in a round-robin schedule
55-minute lesson sequence
0–5 · Retrieve ALU and PC jobs individually.
5–15 · Model one fetch and one short scheduling example with cards.
15–40 · Build the CPU trace and two scheduling timelines; record individual answers.
40–50 · Compare button-handling choices and explain differences in the timelines.
50–55 · Write the independent multitasking exit.
Try before notes
Which unit does arithmetic, and which register holds the address of the next instruction?
Build the idea
A reading moves through components, not through a single magical CPU step. Registers record temporary values, buses carry transfers, the control unit coordinates and the ALU performs operations. State the toy machine’s operand convention before tracing.
Scheduling is a separate level of explanation: it allocates CPU time between processes. Fast switching on one core is concurrency, not proof that two instructions execute simultaneously on two cores.
Compare timelines with the same arrival times, bursts, quantum and switch-cost assumptions. Then make a limited claim such as earlier first response, not an unsupported claim that one policy is always best.
memory → MDR → IR → decode → execute
ready processes → scheduler → CPU time
See the method
Simplified fetch: PC = 40. Copy 40 to MAR. Memory sends its instruction into MDR over the data bus. Copy it to IR. PC becomes 41. CU decodes; execute next. Scheduling example: A needs 3 units; B needs 2; both arrive at 0. FCFS: A 0–3, B 3–5. Round robin with slice 1: A, B, A, B, A.
Predict then reveal
Immediate-operand toy instruction: PC=12, memory[12]=ADD 4, AC=9. Fetch then execute.
Reveal reasoning
Fetch: MAR=12, MDR and IR receive ADD 4, PC becomes 13. Execute adds literal 4 to AC, so AC=13. This explicitly differs from a memory-address operand convention.
A=3,B=3 arrive at 0, A first. With RR quantum 2 and zero switch cost, give the timeline and completion times.
Reveal reasoning
A runs 0–2; B 2–4; A 4–5; B 5–6. A completes at 5 and B at 6. One CPU runs one listed process at a time, despite both making progress over the interval.
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
Build a paper CPU trace with register cards. Start PC = 60, memory[60] = ADD 7, accumulator = 5. This toy instruction adds 7 to the accumulator. Show fetch and execution. State the address and data bus jobs.
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
Build a paper CPU trace with register cards. Start PC = 60, memory[60] = ADD 7, accumulator = 5. This toy instruction adds 7 to the accumulator. Show fetch and execution. State the address and data bus jobs.
Build FCFS and round-robin timelines for A = 4 units, B = 2, C = 1. All arrive at 0 in order A, B, C. Switching takes no time. Round-robin slice = 2. Mark finish times. Which lets C finish earlier?
The kiosk must respond to an occasional button press while recording readings. Compare repeated polling with an interrupt signal for the button. Give one benefit and one cost of your choice.
Check and explain
Do not confuse a CPU instruction cycle with an OS scheduling turn.
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
Does switching rapidly between two processes prove that two CPU cores are used?
HL challenge when ready
Why might a device use both interrupts and polling in different situations?
Week 7 homework
Show working. Keep code and output. Stop at 25 minutes and mark where you reached.
Make one revision card with three short parts. Convert decimal 46 to eight-bit binary and hex. Give the output of True AND NOT True. Name the CPU register holding the next instruction address.
A saved log has values [24, 25, 26]. Write the result of count_high(values, 25). Explain how a local controller can keep working when cloud access fails.
Choose the one revision-map area with the weakest evidence. Create one question and a checked answer for that area. Use only content already taught.
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
Trace a memory value through a register and a calculation.
No imports needed.
Hint and starter code
This models data flow; dictionary keys represent addresses.
# This models data flow; dictionary keys represent addresses.
memory = {10: 24}
register = memory[10]
result = register + 1
print(register, result)
Compare first-job completion time under two job orders.
No imports needed.
Hint and starter code
Assume time zero arrivals and no switching overhead; a single metric is not the whole scheduling decision.
# Assume time zero arrivals and no switching overhead; a single metric is not the whole scheduling decision.
orders = [[4, 1, 2], [1, 2, 4]]
for jobs in orders:
print("first finishes", jobs[0], "all finish", sum(jobs))