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

SEN307 Lecture 6

The document provides an overview of Processing Unit Design, detailing the components of the CPU, including the Arithmetic Logic Unit (ALU), Control Unit (CU), and registers, and their interactions during instruction execution. It explains the execution cycle, types of control units (hardwired and microprogrammed), and various microoperations that facilitate data processing. Additionally, it discusses different bus organizations (one-bus, two-bus, three-bus) that affect data transfer efficiency within the CPU.

Uploaded by

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

SEN307 Lecture 6

The document provides an overview of Processing Unit Design, detailing the components of the CPU, including the Arithmetic Logic Unit (ALU), Control Unit (CU), and registers, and their interactions during instruction execution. It explains the execution cycle, types of control units (hardwired and microprogrammed), and various microoperations that facilitate data processing. Additionally, it discusses different bus organizations (one-bus, two-bus, three-bus) that affect data transfer efficiency within the CPU.

Uploaded by

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

Lecture 6

Processing Unit Design

Computer Architecture- NUN 2024 Austin Olom Ogar


Introduction to Processing Unit Design
• The primary function of the CPU is to execute a set of instructions
stored in the computer’s memory
• The Processing Unit is the heart of the Central Processing Unit (CPU)
within a computer system. It is responsible for executing instructions
provided by software applications and performing necessary
computations to process data.
• It interprets and carries out instructions by processing data, controlling
data flow, and ensuring that all computational tasks are managed
efficiently.
• A simple CPU consists of a set of registers, an arithmetic logic unit
(ALU), and a control unit (CU). In what follows, the reader will be
introduced to the organization and main operations of the CPU
The main components of the CPU and its interactions
• Arithmetic Logic Unit (ALU):
• The ALU performs all arithmetic and logical operations within the CPU, such as addition,
subtraction, AND, OR, and NOT operations.
• It is a critical component responsible for the actual processing of data.
• Control Unit (CU):
• The Control Unit directs the operations of the CPU. It fetches instructions from memory,
decodes them to understand what action is required, and then orchestrates the
execution of these instructions by coordinating the activities of the ALU, registers, and
other components.
• Registers:
• Registers are small, high-speed storage locations within the CPU that hold data,
instructions, and addresses temporarily during processing. They provide quick access to
frequently used data, thus speeding up operations.
• Buses:
• Buses are communication pathways that transfer data between different parts of the
computer, such as between the CPU, memory, and peripheral devices. They are essential for
ensuring smooth and efficient data flow within the system.
Simple execution cycle

simple execution cycle can be summarized as follows:


1. The next instruction to be executed, whose address is obtained from the PC, is fetched from the memory and stored in
the IR.
2. The instruction is decoded.
3. Operands are fetched from the memory and stored in CPU registers, if needed.
4. The instruction is executed.
5. Results are transferred from CPU registers to the memory, if needed.
Control Unit Design
Role of the Control Unit:
• Central Role in CPU Operation:
• The Control Unit (CU) is a critical component of the CPU that manages the execution
of instructions by controlling the sequence and timing of operations within the
processor.
• It acts as the orchestrator, ensuring that the various parts of the CPU, such as the
Arithmetic Logic Unit (ALU), registers, and memory, work together harmoniously to
execute instructions efficiently.
• Instruction Cycle Management:
• The CU controls each step of the instruction cycle (Fetch, Decode, Execute, and Write-
back), determining what action needs to be taken at each clock pulse.
• It generates control signals that guide the flow of data between the CPU components
and external peripherals.
• Types of Control Units:
• Hardwired Control Unit
• Microprogrammed Control Unit
Hardwired Control Unit
• Design:
• Uses fixed logic circuits to generate control signals.
• The control signals are generated through combinational logic circuits
based on the current instruction and the state of the processor.
• Advantages:
• Speed: Faster operation due to direct generation of control signals
without the need for additional decoding or processing.
• Efficiency: Optimal for executing simple, well-defined instruction sets.
• Disadvantages:
• Inflexibility: Difficult to modify or update, making it less adaptable to
changes or new instruction sets.
• Complexity: As the instruction set grows, the complexity of the control
logic increases significantly.
Microprogrammed Control Unit
• Design:
• Utilizes a set of microinstructions stored in a control memory to generate control
signals.
• Each instruction in the CPU’s instruction set is translated into a sequence of
microinstructions that are executed to carry out the desired operation.
• Advantages:
• Flexibility: Easier to modify and update, allowing for changes to the instruction set
without redesigning the control unit.
• Scalability: Suitable for complex instruction sets as it simplifies the control logic
design.
• Disadvantages:
• Speed: Generally slower than hardwired control due to the additional step of
fetching and decoding microinstructions.
• Memory Usage: Requires additional memory to store microinstructions, which can
increase the hardware cost.
ARITHEMETIC AND LOGIC UNIT:
Core Functionality:
• The Arithmetic Logic Unit (ALU) is a fundamental component of the CPU that
performs all arithmetic and logical operations.
• It is where the actual processing of data happens, making it a critical element in
executing instructions within a computer.
• Arithmetic Operations::
• These include basic mathematical operations such as addition, subtraction,
multiplication, and division.
• Logical Operations:
• Involves bitwise operations like AND, OR, XOR, and NOT which are essential for
decision-making processes in the CPU
Example Operations in ALU
Addition Operation:
• Using a Ripple-Carry Adder: A ripple-carry adder is a basic adder circuit that processes each bit
of the operands sequentially. The carry from each bit addition "ripples" to the next bit.
• Operation:
• Input: Two binary numbers (e.g., A and B).
• Process: Each bit of A is added to the corresponding bit of B, with a carry from the
previous bit.
• Output: The sum of A and B, along with a carry-out signal.
• Multiplication Operation:
• Using a Multiplier Circuit: A multiplier circuit performs binary multiplication, which is
essentially repeated addition of shifted versions of the operands.
• Operation:
• Input: Two binary numbers to be multiplied.
• Process: The circuit shifts and adds the partial products generated from the
multiplication of individual bits.
• Output: The product of the two input numbers.
Microoperations
Microoperations are the most basic, low-level operations
that occur within a processor. These operations are the
fundamental building blocks that the CPU uses to execute
higher-level machine instructions.

Each microoperation typically involves a small, discrete


action, such as transferring data from one register to
another, performing a calculation, or managing control
signals.
Types of Microoperations:
Microoperations are classified into several
categories, each serving a specific role in
processing data and controlling the CPU's
activities.
A. Data Transfer Microoperations
B. Arithmetic Microoperations:
C. Logical Microoperations
D. Control Microoperations:
Data Transfer Microoperations:
Function:
These microoperations involve the movement of data within
the processor, specifically between registers or between
memory and registers.

Examples:
• Moving data from one register to another (e.g., R1 ← R2).
• Loading data from memory into a register (e.g., R1 ← M[address]).
• Storing data from a register into memory (e.g., M[address] ← R1).
Arithmetic Microoperations:
Function:
These operations perform basic arithmetic calculations within
the CPU.

Examples:
• Addition of values stored in registers (e.g., R1 ← R2 + R3).
• Subtraction (e.g., R1 ← R2 - R3).
• Incrementing or decrementing a value (e.g., R1 ← R1 + 1).
Logical Microoperations:
Function:
Logical microoperations perform bitwise operations on data
within the registers..

Examples:
• AND operation between two registers (e.g., R1 ← R2 AND R3).
• OR operation (e.g., R1 ← R2 OR R3).
• NOT operation to invert bits (e.g., R1 ← NOT R2).
Control Microoperations:
Function:
Control microoperations manage the sequence of operations
and the flow of data within the processor. They handle tasks
such as branching and handling interrupts.

Examples:
• Branching to a different instruction based on a condition (e.g., IF (condition) THEN PC ← address).
• Handling interrupts by saving the current state and jumping to an interrupt service routine.
DATAPATH
• The CPU can be divided into a data section and a control section.
• The data section, which is also called the datapath, contains the registers and the ALU. The
datapath is capable of performing certain operations on data items.
• The control section is basically the control unit, which issues control signals to the
datapath.
• Internal to the CPU, data move from one register to another and between ALU and
registers.
• Internal data movements are performed via local buses, which may carry data,
instructions, and addresses.
• Externally, data move from registers to memory and I/O devices, often by means of a
system bus.
• Internal data movement among registers and between the ALU and registers may be
carried out using different organizations including:
• one-bus,
• two-bus,
• three-bus organizations.
One-Bus Organization

• Using one bus, the CPU registers and the ALU use a single bus to move outgoing and incoming
data.
• Since a bus can handle only a single data movement within one clock cycle, two-operand
operations will need two cycles to fetch the operands for the ALU.
• Additional registers may also be needed to buffer data for the ALU.
• This bus organization is the simplest and least expensive, but it limits the amount of data
transfer that can be done in the same clock cycle, which will slow down the overall
performance
One-Bus Organization

• Using two buses is a faster solution than the one-bus organization. In this case, general-purpose registers are
connected to both buses.
• Data can be transferred from two different registers to the input point of the ALU at the same time.
• Therefore, a two operand operation can fetch both operands in the same clock cycle.
• An additional buffer register may be needed to hold the output of the ALU when the two buses are busy
carrying the two operands.
• In some cases, one of the buses may be dedicated for moving data into registers (in-bus), while the other is
dedicated for transferring data out of the registers (out-bus).
• In this case, the additional buffer register may be used, as one of theALU inputs, to hold one of the operands.
Two-Bus Organization

• Using two buses is a faster solution than the one-bus organization. In this case, general-purpose registers are
connected to both buses.
• Data can be transferred from two different registers to the input point of the ALU at the same time.
• Therefore, a two operand operation can fetch both operands in the same clock cycle.
• An additional buffer register may be needed to hold the output of the ALU when the two buses are busy
carrying the two operands.
• In some cases, one of the buses may be dedicated for moving data into registers (in-bus), while the other is
dedicated for transferring data out of the registers (out-bus).
• In this case, the additional buffer register may be used, as one of theALU inputs, to hold one of the operands.
Three-Bus Organization

• In a three-bus organization, two buses may be used as source buses while the third is used as destination.
• The source buses move data out of registers (out-bus), and the destination bus may move data into a
register (in-bus).
• Each of the two out-buses is connected to an ALU input point.
• The output of the ALU is connected directly to the in-bus.
• As can be expected, the more buses we have, the more data we can move within a single clock cycle.
• However, increasing the number of buses will also increase the complexity of the hardware.
Three-Bus Organization

• In a three-bus organization, two buses may be used as source buses while the third is used as destination.
• The source buses move data out of registers (out-bus), and the destination bus may move data into a
register (in-bus).
• Each of the two out-buses is connected to an ALU input point.
• The output of the ALU is connected directly to the in-bus.
• As can be expected, the more buses we have, the more data we can move within a single clock cycle.
• However, increasing the number of buses will also increase the complexity of the hardware.
Questions
Question 1: Describe the components of a Processing Unit and explain how they interact to execute an
instruction. Why is the Processing Unit considered the core of the CPU? Support your explanation with a block
diagram.

Question 2: Compare and contrast Hardwired Control Units with Microprogrammed Control Units. Which type
would you recommend for a high-performance computing system, and why?

Question 3: Define microoperations and describe their role in the execution of instructions within a CPU. Provide
examples of different types of microoperations and explain how they contribute to the overall functioning of a
processor.

You might also like