Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
29 views34 pages

JMC T1 CPU Architecture

The document provides an overview of CPU architecture, detailing its components such as the Control Unit, Arithmetic Logic Unit (ALU), and various registers including the Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR), Current Instruction Register (CIR), and Accumulator (ACC). It explains the fetch-execute cycle, where the CPU fetches instructions from memory, decodes them, and executes them. Additionally, it emphasizes the role of the CPU as the primary processing unit in computer systems.

Uploaded by

insunghong.97
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)
29 views34 pages

JMC T1 CPU Architecture

The document provides an overview of CPU architecture, detailing its components such as the Control Unit, Arithmetic Logic Unit (ALU), and various registers including the Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR), Current Instruction Register (CIR), and Accumulator (ACC). It explains the fetch-execute cycle, where the CPU fetches instructions from memory, decodes them, and executes them. Additionally, it emphasizes the role of the CPU as the primary processing unit in computer systems.

Uploaded by

insunghong.97
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/ 34

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

The main components


of a computer
MAIN MEMORY

INPUT CENTRAL PROCESSING OUTPUT


DEVICES UNIT (CPU) DEVICES

SECONDARY
STORAGE
CPU architecture
Unit 3 Computer architecture and storage

What is this?
CPU architecture
Unit 3 Computer architecture and storage

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

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

Starter - recap
• Name at least five components inside a CPU
• What is the purpose of each component?
CPU architecture
Unit 3 Computer architecture and storage

Processor architecture
• What does each acronym stand for?
• What does each part do?
CPU architecture
Unit 3 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
Unit 3 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
Unit 3 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

9
1
50
0
1
17
1
1
2
CPU architecture
Unit 3 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
Unit 3 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
Unit 3 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
Unit 3 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
Unit 3 Computer architecture and storage

Processor architecture
• What does each acronym stand for?
• What does each part do?
CPU architecture
Unit 3 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
Unit 3 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
1 • The value in location 10, i.e. 8, is passed
8
0 Acc from main memory to the MDR
1
1 8 • 8 is loaded into the accumulator (ACC)
1
2
CPU architecture
Unit 3 Computer architecture and storage

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 passed to the CIR and
7 STO 11 6 then decoded
8
• No more data from memory is needed
9
1 • 4 is added to 8 in the ALU and the result
8
0 Acc is stored in the accumulator (ACC)
1
1 12
1
2
CPU architecture
Unit 3 Computer architecture and storage

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 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
1
0
8
Acc
accumulator into memory location 11
1
1
12 12
1
2
CPU architecture
Unit 3 Computer architecture and storage

Worksheet 1
• Complete Task 2 on Worksheet 1
CPU architecture
Unit 3 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
Unit 3 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)
CPU architecture
Unit 3 Computer architecture and storage

Copyright

© 2021 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