Hardware Flow Chart: Virendra Singh
Hardware Flow Chart: Virendra Singh
Architecture
II
Hardware
Flow
Chart
Virendra Singh
Associate Professor
Computer Architecture and Dependable Systems Lab
Department of Electrical Engineering
Indian Institute of Technology Bombay
http://www.ee.iitb.ac.in/~viren/
E-mail: [email protected]
EE-309: Microprocessors
Lecture
21
(02
Sep
2014)
CADSL
Micro-coded Implementation
Bus Controller
Clock-Phase Generator
Instruction
Sequencer
Control
Store
Instruction
Decoder
Instruction
Prefetch
Register
Address
Out Reg.
Internal A Bus
PC
R0
Datapath
02 Sep 2014
R1
Rn
Shifter
ALU
Internal B Bus
EE-309@IITB
Data
Reg.
CADSL
Instruction Execution
ADD R1, D2(B2)
5A
0
R1
8
B2
12
D2
16
31
EE-309@IITB
CADSL
Execution Steps
Steps
for
ADD
instrucBon
ExecuBon
1. Fetch
the
rst
half
word
2. Find
ADD
control
word
sequence
3. Fetch
the
remaining
instrucBon
word
4. Calculate
the
operand
address
5. Fetch
the
operand
6. Add
7. Store
the
result
02 Sep 2014
EE-309@IITB
CADSL
Execution Steps
1. Fetch
the
remaining
instrucBon
word
2. Calculate
the
operand
address
3. Fetch
the
operand
4. Add
5. Store
the
result
6. Update
the
program
counter
7. Fetch
the
rst
half
word
for
the
next
instrucBon
8. Find
the
address
of
the
next
instrucBons
control
word
sequence
9. Branch
to
the
next
instrucBons
control
word
02 Sep 2014
EE-309@IITB
CADSL
Execution Steps
1. Fetch
the
remaining
instrucBon
word
One
state
to
second
half
of
the
ADD
instrucBon
4. Add
One
state
to
add
the
operands
EE-309@IITB
CADSL
Execution Steps
6. Update
the
program
counter
One
state
to
increament
PC
One
state
to
save
the
incremented
value
EE-309@IITB
CADSL
Next State
Control
Control
Store
Interrupt Logic
Bus Controller
IR
Decoder
Branch Control
unit
Instruction
Prefetch
Register
Address
Out Reg.
PC
Datapath
02 Sep 2014
R0
R1
Internal A Bus
Rn
Shifter
ALU
Internal B Bus
EE-309@IITB
Data
Reg.
CADSL
Hardware Flowchart
02 Sep 2014
EE-309@IITB
CADSL
Hardware Flowchart
Hardware
Flowchart
Tells
us
how
to
get
from
the
architecture
to
the
implementaBon
Links
programmers
(external)
model
and
the
hardware
(internal)
implementaBon
Specify
exactly
how
commands
from
the
instrucBon
set
are
carried
out
using
Datapath
02 Sep 2014
EE-309@IITB
10
CADSL
Flowchart Objective
EE-309@IITB
11
CADSL
Programmers
Register Set
First Word
Op-code
Operation
Code
Rx
First
Operand
Register
Mode
Second
Operand
Address
Mode
R0
R1
R2
Ry
First
Operand
Register
.
.
.
Second Word
Rn
Displacement
Optional, depending on second operand address mode
02 Sep 2014
EE-309@IITB
12
CADSL
ADD
AND
BZ
Branch
if
zero
bit
is
set.
(Register
Indirect
only)
LOAD
Second
operand
is
source
and
Rx
is
desBnaBon
POP
PosBncrement
with
register
indirect
only
PUSH
Predecrement
with
register
indirect
only
STORE
SUB
TEST
02 Sep 2014
EE-309@IITB
13
CADSL
Ry
Second Operand
Address Mode
First Operand
Register
Address
Modes
AB
-
Base
(Ry)
plus
displacement
(second
instrucBon
word)
is
an
operand
address
AI
Register
indirect.
Ry
holds
an
operand
address
AR
Register
direct:
The
result
is
stored
in
Ry.
For
two
operand
instrucBons,
Ry
also
is
an
operand
source
02 Sep 2014
EE-309@IITB
14
CADSL
MIN Datapath
IRE
IRF
Internal A Bus
AO
PC
T2
R0
R1
DO
Rn
T1
ALU
DI
Internal B Bus
External Data
External Address
Bus (EDB)
Bus (EAB)
02 Sep 2014
EE-309@IITB
15
CADSL
MIN Datapath
Rules
of
OperaBon
1. A
transfer
from
source
to
bus
to
desBnaBon
takes
one
state
Bme
2. A
source
can
drive
up
to
three
desBnaBon
loads
3. Inputs
to
the
ALU
are
from
A
(internal)
bus
and
either
k
(values
0,
+1,
-1)
or
the
B
(internal)
bus
4. When
ALU
is
desBnaBon.
T1
is
automaBcally
loaded
from
the
ALU
output
5. A
transfer
to
AO
acBvates
the
on-chip
external
bus
controller.
This
bus
controller
postpones
the
next
state
unBl
the
external
transfer
is
complete.
02 Sep 2014
EE-309@IITB
16
CADSL
Flowcharts
ADD RX AR RY
ADD RX AI (RY)
Register-to-Register
R R
ADD
Register-to-Memory
R M
ADD
rx a alu
ry b alu
edb di
ry b ao
di b alu
rx a alu
t1 b ry
IRE
AO PC T2
R0 R1
Internal A
Bus
Internal B
Bus
02 Sep 2014
ALU
Sequence
ry b ao
t1 a do
IRF
DO
Rn T1
State
k
DI
EE-309@IITB
17
CADSL
Thank You
02 Sep 2014
EE-309@IITB
18
CADSL