Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture 07
CPU Basics
• The computer’s CPU fetches, decodes, and executes program
instructions.
• The two principal parts of the CPU are the datapath and the control unit.
– The datapath consists of an arithmetic-logic unit and storage units (registers)
that are interconnected by a data bus that is also connected to main memory.
– Various CPU components perform sequenced operations according to signals
provided by its control unit.
• Registers hold data that can be readily accessed by the CPU.
• They can be implemented using D flip-flops.
– A 32-bit register requires 32 D flip-flops.
• The arithmetic-logic unit (ALU) carries out logical and arithmetic
operations as directed by the control unit.
• The control unit determines which actions to carry out according to
the values in a program counter register and a status register.
Instruction Cycle
• Two steps: Fetch, Execute • Execute Cycle:
• Fetch Cycle • Processor-memory
– Program Counter (PC) holds – data transfer between CPU and
address of next instruction to fetch main memory
– Processor fetches instruction from • Processor I/O
memory location pointed to by PC – Data transfer between CPU and
– Increment PC I/O module
• Unless told otherwise • Data processing
– Instruction loaded into Instruction – Some arithmetic or logical
Register (IR) operation on data
– Processor interprets instruction
and performs required actions
• Control
– Alteration of sequence of
operations
– e.g. jump
CPU Basics
• The computer’s CPU fetches, decodes, and executes program
instructions.
• Two parts of the CPU are the datapath and the control unit.
– The datapath, consists of an arithmetic-logic unit and storage units (registers)
that are interconnected by a data bus that is also connected to main memory.
– Various CPU components perform sequenced operations according to signals
provided by its control unit.
• Registers hold data that can be readily accessed by the CPU.
– They can be implemented using D flip-flops.
• A 32-bit register requires 32 D flip-flops.
• The arithmetic-logic unit (ALU)
– carries out logical and arithmetic operations as directed by the control
unit.
• The control unit determines
– which actions to carry out according to the values in a program
counter register and a status register
Buses
• The CPU communicates with other components via a
bus.
– A bus is a set of wires that acts as a shared but common
data path to connect multiple subsystems within the system.
– It consists of multiple lines, allowing the parallel movement
of bits.
• At any one time, only one device (be it a register, the ALU, memory,
or some other component) may use the bus.
• However, this sharing often results in a communications bottleneck.
• The speed of the bus is affected by its length as well as by the
number of devices sharing it.
– Quite often, devices are divided into master and slave
categories, where a master device is one that initiates
actions and a slave is one that responds to requests by a
master.
The Bus
This is a point-to-point
bus configuration:
The Bus
The Bus