Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Multicycle Implementation Overview - Lecture Slides | CS 35101, Study notes of Computer Architecture and Organization

Material Type: Notes; Class: COMPUTER ARCHITECTURE; Subject: Computer Science; University: Kent State University; Term: Spring 2008;

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-a7d
koofers-user-a7d 🇺🇸

4

(1)

10 documents

1 / 56

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 35101 Ch5.75 Steinfadt, SP08 KSU
CS 35101
Computer Architecture
Spring 2008
Week 11: 5.5, 5.7, 5.6
Materials adapted from Kevin Schaffer and Mary Jane Irwin
(www.cse.psu.edu/~mji)
[adapted from D. Patterson slides]Single Cycle Disadvantages &
Advantages
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38

Partial preview of the text

Download Multicycle Implementation Overview - Lecture Slides | CS 35101 and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Computer Architecture^ CS 35101

Spring 2008

Week 11: 5.5, 5.7, 5.

Materials adapted from Kevin Schaffer and Mary Jane Irwin (www.cse.psu.edu/~mji)

[adapted from D. Patterson slides Advantages]Single Cycle Disadvantages &

Multicycle Implementation Overview

 Each instruction  Therefore, an instruction takes step takes 1 clock cycle more than 1 clock cycle to

complete

 Not every instruction takes the cycles to complete same number of clock

 Multicycle  faster clock rates implementations allow

 different instructions to take a different number of clock cycles

 functional units to be used more than once per instruction as long as they are used on different clock cycles, as a

result - only need one memory

  • only need one ALU/adder

The Multicycle Datapath – A High Level View

Address Read Data (Instr. or Data) PC^ Memory Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR

MDR

A B^ ALUout

 Registers have to be added after every major functional unit to hold the output value until it is used

in a subsequent clock cycle

Clocking the Multicycle Datapath

Address Read Data (Instr. or Data) PC^ Memory Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR

MDR

A B^ ALUout

System Clock

MemWrite RegWrite

clock cycle

The Complete Multicycle Data with Control

Address Read Data (Instr. or Data)

PC^ Memory

Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR MDR

A B^ ALUout Extend^ Sign left 2^ Shift (^) controlALU

left 2^ Shift

Control^ ALUOp MemWrite MemtoReg IRWrite IorD MemRead^ PCWrite PCWriteCond RegDst^ RegWrite^ ALUSrcA ALUSrcB

zero

PCSource

Instr[5-0]

Instr[25-0]^ PC[31-28]

Instr[15-0]

Instr[31-26]

32

28

 Reading from or writing to any of the internal registers, Register File, or the PC occurs (quickly) at the beginning

 (for read) or the end of a clock cycle (for write)Reading from the Register File takes ~50% of a clock cycle since it has additional control and access overhead (but reading can be done in parallel with decode)  Had to add functional unit input ports (e.g., Memory, ALU) because multiplexors in front of several of the they are now shared by different clock cycles and/or do multiple jobs

 All operations occurring in one clock cycle occur in parallel

 This limits us to one ALU operation, one Memory access, and one Register File access per clock cycle

Our Multicycle Approach, con’t

New Control Signals

 IRWrite to IR : If asserted the memory output is written

 PCSource ALU, ALUOut: Selects the new value for the PC from:, jump target address

 PCWrite : If asserted the PC is written

 PCWriteCond from the ALU is 1 then the PC is written: If asserted and the zero output

 Instruction Fetch

 Instruction Decode and Register Fetch

 R-type Instruction Execution, Memory Read/Write Address Computation, Branch Completion, or

Jump Completion

 Memory Read Access, Memory Write Completion or R-type Instruction Completion

 Memory Read Completion (Write Back)

INSTRUCTIONS TAKE FROM 3 - 5 CYCLES!

Five Instruction Steps

Datapath Activity During Instruction Fetch

Address Read Data (Instr. or Data)

PC^ Memory Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR MDR

A B^ ALUout Extend^ Sign left 2^ Shift (^) controlALU

left 2^ Shift

Control^ ALUOp MemWrite MemtoReg IRWrite IorD MemRead^ PCWrite PCWriteCond RegDst^ RegWrite^ ALUSrcA ALUSrcB

zero

PCSource

Instr[5-0]

Instr[25-0]^ PC[31-28]

Instr[15-0]

Instr[31-26]

32

28

Fetch Control Signals Settings

Start^ Instr^ Fetch

Datapath Activity During Instruction Decode

Address Read Data (Instr. or Data)

PC^ Memory Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR MDR

A B^ ALUout Extend^ Sign left 2^ Shift (^) controlALU

left 2^ Shift

Control^ ALUOp MemWrite MemtoReg IRWrite IorD MemRead^ PCWrite PCWriteCond RegDst^ RegWrite^ ALUSrcA ALUSrcB

zero

PCSource

Instr[5-0]

Instr[25-0]^ PC[31-28]

Instr[15-0]

Instr[31-26]

32

28

 ALU is performing one of four functions, based on instruction type

 Load/Store (  ALUOut ← lwA + andSignExt sw(IR[15:0])): Compute memory address

 R-type: Perform operation specified by instruction  ALUOut ← A op B

 Branch: Compare registers and set PC if equal  if (A == B) PC ← ALUOut

 Jump:Set PC to jump target address  PC ← {PC[31:28] || (IR[25:0] << 2)}

Step 3 (instruction dependent)

Datapath Activity During R-type Execute

Address Read Data (Instr. or Data)

PC^ Memory Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR MDR

A B^ ALUout Extend^ Sign left 2^ Shift (^) controlALU

left 2^ Shift

Control^ ALUOp MemWrite MemtoReg IRWrite IorD MemRead^ PCWrite PCWriteCond RegDst^ RegWrite^ ALUSrcA ALUSrcB

zero

PCSource

Instr[5-0]

Instr[25-0]^ PC[31-28]

Instr[15-0]

Instr[31-26]

32

28

Datapath Activity During beq Execute

Address Read Data (Instr. or Data)

PC^ Memory Write Data

Read Read AddrAddr (^12) Write Addr

Register File Data 1^ Read Write Data Data 2^ Read^ ALU

IR MDR

A B^ ALUout Extend^ Sign left 2^ Shift (^) controlALU

left 2^ Shift

Control^ ALUOp MemWrite MemtoReg IRWrite IorD MemRead^ PCWrite PCWriteCond RegDst^ RegWrite^ ALUSrcA ALUSrcB

zero

PCSource

Instr[5-0]

Instr[25-0]^ PC[31-28]

Instr[15-0]

Instr[31-26]

32

28