You are on page 1of 45

Hazard detection unit

EX/MEM RegWrite ID/EX WB Control 0 0 M u x 1 M EX ID/EX RegDst ID/FX RegWrite EX/MEM WB

MEM/WB RegWrite

IF/IDWrite

MEM/WB M WB

IF/ID PCWrite

Instruction

PC

Instruction memory

Registers

ALU

Data memory

1 M u x 0

0 M u x 1 ID/EX. WriteRegisterRt. ID/EX. WriteRegisterRd. EX/MEM WriteRegister MEM/WB. WriteRegister

0 M u x 1 Control

WB

EX / MEM

WB

MEM / WB WB

EX IF/ID

Add Add Shift left 2 ALU result Branch MemWrite

PC

address Instruction memoty

Instruction

Read register 2 Write register write data Registers Read data 2 0 M u x 1

Zero ALU ALU result

Read address Data memory Read data

Write address Write data

Instruction (15-0)

16 Sign extend

32

6 ALU control MemRead

Instruction (20-16)

Instruction (15-11)

0 M u x 1 RegDst

ALUOp

MemWrite 1 M u x 0

Read

Read register 1

Read data 1

You might also like