0% found this document useful (0 votes)
12 views31 pages

L1 Architecture of The CPU

Uploaded by

izellah harrison
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views31 pages

L1 Architecture of The CPU

Uploaded by

izellah harrison
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Objectives

Accumulator
Understand the purpose
of the CPU and the Understand common CPU
fetch-execute cycle components including:
ALU (Arithmetic Logic Unit)
Understand the following CU (Control Unit)
registers in the Von Cache
Registers
Neumann architecture:
MAR (Memory Address Register)
MDR (Memory Data Register)
Program Counter
The Architecture of the CPU
Unit 1 Systems architecture

Starter
• A laptop and smartphone are both examples of
computer systems
• What are the input and output devices for these computer
systems?
• What component carries
out the processing of
the instructions?
The Architecture of the CPU
Unit 1 Systems architecture

Starter
• Input devices:
• Laptop: keyboard, buttons, trackpad, microphone
• Smartphone: microphone, buttons, GPS sensor, gyroscopic
sensor, touch part of the touchscreen
• Output devices:
• Laptop and smartphone: speakers, display

• Processing:
• CPU (Central Processing Unit)
The Architecture of the CPU
Unit 1 Systems architecture

The main components


of a computer
MAIN MEMORY

INPUT CENTRAL PROCESSING OUTPUT


DEVICES UNIT (CPU) DEVICES

SECONDARY
STORAGE
The Architecture of the CPU
Unit 1 Systems architecture

What is this?
The Architecture of the CPU
Unit 1 Systems architecture

The CPU
The Architecture of the CPU
Unit 1 Systems architecture

Central Processing Unit (CPU)


• The Central Processing Unit or CPU is arguably the
most important component of a computer
• What does it do?
• What organ in the human body
is it often compared to?
• What are the similarities it has
to this organ?
The Architecture of the CPU
Unit 1 Systems architecture

The purpose of the CPU


• The CPU processes instructions
• When you run a program, it is the
CPU which runs the instructions
• It is often thought of as being
the ‘brains’ of the computer
• The way that a brain works is
very different to a CPU
• A CPU simply runs one
simple instruction at a time
• It carries out billions of
instructions per second
The Architecture of the CPU
Unit 1 Systems architecture

Stored program concept


• Before about 1943, early computers stored the data
to be worked on in memory
• The program was not stored
• Instructions were input one at a time using switches, or read
in punch cards and executed one at a time
• In 1943-44, mathematician von Neumann and his
colleagues had the idea of storing the program
instructions as well as the data in memory
• The stored-program computer was born!
The Architecture of the CPU
Unit 1 Systems architecture

Von Neumann architecture


• Program instructions and the data the programs
are using are both stored in the same memory
• The CPU accesses both instructions and data from the
same RAM
The Architecture of the CPU
Unit 1 Systems architecture

Components of the CPU


• The CPU has two major components called the
• Control Unit
• Arithmetic-Logic Unit (ALU)

• There are also registers


that are used to carry out
these operations
• A register is a very fast
memory location in the
CPU itself
• Cache is located on the CPU –
it is slower to access than
registers but faster than RAM
The Architecture of the CPU
Unit 1 Systems architecture

Registers in the CPU


• Program Counter (PC)
holds the address of the next instruction to be executed

• Memory Address Register (MAR)


holds the memory address of the current instruction, and then
the data that it uses, so that these can be fetched from memory

• Memory Data Register (MDR)


holds the actual instruction, and then the data that has been
fetched from memory

• Accumulator
holds the result of an instruction before it is transferred to
memory
The Architecture of the CPU
Unit 1 Systems architecture

Control Unit
• The control unit coordinates and controls
all of the activities taking place within
the CPU
• It decodes instructions and executes them
• It receives signals from the system clock
• It directs the timing and control of other
parts of the CPU, much like the conductor
of an orchestra
The Architecture of the CPU
Unit 1 Systems architecture

The Arithmetic Logic Unit


• The ALU or Arithmetic Logic Unit is where the actual
arithmetic operations are done
• It also carries out logical operations such as those including
AND, OR and NOT

Main ALU
Memory ADD X, Accumulator
X = 3 Y 8
Y = 5
The Architecture of the CPU
Unit 1 Systems architecture

Worksheet 1
• Complete Task 1 on Worksheet 1
The Architecture of the CPU
Unit 1 Systems architecture

Fetch – Decode – Execute


• The CPU operates by repeating
three operations:
• FETCH – causes the next
instruction and any data
involved to be fetched from
main memory
• DECODE – decodes the
instruction
• EXECUTE – the instruction
is executed
• This process is then repeated…
The Architecture of the CPU
Unit 1 Systems architecture

Program Counter (PC)


1
• The Program Counter holds 2
the address of the next 3
instruction to be executed Program 4
Counter
• The Program Counter is 5 LDA 10
incremented (increased by 1)
as soon as that instruction has
5 6 ADD 11

7 STO 12
been fetched
8

9
1
50
0
1
17
1
1
2
The Architecture of the CPU
Unit 1 Systems architecture

Accumulator
• The accumulator (ACC) is
where arithmetic and logic
results are temporarily stored,
much like the M+ function on
a calculator
The Architecture of the CPU
Unit 1 Systems architecture

MAR and MDR


• In the FETCH stage of the F-E cycle
• the address of the instruction to be executed is copied from
the Program Counter (PC) to the Memory Address
Register (MAR)
• The instruction at that address is fetched from memory and
copied to the Memory Data Register (MDR)
• The Control Unit decodes the instruction and
decides if data needs to be fetched
• If so, the MAR is then used to hold the address of
the data to be used in the instruction
• The data is fetched and copied to the MDR
The Architecture of the CPU
Unit 1 Systems architecture

Working together
MAR (Memory Address Register)
MDR (Memory Data Register)
The two work together; The MAR knows where to look
for data in RAM, the MDR keeps hold of that data until
it’s ready to be used by the CPU

MAR MDR
(Memory (Memory
Address Data
Register) Register)
The Architecture of the CPU
Unit 1 Systems architecture

Processor architecture
• What does each acronym stand for?
• What does each part do?
The Architecture of the CPU
Unit 1 Systems architecture

Processor architecture
PC: MAR:
Program Counter – points Memory Address Register – stores the
to the next instruction address of the instruction to be executed

ACC: RAM:
Accumulator – Random
Temporarily stores Access
arithmetic results Memory

ALU: MDR:
Arithmetic Logic Unit – performs Memory data register – Stores the
calculations and logic expressions data to be sent from memory
The Architecture of the CPU
Unit 1 Systems architecture

Processor architecture
8 – Cycle PC: MAR:
Repeats Program Counter – points Memory Address Register – stores the
to the next instruction address of the instruction to be executed
5 – Decodes
Instructions 1
ACC: RAM:
Accumulator – Random
Temporarily stores Access
arithmetic results
7 2
Memory

3 – It goes to add of the


Main Memory and find
the data and instructions
6 4

ALU: MDR:
Arithmetic Logic Unit – performs Memory data register – Stores the
calculations and logic expressions data to be sent from memory
The Architecture of the CPU
Unit 1 Systems architecture

Example – Step 1 (Add 8 + 4)


1 • PC points to next instruction in location 5
2 • Address 5 is passed to MAR and PC is
3 incremented. It now holds 6
4 Program • Instruction at Address 5 is copied from
Counter
5 LDA 10 memory to MDR
6 ADD #4 5 • Instruction is decoded by control unit
7 STO 11
• Address 10 passed from MAR
8

9 • The value in location 10, i.e. 8, is passed


1 from main memory to the MDR
8
0 Acc
• 8 is loaded into the accumulator (ACC)
1
1 8
1
2
The Architecture of the CPU
Unit 1 Systems architecture

Example – Step 2
1 • PC now points to next instruction in
location 6
2

3 • Address 6 is passed to the MAR and


4 the PC is incremented
5 LDA 10 Program • Instruction at Address 6 passed to MDR
Counter
6 ADD #4
• The instruction is decoded
7 STO 11 6
• No more data from memory is needed
8

9 • 4 is added to 8 in the ALU and the result


1 is stored in the accumulator
8
0 Acc
1
1 12
1
2
The Architecture of the CPU
Unit 1 Systems architecture

Example – Step 3
1 • PC points to the next instruction in
location 7
2

3 • Address 7 is passed to the MAR and the


4 PC is incremented
5 LDA 10 • Instruction at Address 7 passed to MDR
6 ADD #4 Program
Counter
• The instruction is decoded
7 STO 11

8 7 • The instruction is executed causing the


value 12 to be transferred from the
9
accumulator into memory location 11
1
8
0 Acc
1
1
12 12
1
2
The Architecture of the CPU
Unit 1 Systems architecture

Worksheet 1
• Complete Task 2 on Worksheet 1
The Architecture of the CPU
Unit 1 Systems architecture

Plenary
• In pairs, answer the following:
• What is the purpose of the CPU?
• What are two major components
of the CPU, and what is the
purpose of each?
• What is a register?
• Name four special
registers in the CPU
The Architecture of the CPU
Unit 1 Systems architecture

Plenary
• What is the purpose of the CPU?
• To fetch and execute instructions stored in memory
• What are two major components of the CPU, and
what is the purpose of each?
• The ALU, which carries out arithmetic and logic instructions
• The Control Unit, which coordinates the CPU activities
• What is a register?
• A special fast memory location in the CPU
• Name four special registers in the CPU
• PC, MAR, MDR, Accumulator
The Architecture of the CPU
Unit 1 Systems architecture

Copyright

© 2020 PG Online Limited

The contents of this unit are protected by copyright.

This unit and all the worksheets, PowerPoint presentations, teaching guides and other associated files
distributed with it are supplied to you by PG Online Limited under licence and may be used and copied by you
only in accordance with the terms of the licence. Except as expressly permitted by the licence, no part of the
materials distributed with this unit may be used, reproduced, stored in a retrieval system, or transmitted, in any
form or by any means, electronic or otherwise, without the prior written permission of PG Online Limited.

Licence agreement

This is a legal agreement between you, the end user, and PG Online Limited. This unit and all the worksheets,
PowerPoint presentations, teaching guides and other associated files distributed with it is licensed, not sold, to
you by PG Online Limited for use under the terms of the licence.

The materials distributed with this unit may be freely copied and used by members of a single institution on a
single site only. You are not permitted to share in any way any of the materials or part of the materials with any
third party, including users on another site or individuals who are members of a separate institution. You
acknowledge that the materials must remain with you, the licencing institution, and no part of the materials may
be transferred to another institution. You also agree not to procure, authorise, encourage, facilitate or enable any
third party to reproduce these materials in whole or in part without the prior permission of PG Online Limited.

You might also like