Processor Organization (Part 2)
Processor Organization (Part 2)
ORGANIZATION
Instruction Interpretation and Sequencing
1. Straight line sequencing
2. Branch Instruction
Processor
Organization
Register Transfers
Register Transfers
Register
Transfers
Micro Operations
Micro-operation includes
2. Fetching a Word from Memory
2. Fetching a Word from Memory
2. Fetching a Word from Memory
3. Storing A Word In Memory
3. Storing A Word In Memory
Execution of a Complete Instruction
Execution of a Complete Instruction
Execution of Branch Instructions
Execution of Branch Instructions
Execution of Branch Instructions
EXAMPLE
SEATWORK
1. Write the control sequence and micro-
program for the instruction SUB R3, R4,
including the instruction fetch phase.
(Assume single bus architecture.)
With pipelining
s1 s2 s3 5 mins
I F S 3 cycle
I F S 1.67 mins
I F S overall
Design of a basic Pipeline
• In a pipelined processor, a pipeline has two ends, the input end
and the output end. Between these ends, there are multiple
stages/segments such that the output of one stage is
connected to the input of the next stage and each stage
performs a specific operation.
• Interface registers are used to hold the intermediate output
between two stages. These interface registers are also called
latch or buffer.
• All the stages in the pipeline along with the interface registers
are controlled by a common clock.
Design of a basic Pipeline
• Execution sequence of
instructions in a pipelined
processor can be visualized
using a space-time diagram.
For example, consider a
processor having 4 stages and
let there be 2 instructions to be
executed. We can visualize the
execution sequence through
the following space-time
diagrams:
Design of a basic Pipeline
• Total time = 5 Cycle
Pipeline Stages
RISC processor has 5 stage instruction pipeline to execute
all the instructions in the RISC instruction set. Following are
the 5 stages of the RISC pipeline with their respective
operations:
• Stage 1 – IF (Instruction Fetch)
• Stage 2 – ID (Instruction Decode)
• Stage 3 – EX (Instruction Execute)
• Stage 4 – MEM (Memory Access)
• Stage 5 – WB (Write Back)
Pipeline Stages
• Stage 1 – IF (Instruction Fetch): In this stage the
CPU fetches the instructions from the address
present in the memory location whose value is
stored in the program counter.
• Stage 2 – ID (Instruction Decode): In this stage,
the instruction is decoded and register file is
accessed to obtain the values of registers used in
the instruction.
Pipeline Stages
• Stage 3 – EX (Instruction Execute): In this stage
some of activities are done such as ALU operations.
• Stage 4 – MEM (Memory Access): In this stage,
memory operands are read and written from/to the
memory that is present in the instruction.
• Stage 5 – WB (Write Back): In this stage,
computed/fetched value is written back to the
register present in the instructions.
Pipeline Stages
• Stage 3 – EX (Instruction Execute): In this stage
some of activities are done such as ALU operations.
• Stage 4 – MEM (Memory Access): In this stage,
memory operands are read and written from/to the
memory that is present in the instruction.
• Stage 5 – WB (Write Back): In this stage,
computed/fetched value is written back to the
register present in the instructions.
Pipeline Stages
Execution time of a pipelined process
Time 1 1 1 1 1
1 IF ID EX MEM WB
2 IF ID EX MEM WB
ETpipeline = 10 mins
Exercise: Laundry Processing in Pipelining vs.
Non-Pipelining
Exercise: Laundry Processing in Pipelining vs.
Non-Pipelining