CS04-03 Computer Science Watch
The registers: MAR, MDR, PC and Accumulator
In this lesson
In this video you'll learn about the registers: MAR, MDR, PC and accumulator for GCSE Computer Science, with worked examples and the mistakes examiners report. By the end you'll be able to state what each of the MAR, the MDR, the Program Counter and the Accumulator stores, and tell an ADDRESS from DATA - saying for each register which of the two it holds and why that is the distinction the mark scheme pays for.
What it covers
- 3:39 Two of the four registers give their job away in their own names, if you read them slowly
- 5:36 The Program Counter holds the address of the next instruction to be fetched
- 8:11 The accumulator holds the result
- 10:23 The four registers are not alone inside the processor
- 11:28 The same four registers as a matching table, with a definition in each row and a name to write beside it
Key words
About this video
GCSE Computer Science - The registers: MAR, MDR, PC and Accumulator | Inside the computer 3/6
In this video you'll learn about the registers: MAR, MDR, PC and accumulator for GCSE Computer Science, with worked examples and the mistakes examiners report.
By the end you'll be able to state what each of the MAR, the MDR, the Program Counter and the Accumulator stores, and tell an ADDRESS from DATA - saying for each register which of the two it holds and why that is the distinction the mark scheme pays for.
For: OCR GCSE Computer Science
Watch first: CS04-02 The CPU and the von Neumann model
Specifications: OCR J277 1.1.1
Video code: CS04-03 - search YouTube for "ScholaFly CS04-03" to come straight back to this video.
Videos in this chapter:
CS04-00 — Inside the computer - Intro
CS04-01 — Hardware and software
CS04-02 — The CPU and the von Neumann model
CS04-03 — The registers: MAR, MDR, PC and Accumulator
CS04-04 — The fetch-execute cycle
CS04-05 — What makes a CPU fast
CS04-06 — Embedded systems
#GCSEComputerScience #ComputerScience
For more, visit ScholaFly: https://scholafly.com
Read the transcript
Picture a shop till adding up your shopping, and freeze the processor inside it halfway through a sum. Four tiny boxes in there hold four numbers: eight, fifty-two, four and nine. One of them is a price, and one is the total so far. The other two are not amounts at all. They are places in memory. Which box holds which number, and how could you tell? It comes down to four boxes and one idea, and the idea is the difference between a place and a thing.
Inside the computer has six videos, and this is the third of them. The CPU and the von Neumann model sets up everything here, so start there if this feels shaky.
A register is a very small, very fast store inside the processor, the CPU: the part that holds one item at a time. The frozen till has four of them. Main memory sits outside the processor as a long row of locations, each with its own number. The program's instructions sit there one after another, and so do the prices it works on. An instruction is one step of a program, such as add this price to the total. An address is the number of a location. It says where something is kept, the way a house number says which door on a street, without telling you who lives there. Data is what is kept at a location, such as a price or a total. An instruction kept there counts on this side too, because it is a thing, not a place. So an address is a where, and data is a what. The same number could be either, and the job it is doing decides which. Now try this: location fifty-two holds four pounds. Which number is the address? Fifty-two. It names the location, so it is the address, and the four pounds is what sits inside. One exam board names these four registers in its specification and asks what each one holds. Another board's specification says, in as many words, that knowledge of specific registers is not required. Find your own board's row in the table now. If these four are not on yours, they are optional background, and four sentences will make the fetch-execute cycle easier to follow. The till stays frozen on purpose. An exam asks what each box holds at a moment, not how values travel between the boxes, and the cycle that moves things along has a video of its own.
Two of the four registers give their job away in their own names, if you read them slowly. The first is the Memory Address Register, the MAR for short. The MAR holds the address of the location in memory that is about to be read from, or written to. Think of it as the number on the door the processor is about to open. In the frozen till, the instruction being carried out says add the price kept at location fifty-two. So the MAR is holding fifty-two. The second is the Memory Data Register, the MDR. It holds the data, or the instruction, that has just been fetched from memory, or is about to be written to it. Fetched means brought out of memory into the processor. Of the till's four numbers, which one is sitting in the MDR right now? Four, the price of four pounds. It is what came out of location fifty-two, the thing behind that door. Two names, and two answers handed over: the address register holds an address, and the data register holds data. One examiner's report puts these two first: many candidates were able to identify registers that are in the CPU, most commonly the MAR and MDR. Read the name slowly and it answers for you; that is the way to join them.
The Program Counter holds the address of the next instruction to be fetched. It goes on the address side, next to the MAR. The program sits in memory one instruction per location, in order. After each step, the processor has to know where to go next, and the Program Counter is where that answer is kept. Think of a bookmark in a novel. It says nothing about how many novels you have finished, or how many chapters you have read. It only marks where you carry on reading. In the frozen till, the processor is carrying out the instruction at location seven. Which number is in the Program Counter at this moment, and why? Eight. The Program Counter holds where to go next, not the step in hand, and the next step is kept at eight. So the Program Counter never holds an instruction. It holds an address, and it is the address of the next one, not the one being carried out. A student writes this about it, and it is marked wrong: the program counter keeps a count of how many programs have been run. What has the student misread in the name program counter, and why? The word program. It means the one program in use, not a tally. The counter counts addresses, usually one location at a time. One examiner's report names it as a misconception: a common misconception is that the program counter keeps track of how many programs have run or counts the instructions that are being processed. The fix is to write the full sentence every time: the Program Counter holds the address of the next instruction to be fetched. Address and next are the two words doing the work.
The accumulator holds the result of a calculation carried out by the arithmetic logic unit, the part of the processor that does the calculating. To accumulate means to build up, and in the till that is the running total. Right now it holds nine pounds, the total so far. The next price is four pounds, and it is added to the nine pounds already there. Which lands in the accumulator: nine add four, or thirteen? Thirteen. The adding happens outside the accumulator, and only the result goes in. The calculation itself never enters the box. One examiner's report sets all four of these registers side by side. Candidates were often able to gain the mark for a description of the MDR. Some candidates inaccurately identified the MAR or the PC as storing data instead of the address of the data. Candidates who gave the accumulator sometimes gave a response that it stored the calculations instead of the result of the calculations. Two fixes come out of that. For the MAR and the Program Counter, write address, never data. For the accumulator, write result, never calculation, and a result is a what, so it joins the MDR on the data side. Address says where, data says what. That one line sorts all four registers. The MAR and the Program Counter hold a where. The MDR and the accumulator hold a what.
The four registers are not alone inside the processor. A student names two registers: the MDR and the ALU. Which one is wrong, and why? The ALU, the arithmetic logic unit. It calculates, which is doing something, and the control unit directs. A register only holds one item. One examiner's report names the same mix-up: some candidates inaccurately identified other components of the CPU such as the ALU and CU. The habit that fixes it is the verb test from the video on the CPU and the von Neumann model. If a part has a verb, such as directs or calculates, it is not a register.
Now the same four registers as a matching table, with a definition in each row and a name to write beside it. Row one holds the address of the next instruction to be fetched. Row two holds the data just fetched from memory. Row three holds the address of the location about to be accessed. Which register fits each row, using no name twice? The Program Counter, then the MDR, then the MAR, each name used once. Next, a different filling of the same table, and this one is marked wrong. MAR, MDR, MDR: which row went wrong first, and why did row three follow? Row one. The MAR has address in its name, but the next instruction is the Program Counter's job. With the MAR used up, row three got the MDR, and one slip became two. Now the MDR appears twice and the Program Counter not at all. One examiner's report describes that chain: common errors included giving MAR for the first definition in place of the PC and then following on with the MDR for the third row because the MAR had already been given by the candidate. The fix is a check in three moves. Fill the rows you are sure of first, read what is left against what is left, and then count that each name appears once.
Four registers now, asked in a jumbled order, with no till to lean on. First, a new moment: the till is storing thirteen pounds at location sixty. Which register holds thirteen? The MDR. Thirteen pounds is data about to be written to memory, so it sits on the data side. Now, same moment: which register holds sixty? The MAR. It holds the address of the location about to be used, and the direction of travel does not change that. Now, a student says the accumulator stores the calculation. Which word needs changing? Calculation becomes result. The accumulator holds the result, never the sum that made it. One more: which two registers hold an address, and the address of what? The MAR holds the address of the location about to be accessed. The Program Counter holds the address of the next instruction. And the frozen till from the start reads plainly now. Eight is in the Program Counter and fifty-two is in the MAR, two places. Four is in the MDR and nine is in the accumulator, two things, until the price is added and nine becomes thirteen.
Give this one a thumbs up if you could teach these four registers to a friend. If not yet, write the four sentences out once by hand; they tend to stay after that.
Next in this chapter: The fetch-execute cycle, which puts these four boxes to work, one instruction at a time.
For more, visit scholafly.com, or watch the next video.
Related terms
For: OCR GCSE J277
On the specification
| Board | Spec | Statement |
|---|---|---|
| OCR GCSE J277 | 1.1.1 | Architecture of the CPU |
For teachers
This GCSE Computer Science lesson teaches the registers: MAR, MDR, PC and Accumulator. By the end, students should be able to state what each of the MAR, the MDR, the Program Counter and the Accumulator stores, and tell an ADDRESS from DATA - saying for each register which of the two it holds and why that is the distinction the mark scheme pays for. It works through four worked examples and the mistakes examiners report.