Basic Processing Unit and Pipelining Final
Basic Processing Unit and Pipelining Final
● ALU (Arithmetic Logic Unit): Performs arithmetic and logical operations, such as
addition, subtraction, AND, OR, etc.
● Control Unit (CU): Directs the operation of the processor by interpreting and
executing instructions. It coordinates the flow of data within the CPU.
● Registers: Small, fast storage locations used to hold data temporarily during
computation. Common registers include the Program Counter (PC), Accumulator
(AC), Instruction Register (IR), and Status Register (SR).
2. Clock:
The clock provides a timing signal that synchronizes the operations of the CPU and other
components. It determines the speed at which instructions are processed.
3. Instruction Cycle:
● Based on the decoded instruction, the control unit generates appropriate control signals to instruct
various parts of the CPU.
Once the control signals are generated, they are sent to various parts of the CPU to execute the instruction:
● ALU Operations: The control signal tells the ALU what operation to perform.
● Data Movement: Control signals direct the movement of data between registers, memory, and other
components. For example, they may specify whether data should be written to a register or read from
memory.
● State Transition: Some control signals may trigger a state change in the control unit, for example,
advancing the program counter to the next instruction or handling branching in conditional
instructions.
5. Example:
Consider an example where an instruction like ADD R1, R2, R3 (Add contents of R2 and R3 and store the
result in R1) is executed:
● Instruction Fetch: The CU generates signals to fetch the ADD instruction from memory.
● Instruction Decode: The CU decodes the ADD opcode and generates signals to specify:
○ Read values from registers R2 and R3.
○ Perform addition using the ALU.
○ Write the result back to register R1.
HARDWIRED CONTROL
● Hardwired control is a type of control unit that generates control signals through fixed logic
gates and circuits
● These Logic circuits are designed to perform specific tasks based on the instruction set of the
CPU
● Design of the control unit is predefined and dont change durin operation and hence faster
execution
ADVANTAGES
DISADVANTAGES
Implementation Fixed set of logic gates and circuits Microcode stored in memory
Instruction Set Supports limited instruction sets Supports complex instruction sets
Complexity of Design Simple design, easy to implement Complex design, more difficult to
implement
Debugging and Difficult to debug and test Easier to debug and test
Testing
Size and Cost Smaller size, lower cost Larger size, higher cost
Maintenance and Difficult to upgrade and maintain Easier to upgrade and maintain
Upgradability
KEY POINTS
ADVANTAGES
1) RISC uses Simple smaller set of instructions making them easier to decode
2) Faster execution of RISC due to the small size of instruction
3) RISC uses lower power than CISC
DISADVANTAGES
KEY POINTS
ADVANTAGES
1. Reduced code size as CISC uses complex instructions that can perform multiple operations reducing
the amt of code needed to perform the task
2. Its more memory efficient as they require fewer instructions to perform more complex tasks
DISADVANTAGES
1. Slower execution due to complex instructions and time required to decode them
2. Difficult to design and implement due to complex instruction sets
3. Higher power consumption
Feature RISC CISC
Execution Time Typically one clock cycle May take multiple clock cycles
Addressing modes Simple and uses limited addressing Complex and uses more addressing
modes modes
Complexity of Simple, one operation per instruction Complex, multiple operations per
Instructions instruction
● Read Signal: Indicates that data should be fetched from a specific memory location or I/O device.
● Write Signal: Tells the system that data should be written to memory or an I/O device.
2. Clock Signal:
● The clock provides a timing pulse that synchronizes the operation of the CPU and other components.
The clock signal determines the pace at which instructions are fetched, decoded, and executed.
3. Memory Read/Write:
● Memory Read: This signal tells the memory unit to read data from a specific location in memory. It’s
typically activated when the CPU needs to retrieve data.
● Memory Write: Activates when the CPU needs to write data to a memory location.
4. Enable Signals:
● Register Enable: Allows a particular register to accept data from the data bus. The Control Unit
activates this signal when data needs to be stored in a register.
● Bus Enable: Controls whether the data bus is enabled to transfer data between components (e.g.,
from memory to the ALU).
● ALU Operation (ALU Op): Specifies the operation the Arithmetic Logic Unit (ALU) should perform,
such as addition, subtraction, AND, OR, etc.
● ALU Select (ALU Sel): In some architectures, this signal selects the input for the ALU (for example, it
may choose between two different registers or data sources).
● Interrupt Request (IRQ): Signals that a device or external source is requesting attention from the
CPU. The Control Unit may temporarily halt its current task to process the interrupt.
● Interrupt Acknowledge (IAK): Acknowledges the receipt of an interrupt signal and typically triggers
the start of interrupt handling.
● Clock Pulse (Clock or CLK): This signal synchronizes the execution of instructions by providing a
consistent timing reference. It ensures that the processor operates in a predictable manner.
● Timing Signals: These are used to define the exact timing of operations, such as the start and end of
a read or write operation, based on the clock cycle.
● Multiplexer Control: Many CPU systems use multiplexers (MUX) to select data paths. Control signals
direct which input is selected for the MUX, enabling the flow of data between registers, memory, or
the ALU.
● Shift Register Control: In processors that use shift operations, these control signals manage whether
data is shifted left or right within the register.
9. Condition Flags:
● Some CPUs use status flags (often part of the Status Register (SR)) to set or clear based on the
outcome of arithmetic or logical operations. These flags are used to control branching decisions, such
as:
○ Zero Flag (ZF): Set if the result of an operation is zero.
○ Carry Flag (CF): Set if there is a carry-out from the most significant bit.
○ Sign Flag (SF): Indicates if the result of an operation is negative
● Branch or Jump Signals: Control whether the program counter (PC) should change to a new address
(branching/jumping). These signals are often based on conditions (like the outcome of a comparison)
and affect program flow (e.g., conditional jumps).
● Input/Output Read: Used when the CPU wants to read data from an I/O device.
● Input/Output Write: Used when the CPU wants to write data to an I/O device.
● I/O Enable: Enables or disables communication with an I/O device.
● PC Enable: Allows the Program Counter (PC) to be updated with the next instruction’s address, either
sequentially or based on a jump or branch operation.
● PC Load: Controls when the Program Counter is loaded with a new address, for example, during a
jump or an interrupt.