Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson Objectives A note about notes: Aims

Similar presentations


Presentation on theme: "Lesson Objectives A note about notes: Aims"— Presentation transcript:

1 Lesson Objectives A note about notes: Aims
To understand the main component parts of a CPU To be able to define the term “Register” To be able to state and explain the purpose of common registers To be able to describe how the FEC affects registers To be able to define the term “data bus” and give examples A note about notes: We will not be holding your hands in lessons. You are more than capable of working out when you should be making a note of things as we go through a lesson. If something is truly essential to copy down you will see this symbol: Otherwise, use your common sense, make notes on things and ask questions to fill out the gaps in your understanding.

2 Recap Von Neumann Architecture

3 When is a bus not a bus? When it’s a bus…
A data bus is simply a connection between components in a computer system The CPU uses several buses to send and receive data to and from memory Each one has a specific purpose, the more buses, the more data you can have travelling in “parallel” – remember pipelining? We are interested in the: Data Bus Control Bus Address Bus

4 The address bus: this determines the location in memory that the processor will read data from or write data to. The data bus: this contains the contents that have been read from the memory location or are to be written into the memory location. The control bus: this manages the information flow between components indicating whether the operation is a read or a write and ensuring that the operation happens at the right time.

5 Bus diagram This is for a 32 bit CPU – why?

6 What’s inside a CPU then?
Control Unit

7 The role of the control unit should be obvious:
Every clock pulse, it generates signals that orchestrate the Fetch, Execute Cycle It is responsible for: Fetching and decoding instructions Receiving and sending instructions and associated data to the correct parts of the CPU to be processed Sending data to and from the processor to memory

8 Registers What really makes the CPU work, however, are REGISTERS. A Register is simply a fixed width piece of memory – usually 32 or 64 bits A Register will usually have a very specific role – such as holding the a memory address. Although there are “general purpose” registers

9 Video Watch:

10 Task Find out the purpose and function of the Arithmetic and Logic Unit (ALU) Find out the purpose and function of the following registers: Program Counter (PC) Accumulator (ACC) Memory Address Register (MAR) Memory Data Register (MDR) Current Instruction Register (CIR)

11 Compare notes… ALU: The Arithmetic and Logic Unit (ALU) is responsible for performing most of the computation in a modern processor. This includes basic arithmetic such as binary addition and subtraction, operations to shift and rotate the bits in a binary number, comparison operations (such as testing for zero, negative numbers, etc.) and logical operations such as AND, OR, XOR (exclusive OR) and NOT (negation).

12 Memory Address Register (MAR)
Program Counter (PC) Holds the address of the NEXT instruction to be read from memory Accumulator (ACC) A multi purpose register in which data is held by the CPU whilst an instruction is carried out on it. Usually holds the input and output of calculations performed by the ALU Memory Address Register (MAR) Holds the memory address of the instruction that will be read in the current cycle Memory Data Register (MDR) Holds the memory address of the next piece of data to be read or written Current Instruction Register (CIR) Holds and instruction that has been read from memory and will be, or is being, processed

13 Practical time To understand what’s going on here, and to be able to answer exam questions, we need to do some programming! Time to meet the Little Man.

14 The little man computer is a simulation of how a CPU works and uses a very small version of Assembly Language What’s Assembly Language… The little man is the Control Unit of the CPU, fetching and carrying out instructions, storing data etc.

15 Demo LDA ten start OUT SUB one BRP start HLT ten DAT 10 one DAT 1

16 Your Turn Write an LMC program that:
Asks the user for two numbers to be inputted Finds the biggest number Outputs the answer Extension: Loop round to compare two more numbers unless the user enters a negative number

17 INP STA first STA second SUB first BRP higher LDA first BRA done higher LDA second done OUT HLT first DAT second DAT

18 A note on addressing LDA &5 LDA #5 What’s the difference? Immediate (direct) = & = this IS the data indirect addressing = # = Go and get the data from the address this memory location points to

19 June 2016 As Level Paper

20

21 Task You need to be able to explain the effect that the fetch/execute cycle has on common registers. For the following simple program, explain what happens at each step to the Program Counter (PC) Accumulator (ACC) Memory Address Register (MAR) Memory Data Register (MDR) Current Instruction Register (CIR) INP STA 99 ADD 99 OUT HLT

22 Further reading P

23 Review/Success Criteria
You should now be confident that you know: The internal structure of the CPU The names of common registers The function of common registers The effect of program execution on the CPU registers For next lesson you must: Find out what RISC and CISC mean Find out what the limitations of the Von Neumann architecture are


Download ppt "Lesson Objectives A note about notes: Aims"

Similar presentations


Ads by Google