Docsity

Multiple Clock Cycle CPU Control - Slides | CSE 141, Study notes of Computer Architecture and Organization

Partial preview of the text

Download Multiple Clock Cycle CPU Control - Slides | CSE 141 and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Chien CSE141 1 October 29, 2002

Multiple Clock Cycle CPU

Control

„ Last Time

  • Datapath for Multiple Cycle CPU

„ Today

  • Quiz #
  • Multiple Cycle CPU Control

„ Reminders/Announcements

  • [email protected] mail is now archived on the course web site
  • HW #3 is due 10/31/2002, in lecture
  • Lab #2 is due 10/30/2002 (to tutors in lab hours)
  • Midterm on 11/5/2002, in class
    • Review lecture 10/31/
    • Sunday Review session (TA’s)

Complete Multicycle Datapath

Chien CSE141 3 October 29, 2002

Multicycle Control

„ Single-cycle control used combinational logic

„ Multi-cycle control uses ??

„ FSM defines a succession of states, transitions

between states (based on inputs), and outputs

(based on state)

„ First two states same for every instruction, next state

depends on opcode

Chien CSE141 4 October 29, 2002

Multicycle Control FSM

Instruction fetch

Decode and Register Fetch

Memory

instructions

R-type

instructions

Branch

instructions

Jump

instruction

start

Chien CSE141 7 October 29, 2002

BEQ Instruction

ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01

from state 1

To state 0

3. Memory Address Computation

ALUout = A + sign-extend(IR[15-0])

  1. Memory Access

memory-data = Memory[ALUout], or

Memory[ALUout] = B

  1. Write-back

Reg[IR[20-16]] = memory-data

Chien CSE141 13 October 29, 2002

JMP Instruction

PCWrite PCSource = 10

from state 1

To state 0

Chien CSE141 14 October 29, 2002

The Whole FSM

Chien CSE141 15 October 29, 2002

Simple Questions

„ How many cycles will it take to execute this code?

lw $t2, 0($t3)

lw $t3, 4($t3)

beq $t2, $t3, Label #assume not taken

add $t5, $t2, $t

sw $t5, 8($t3)

Label: ...

What is going on during the 8th cycle of execution?

„ In what cycle does the actual addition of $t2 and $t3 takes

place?

„ Assume 20% loads, 10% stores, 50% R-type, 20% branches,

what is the CPI?

Chien CSE141 16 October 29, 2002

„ Implementation:

Finite State Machine for Control

Chien CSE141 19 October 29, 2002

Multicycle CPU Control

Summary

„ Performance gain from allowing some instructions to

complete faster

„ Datapath requires a few new state elements

„ More, and more complex, control signals

„ Multistage control -- uses an FSM

  • See the need for a simple instruction set!

„ Next time: Midterm Review