
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















Fall 2006
Fall 2006
z
z
Fall 2006
z
z
i.e., that allow a given control signal be set to two differentvalues
z
z
ALU control; SRC1; SRC2; Register control; Memory;PCWrite control; Sequencing
Fall 2006
Address
Read Data(Instr. or Data)
Memory
PC
Read Addr 1Read Addr 2Write Addr Write Data
Register
File
Read Data 1
Read Data 2
ALU
Write Data
IR MDR
A B
ALUout
Sign Extend
Shiftleft 2
ALU Shiftleft 2 control
ALUOp
Control
FSM
IRWrite
MemtoReg
MemWrite
MemRead
IorD
PCWrite
PCWriteCond
RegDst
RegWrite
ALUSrcA
ALUSrcB
zero
PCSource
1
1 1
1
1
0 1
0
0
0 0
0
2
2
3
4
Instr[5-0]
Instr[25-0]
PC[31-28]
Instr[15-0]
Instr[31-26]
32
28
Fall 2006
Field
Value
Signal setting
Comments
Read
Read RegFile using rs and rt fields of IR asread addr’s; p
u
t data into A and B
Write ALU
RegWrite,RegDst = 1,MemtoReg = 0
Write RegFile using rd field of IR as write addrand ALUOut as write data
Write MDR
RegWrite,RegDst = 0,MemtoReg = 1
Write RegFile using rt field of IR as write addrand MDR as write data
Registercontrol
Add
ALUOp = 00
Cause ALU to add
Subt
ALUOp = 01
Cause ALU to subtract (compare op for beq)
Func code
ALUOp = 10
Use IR function code to determine ALU control
PC
ALUSrcA = 0
Use PC as top ALU input
A
ALUSrcA = 1
Use reg A as top ALU input
B
ALUSrcB = 00
Use reg B as bottom ALU input
4
ALUSrcB = 01
Use 4 as bottom ALU input
Extend
ALUSrcB = 10
Use sign extension output as bottom ALU input
Extshft
ALUSrcB = 11
Use shift-by-two output as bottom ALU input
ALUcontrol SRC1 SRC
Fall 2006
Field
Value
Signal setting
Comments
Seq
AddrCtl = 11
Choose next microinstruction sequentially
Fetch
AddrCtl = 00
Jump to the first microinstruction (i.e., Fetch)to begin a new instruction
Dispatch 1
AddrCtl = 01
Branch using PLA_
Sequen-cing
Dispatch 2
AddrCtl = 10
Branch using PLA_
Read PC
MemRead,
IorD
= 0,IRWrite
Read memory using PC as addr; write resultinto IR (and MDR)
Read ALU
MemRead,
lorD
= 1
Read memory using ALUOut as addr; writeresults into MDR
Write ALU
MemWrite,
IorD
= 1
Write memory using ALUOut as addr and Bas write data
ALU
PCSource = 00PCWrite
Write PC with output of ALU
ALUOut-cond
PCSource = 01,PCWriteCond
If Zero output of ALU is true, write PC withthe contents of ALUOut
PC writecontrol
Jumpaddress
PCSource = 10,PCWrite
Write PC with IR jump address after shift-by-two
Memory
Fall 2006
Label(Addr)
ALUcontrol
SRC
SRC
Regcontrol
Memory
PCWritecontrol
Seq’ing
Fetch (0)
Add
Read PC
Seq
compute PC + 4
fetch instr
into IR
write ALUoutput into
PC
go to
μ
instr 1
Fall 2006
Label(Addr)
ALUcontrol
Regcontrol
Memory
PCWrite control
Seq’ing
Fall 2006
Label(Addr)
ALUcontrol
Regcontrol
Memory
PCWrite control
Seq’ing
Fall 2006
Label(Addr)
ALUcontrol
SRC
SRC
Reg control
Memory
PCWritecontrol
Seq’ing
Memlw (3)
Read
ALU
Seq
Memwb (4)
Write MDR
Fetch
Memsw (5)
Write ALU
Fetch
Maddr (2)
Add
A
Extend
Disp
2
compute memory
address (RegFile(rs) +sign_ext(IR[15-0])) and
store it in ALUOut
on lw – first read memory at ALUOutand store output in
on sw – write Binto memory at
address in
ALUOut
MDR; then write MDR
into RegFile at rt
Fall 2006
Label(Addr)
ALUcontrol
SRC
SRC
Regcontrol
Memory
PCWritecontrol
Seq’ing
Rwb (7)
WriteALU
Fetch
Rexec (6)
Funccode
Seq
perform the ALU
operation specified inthe instr. function field using contents of A and
B and store the result
in ALUOut
when done, go
to fetch cycle
for next instruction
write ALUOut in the
RegFile at rd
Fall 2006
Label(Addr)
ALUcontrol
SRC
SRC
Regcontrol
Memory
PCWritecontrol
Seq’ing
Beq Jump
Fall 2006
ALUcontrol
SRC
SRC
Regcontrol
Memory
PCWritecontrol
Seq’ing
Add
Ext shft
Read
Disp 1
Jumpaddress
Fetch
Add
Extend
Disp 2
Read ALU
Seq
WriteMDR
Fetch
WriteALU
Fetch
unc code
Seq
WriteALU
Fetch
Subt
ALUOut-cond
Fetch
Add
Read PC
Seq
Fall 2006
Label(Addr)
ALUcontrol
SRC
SRC
Regcontrol
Memory
PCWritecontrol
Seq’ing
Fetch (0)
Add
Read PC
Seq
Label(Addr)
ALUcontrol
SRC
SRC
Regcontrol
Memory
PCWritecontrol
Seq’ing
ALUOp
ALUSrcA
ALUSrcB
RegWrite,RegDst,MemtoReg
MemRead,MemWrite,IRWrite, IorD
PCSource,PCWrite,PCWriteCond
AddrCtl