0% found this document useful (0 votes)
4 views29 pages

T1 CPU Architecture

Uploaded by

cosmicmarker92
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)
4 views29 pages

T1 CPU Architecture

Uploaded by

cosmicmarker92
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/ 29

Objectives

• Understand the role of the CPU and the


fetch-execute cycle
• Understand the following registers in the Von
Neumann architecture:
• MAR (Memory Address Register) • MDR (Memory Data
Register)
• CIR (Current Instruction Register) • Program Counter (PC)
• Accumulator (ACC)

• Understand common CPU components including:


• ALU (Arithmetic Logic Unit) • CU (Control Unit)
• Registers
CPU architecture
Computer architecture and storage

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?
CPU architecture
Computer architecture and storage

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)
CPU architecture
Computer architecture and storage

The main components


of a computer
MAIN MEMORY

INPUT CENTRAL PROCESSING OUTPUT


DEVICES UNIT (CPU) DEVICES

SECONDARY
STORAGE
CPU architecture
Computer architecture and storage

What is this?
CPU architecture
Computer architecture and storage

The CPU
CPU architecture
Computer architecture and storage

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?
CPU architecture
Computer architecture and storage

The purpose of the CPU


• The CPU processes instructions
• When you run a program, it is the
CPU which processes the
instructions and data that are input
• The results are then output

• 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, but billions
of instructions are carried out each second
CPU architecture
Computer architecture and storage

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!
CPU architecture
Computer architecture and storage

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
CPU architecture
Computer architecture and storage

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
CPU architecture
Computer architecture and storage

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
• Current Instruction Register (CIR)
holds the instruction currently being executed or decoded
• Accumulator (ACC)
holds the result of an instruction before it is transferred
to memory
CPU architecture
Computer architecture and storage

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
CPU architecture
Computer architecture and storage

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 Accumulator
X = 3 ADD X, Y 8
Y = 5
CPU architecture
Computer architecture and storage

Worksheet
• Complete Task 1 on Worksheet
CPU architecture
Computer architecture and storage

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…
CPU architecture
Computer architecture and storage

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

10 50
11 17
12
CPU architecture
Computer architecture and storage

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

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
CPU architecture
Computer architecture and storage

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)
CPU architecture
Computer architecture and storage

Current instruction register (CIR)


• The current instruction register holds the instruction
that is being executed or decoded at the moment
• It is also known as the instruction register (IR), but the name
current instruction register gives you a clue that it is the
instruction that is ‘currently’ being executed that it holds
• Once the instruction is loaded from memory it is stored in the
current instruction register (CIR)
• Once the instruction is in the CIR it is decoded
• If data is needed that is stored in memory it will be retrieved
CPU architecture
Computer architecture and storage

Processor architecture
• What does each acronym stand for?
• What does each part do?
CPU architecture
Computer architecture and storage

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 Access
Temporarily stores Memory
arithmetic results

ALU: CIR:
Arithmetic Logic Stores the current
Unit – performs instruction to be
calculations and decoded and
logic expressions executed
MDR:
Memory data register – Stores the
data to be sent/received from memory
CPU architecture
Computer architecture and storage

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 passes to the CIR where it is
7 STO 11
decoded by control unit
8
• Address 10 passed to the MAR
9

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


Acc from main memory to the MDR
11

12
8 • 8 is loaded into the accumulator (ACC)
CPU architecture
Computer architecture and storage

Example – Step 2
1 • PC now points to next instruction in
2
location 6
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 passed to the CIR and
7 STO 11 6 then decoded
8
• No more data from memory is needed
9

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


Acc is stored in the accumulator (ACC)
11

12
12
CPU architecture
Computer architecture and storage

Example – Step 3
1 • PC points to the next instruction in
2
location 7
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 passed to the CIR to
7 STO 11
be decoded
8 7
• The instruction is executed causing the
9
value 12 to be transferred from the
10 8 accumulator into memory location 11
Acc
11 12
12
12
CPU architecture
Computer architecture and storage

Worksheet
• Complete Task 2 on Worksheet
CPU architecture
Computer architecture and storage

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
CPU architecture
Computer architecture and storage

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, CIR, Accumulator (ACC)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy