SEN307 Lecture 6
SEN307 Lecture 6
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.