31
Fall 2006 Lillevik 333f06- l12 1 University of Portland School of Engineering EE 333 Computer Organization Lecture 12 Branch control Jump control Controller FSM

Computer Organization Lecture 12

  • Upload
    lore

  • View
    27

  • Download
    0

Embed Size (px)

DESCRIPTION

Computer Organization Lecture 12. Branch control Jump control Controller FSM. ck2. ck3. ck1. ck4. ck5. Datapath and controller. Controller Input. Datapath timing overview. Clocks vary from 3 – 5 Clocks 1 and 2 the same for all instructions R-type: 2 more Memory reference - PowerPoint PPT Presentation

Citation preview

Page 1: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 1University of Portland School of Engineering

EE 333

Computer OrganizationLecture 12

Branch controlJump control

Controller FSM

Page 2: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 2University of Portland School of Engineering

EE 333

Datapath and controller

Controller Input

ck1

ck2

ck3

ck4

ck5

Page 3: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 3University of Portland School of Engineering

EE 333

Datapath timing overview

• Clocks vary from 3 – 5

• Clocks 1 and 2 the same for all instructions• R-type: 2 more

• Memory reference– Store: 2 more– Load: 3 more

• Branch, Jump: 1 more

Page 4: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 4University of Portland School of Engineering

EE 333

R-type instruction timing

Inst

ruct

ion

Fet

ch

Dec

ode,

Reg

Rea

d

Fun

ctio

n

Reg

iste

r W

rite

Clock

Inst

ruct

ion

Fet

ch

Page 5: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 5University of Portland School of Engineering

EE 333

Complete R-type

001000

Page 6: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 6University of Portland School of Engineering

EE 333

Store instruction timing

Inst

ruct

ion

Fet

ch

Dec

ode,

Reg

Rea

d

Add

ress

Cal

cula

tion

Mem

ory

Wri

te

Clock

Inst

ruct

ion

Fet

ch

Page 7: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 7University of Portland School of Engineering

EE 333

Complete store word

000000

Page 8: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 8University of Portland School of Engineering

EE 333

Load instruction timing

Inst

ruct

ion

Fet

ch

Dec

ode,

Reg

Rea

d

Add

ress

Cal

cula

tion

Mem

ory

Rea

d

Reg

Wri

te

Clock

Inst

ruct

ion

Fet

ch

Page 9: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 9University of Portland School of Engineering

EE 333

Complete load word

000000

Page 10: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 10University of Portland School of Engineering

EE 333

Branch (beq) execution

• Operation– If (A = = B), PC = ALUout– ALUout = branch address from clock 2

• Functional units– ALU must sub, A-B– ALUout contains optimistic branch address– Zero flag controls write to PC

Clock 3

Page 11: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 11University of Portland School of Engineering

EE 333

Control for branch (beq)?

Page 12: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 12University of Portland School of Engineering

EE 333

Complete beq

000001

Page 13: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 13University of Portland School of Engineering

EE 333

Beq Instruction Timing

Inst

ruct

ion

Fet

ch

Dec

ode,

Reg

Rea

d

AL

U S

ubtr

act

Clock

Inst

ruct

ion

Fet

ch

Page 14: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 14University of Portland School of Engineering

EE 333

Jump execution

• Operation– PC = PC[31-28] || (IR[25-0]<<2)– PC always written

• Functional units– Instruction register– Upper 4 bits of PC

Clock 3

Page 15: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 15University of Portland School of Engineering

EE 333

Control for jump?

Page 16: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 16University of Portland School of Engineering

EE 333

Jump instruction timing

Inst

ruct

ion

Fet

ch

Dec

ode,

Reg

Rea

d

Wri

te P

C

Clock

Inst

ruct

ion

Fet

ch

Page 17: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 17University of Portland School of Engineering

EE 333

Complete jump

0000

Page 18: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 18University of Portland School of Engineering

EE 333

Controller and datapath

InputsIR(31:25)

Outputs

Outputs

Page 19: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 19University of Portland School of Engineering

EE 333

FSM architecture

Present

State

NS

Decoder

Output

Decoder

Inputs Outputs

Combo logic

ROM

MUX

Combo logic

ROM

MUX

Decoder

Flip Flops

Page 20: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 20University of Portland School of Engineering

EE 333

Ten one-bit outputs

Page 21: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 21University of Portland School of Engineering

EE 333

Three two-bit outputs

Page 22: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 22University of Portland School of Engineering

EE 333

State diagram overview

All instructions require IF, ID (2 clk’s)

2 Clk

1-3 Clk

Page 23: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 23University of Portland School of Engineering

EE 333

State diagram notation

Previous States Next States

Current State

Signal1

Signal3 = 00

Signals not listed are “don’t cares”

Signal2 = 0

condition

condition

condition

condition

Page 24: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 24University of Portland School of Engineering

EE 333

Full FSM state diagram

Inputs:Op

Outputs: 13 signals

States: 10

Page 25: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 25University of Portland School of Engineering

EE 333

Add state diagram

Inputs:Op

Outputs: 13 signals

States: 10

S0 S1 S6 S7 S0

Page 26: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 26University of Portland School of Engineering

EE 333

Add instruction timing

Inst

ruct

ion

Fet

ch

Dec

ode,

Reg

Rea

d

Add

Ope

rand

s

Reg

iste

r W

rite

Clock

Inst

ruct

ion

Fet

ch

S0 S1 S6 S7

Page 27: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 27University of Portland School of Engineering

EE 333

Find the state transitions?

Inst Clk 1 Clk 2 Clk 3 Clk 4 Clk 5

add $1, $2, $3 0 1

sw $4, 64($5) 0 1

beq $1, $4, label 0 1

sub $1, $5, $2 0 1

lw $8, 256($12) 0 1

beq $7, $2, label 0 1

j jumpAdr 0 1

or $7, $4, $5 0 1

Page 28: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 28University of Portland School of Engineering

EE 333

Page 29: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 29University of Portland School of Engineering

EE 333

Control for branch (beq)? Clock 3

Optimistic branch address

01

Page 30: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 30University of Portland School of Engineering

EE 333

Control for jump? Clock 3

Page 31: Computer Organization Lecture 12

Fall 2006

Lillevik 333f06-l12 31University of Portland School of Engineering

EE 333

Find the state transitions?

Inst Clk 1 Clk 2 Clk 3 Clk 4 Clk 5

add $1, $2, $3 S0 S1 S6 S7

sw $4, 64($5) S0 S1 S2 S5

beq $1, $4, label S0 S1 S8

sub $1, $5, $2 S0 S1 S6 S7

lw $8, 256($12) S0 S1 S2 S3 S4

beq $7, $2, label S0 S1 S8

j jumpAdr S0 S1 S9

or $7, $4, $5 S0 S1 S6 S7