CBA Processor
CBA Processor
Processor
Unit-III: Processor:
• Design of a Processor, Instruction fetch,
decode, execute,
• Overview of Pipelining (purpose, advantages,
disadvantages-Hazards).
• Introduction to ISA, x86 with Assembly level
examples..
• Building a data path for instruction
execution. Implementation of a simple single
cycle CPU for a given instruction.
Microprocessor
• Central component of a computer
• Is an IC that functions as a central processing unit
in a digital computer like a brain or a heart of a
human
FIRST GENERATION (1971-73) SECOND GENERATION (1974-78)
Processor Characteristics
• Machine Instruction
– Opcode (binary), Operands (src, dst), next instruction
– Operands : Main or virtual memory, registers, Immediate, I/O device
– Format : Refer to sample below
– Symbolic representation of opcodes & operands
– Instruction types: Data processing, storage, movement, control
– Number of addresses: 3-, 2-, 1- , 0- instructions
– Addressing modes:
– Types of operand : Addresses, Numbers,Characters, Logical data
PROCESSOR ORGANIZATION
ALU DESIGN
DATAPATH
PIPELINING
BUILDING
DATA
PATH
Introduction
https://www.youtube.com/watch?v=BO9epbclqxU
PIPELINING
Instruction Pipelining
• It is clear that there is some scope for optimizing
the instruction cycle thereby reducing the
execution time.
• Instruction pipelining is a way to optimize the
instruction cycle by bringing in the parallelism
wherever possible
Instruction Pipelining – cont’d
FI – Fetch Instruction
DI – Decode Instruction
CO – Calculate Operand
FO – Fetch Operand(s)
EI – Execute Instruction
WO – Write Operand
Assumptions:
Every instruction goes through all the stages
All stages are performed in parallel (No
memory conflicts)
The given pipeline diagram illustrates the effect of a conditional branch on instruction pipeline execution.
A branch instruction introduces a delay in instruction execution, commonly known as a branch penalty.
RESOURCE HAZARDS
1. main memory has a single port
2. Single ALU
Solutions:
1. Increase resources
2. Reservation Table
Resource Hazards
Data Hazard
A data hazard occurs when there is a conflict in the access of
an operand location
WAR
Control or Branch Hazard
• A control hazard, also known as a branch
hazard, occurs when the pipeline makes the
wrong decision on a branch prediction and
therefore brings instructions into the pipeline
that must subsequently be discarded
100: I1
101: I2
102: I3
.
.
250: BI1
Expected Output
I1 → I2 → BI1
Interrupt & Exception
• Interrupt processing within a processor is a
facility provided to support the OS.
• It allows an application program to be suspended,
in order that a variety of interrupt conditions can
be serviced and later resumed.
• Interrupts and Exceptions.
• An interrupt is generated by a signal from
hardware, and it may occur at random times
during the execution of a program.
• An exception is generated from software, and it is
provoked by the execution of an instruction.