Advance Computer Architecture (Autosaved)
Advance Computer Architecture (Autosaved)
Architecture
Humaira Ashraf
Computer Architecture
memory
peripheral devices
What is a computer?
Memory
Input
Instr1
Instr2
Instr3
Data1
Data2
Output
I/O
Output unit sends
results of processing:
To a monitor display,
To a printer
Stores
information:
Instructions,
Data
Arithmetic
& Logic
Control
Processor
Control unit coordinates
various actions
Input,
Output
Processing
4
Transfer of information between the computer and I/O devices (e.g., from
keyboard to computer, or computer to printer)
Perform arithmetic and logic operations (e.g., Add two numbers, Perform
a logical AND).
Processor fetches instructions that make up a program from the memory and
performs the operations stated in those instructions.
Numbers,
Encoded characters.
Computers use data that is encoded as a string of binary digits called bits.
Input unit
Real world
Computer
Memory
Keyboard
Audio input
Input Unit
Processor
7
Memory unit
Access any word location in a short and fixed amount of time based
on the address.
Modern computers have three to four levels of RAM units with different
speeds and sizes:
Access to the data stored in secondary storage in slower, but take advantage of the
fact that some information may be accessed infrequently.
Cost of a memory unit depends on its access time, lesser access time implies higher cost.
10
organized as
bit
oprn
addr 1
oprn
addr 1
oprn
addr 1
addr 2
addr 2
addr 3
magnitude
sign-magnitude
inherently imprecise
exp
significand
Access times of general purpose registers are faster than the cache.
Results of the operations are stored back in the memory or retained in the
processor for immediate use.
13
Output unit
Computers represent information in a specific binary form. Output units:
- Interface with output devices.
- Accept processed results provided by the computer in specific binary form.
- Convert the information in binary form to a form understood by an
output device.
Computer
Memory
Output Unit
Real world
Printer
Graphics display
Speakers
Processor
14
Control unit
Operations of Input unit, Memory, ALU and Output unit are coordinated by
Control unit.
Input
Output
Memory
Processor
Bus
Functional units may be connected by a group of parallel wires.
The group of parallel wires is called a bus.
Each wire in a bus can transfer one bit of information.
The number of parallel wires in a bus is equal to the word length of
a computer
16
Cache
memory Processor
Bus
Why is the access time of the cache memory lesser than the
access time of the main memory?
17
Fetch
PC
MAR
Execute
address part of IR
execute opcode
MAR
Architecture Families
30 times faster
waste time loading operand again the next time its needed
Depending on mix of instructions and operand use, having many registers may
lead to less traffic to memory and faster execution
Register Organization
User-visible
Control
registers
General
Purpose
Data
Address
Condition
Codes
pointers
Index registers
Stack Pointer
Program
Counter
Instruction Decoding Register
Memory Address Register
Memory Buffer Register
Instruction Cycle
It
An
Instruction Cycle
Fetch
Instruction Cycle
Fetch
Interrupt
Indirect
Indirect
Execute
PC
MAR
Memory
Control
Unit
IR
MBR
MBR
MAR
Memory
Memory
Control
Unit
MBR
MBR
PC
PC
MAR
Memory
Control
Control
UnitUnit
MBR
Instruction Pipelining
Instruction
processing is subdivided:
- Purpose?
Instruction Processing
Fetch
instruction (FI)
Decode
instruction (DI)
Calculate
Fetch
operands (FO)
Execute
Write
operands (CO)
instruction (EI)
operand (WO)
Successive
Six-Stage CPU
Instruction
Pipeline
The logic needed
for pipelining to
account for
branches,
interrupts, and
arising problems.
RISC
Pipeline
1. Instruction
fetch
2. Instruction decode and register fetch
3. Execute
4. Memory Access
5. Register write back
VLIW
(very long instruction word,1024 bits!)
Superscalar
(sequential stream of instructions)
Instruction scheduling
Instructions often depend on each other in such a way that a particular instruction
cannot be executed until a preceding instruction or even two or three preceding
instructions have been executed.
1 Data dependencies
2 Control dependencies
3 Resource dependencies
Recurrences
RAW dependencies
flow dependencies
WAR dependencies
anti-dependencies
false dependencies
WAW dependencies
output dependencies
false dependencies
e.g.
Instruction Scheduling:
ILP-instruction scheduling
care must be taken to maintain the logical integrity of the program execution
e.g.
jz somewhere
Branches
Branch(orbranching,branched)
may
Branches
Two
Conditional
Branches
Unconditional
Unconditionalbranch instructionssuch
as GOTO are used to unconditionally
"jump" to (begin execution of) a different
instruction sequence. Machine
levelbranch instructionsare
sometimes called jump instructions.
Codes
Branch
BRZ
Branch
BRE
R1,R2,X
Branch
to location X if contents of R1 = R2
Since
Branch examples
Branch Statistics
evaluation
cycle
waiting
ready)
e.g.
each
Instruction Scheduling
Compiler Optimization
Motivation
Pipeline Implementation
Pipeline Implementation
Pipeline Implementation
Pipeline Hazards
Pipeline Hazards
Pipeline Hazards
Pipeline Hazards
Pipeline Hazards
Pipeline Hazards
Pipeline Hazards
Instruction Order
Instruction Order
Instruction Order
Instruction Dependencies
Instruction Dependencies
Instruction Dependencies
Instruction Dependencies
Instruction Dependencies
Instruction Scheduling
Preserving Dependencies
Preserving Dependencies
Preserving Dependencies
Preserving Dependencies
pipeline stall
During the decoding stage, the control unit will determine if the decoded
instruction reads from a register that the instruction currently in the
execution stage writes to. If this condition holds, the control unit will stall
the instruction by one clock cycle. It also stalls the instruction in the fetch
stage, to prevent the instruction in that stage from being overwritten by the
next instruction in the program.
Dynamic Scheduling