Documente Academic
Documente Profesional
Documente Cultură
0 x 1 x x 1 xy y
Bus
• Collection of signal lines -- uni(bi)directional
• Operation represented using timing diagrams
• Clocked vs Asynchronous separate data and address buses
System Bus Control Signals
• Multiple users?
– arbitration
– sender/reciever id
• Multiplexed?
– data ready
– clock
• Block Transfer
– busy
PCI Bus -- Read
CPU Architecture
VonNeumann Harvard
– code can be modified – data access does not
(accidentally) slow code access
– instruction and data
widths unrelated
Data CPU
Code
Data
CPU
Code Data Code
Data
CPU Internals
ALU: Registers:
manipulates Storage
data in response for data
to signals from
the control unit
2 0 1 1 1
0 1 3 1 1 3 0 0 2 3
Instruction vs. Micro-operation
Write
Add Instruction - Fetch
Address Pnemonic Value
1101 1100 load 1 00 0001 10 0101
0001 1101 add 5 10 0101
1110 jmp 1100 ……….
1101
2 1110 1
1
PC
CU
IR
3 3
00 0001
10 0101
Add Instruction - Indirect
(Decode)
1 ALU operation
Control
0 add signals
IR 0 bit 3
1 bit 2
0 bit 1 0101
1 bit 0
CU
Add Instruction - Execute
1
0110 0001
add
2 ALU 3
1 3
CU
1 1
0101
Status flags
RISC vs. CISC
• Single-cycle instruction • Multi-cycle instruction
execution execution
– Simple, fixed instruction – Variable size instruction format
format – Micro-programmed instruction
– few instructions and set
addressing modes • Smaller program size (# of
– Hardwired micro-operations instructions)
• Memory Access • Memory Access
– Load/Store design – Multiple addressing modes
– High-performance memory • Optimization Complexity
(registers/cache).
• Predictable Speed/Performance
Pipelining
• Assumptions:
– stages all have same duration
– no branching
– consecutive instructions are independent
Bit-test ··· == x?
Bit-compare ··· x == y ?
···
Shift Rotate
Machine Instructions
Control transfer/Special purpose
• Program flow • Special:
– skip [PC]=[PC]+1 – input/output
– branch [PC]=? – data conversion
– call push [PC]; [PC]=?
– system operation
– return pop [PC]
• Compound
• Processing pause – conditional branch
– nop 1 cycle delay IF BIT-TST BRANCH
– sleep wait for event – return with value
– wait ? cycle delay LOAD VALUE
RETURN
Machine Instruction Examples
Add • Arithmetic
Load • Data Transfer
Branch • Control Transfer
Op-code Operand
2 bits 4 bits
Addressing Modes
Displacement Variants
Relative
Base Register
Indexing
Post-Indexing
Pre-Indexing
How Many Operands?
0-operand
1-operand 2-operand
PUSH 5 3-operand
PUSH 6 LOAD 5 LOAD R1,5 LOAD R2, 5
ADD ADD 6 ADD R1, 6 ADD R1, R1, R2
Operating System
0000 Branch 0100
0100 Load 5
0101 Add 2
0110 …...
1110 End
Halt
Development Software
Tool Chain
IDE
Editor
Compiler
Linker Simulator
Download Live
Program
In-circuit
Debugger