Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

Similar documents
Learning Outcomes. Spiral 3-3. Sorting: Software Implementation REVIEW

Processor (I) - datapath & control. Hwansoo Han

CPE 335 Computer Organization. Basic MIPS Architecture Part I

CENG 3420 Lecture 06: Datapath

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Chapter 4. The Processor. Computer Architecture and IC Design Lab

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

The overall datapath for RT, lw,sw beq instrucution

Chapter 4. The Processor

Systems Architecture

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

ECE260: Fundamentals of Computer Engineering

Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

Chapter 4 The Processor 1. Chapter 4A. The Processor

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Review: Abstract Implementation View

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

CPE 335. Basic MIPS Architecture Part II

CC 311- Computer Architecture. The Processor - Control

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

EE 457 Unit 6a. Basic Pipelining Techniques

LECTURE 5. Single-Cycle Datapath and Control

The Processor: Datapath & Control

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

Chapter 5: The Processor: Datapath and Control

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

Topic #6. Processor Design

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath

Laboratory 5 Processor Datapath

Ch 5: Designing a Single Cycle Datapath

CS61C : Machine Structures

Systems Architecture I

Chapter 4. The Processor Designing the datapath

ECE232: Hardware Organization and Design

Introduction. Datapath Basics

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

are Softw Instruction Set Architecture Microarchitecture are rdw

CPU Organization (Design)

Single Cycle Datapath

RISC Processor Design

Fundamentals of Computer Systems

Chapter 4. The Processor

CS3350B Computer Architecture Quiz 3 March 15, 2018

The MIPS Processor Datapath

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

Single Cycle Datapath

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

Chapter 4. The Processor

RISC Design: Multi-Cycle Implementation

Microprogrammed Control Approach

Computer Hardware Engineering

ECS 154B Computer Architecture II Spring 2009

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

Lecture 7 Pipelining. Peng Liu.

Multicycle Approach. Designing MIPS Processor

CSEN 601: Computer System Architecture Summer 2014

The Processor: Datapath & Control

ECE369. Chapter 5 ECE369

COMP303 Computer Architecture Lecture 9. Single Cycle Control

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

COMPUTER ORGANIZATION AND DESIGN

CSE Computer Architecture I Fall 2009 Lecture 13 In Class Notes and Problems October 6, 2009

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

Improving Performance: Pipelining

CSE140: Components and Design Techniques for Digital Systems

CSE 378 Midterm 2/12/10 Sample Solution

Introduction. ENG3380 Computer Organization and Architecture MIPS: Data Path Design Part 3. Topics. References. School of Engineering 1

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

Major CPU Design Steps

CS 110 Computer Architecture Single-Cycle CPU Datapath & Control

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

CS Computer Architecture Spring Week 10: Chapter

Lets Build a Processor

Lecture 10: Simple Data Path

Design of the MIPS Processor

EEM 486: Computer Architecture. Lecture 3. Designing Single Cycle Control

Lecture 6 Datapath and Controller

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

CS359: Computer Architecture. The Processor (A) Yanyan Shen Department of Computer Science and Engineering

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

EE 457 Midterm Summer 14 Redekopp Name: Closed Book / 105 minutes No CALCULATORS Score: / 100

Transcription:

EE 37 Unit Single-Cycle CPU path and Control

CPU Organization Scope We will build a CPU to implement our subset of the MIPS ISA Memory Reference Instructions: Load Word (LW) Store Word (SW) Arithmetic and Logic Instructions: ADD, SUB, AND, OR, SLT Branch and Jump Instructions: Branch if equal (BEQ) Jump unconditional (J) These basic instructions exercise a majority of the necessary datapath and control logic for a more complete implementation 2

CPU Implementations We will go through two implementations Single-cycle CPU (CPI = ) All instructions execute in a single, long clock cycle Multi-cycle CPU (CPI = n) Instructions can take a different number of short clock cycles to execute Recall that a program execution time is: (Instruction count) x (CPI) x (Clock cycle time) In single-cycle implementation cycle time must be set for longest instruction thus requiring shorter instructions to wait Multi-cycle implementation breaks logic into sub-operations each taking one short clock cycle; then each instruction takes only the number of clocks (i.e. CPI) it needs 3

Single-Cycle path To start, let us think about what operations need to be performed for the basic instructions All instructions go through the following steps: Fetch: Use PC address to fetch instruction Decode & Register/Operand Fetch: Determine instruction type and fetch any register operands needed Once decoded, different instructions require different operations instructions: Perform Add, Sub, etc. and write result back to register LW / SW: Calculate address and perform memory access BEQ / J: Update PC (possible based on comparison) Let us start with fetching an instruction and work our way through the necessary components 4 Mark Redekopp and Gandhi Puvvada, All rights reserved

Fetch Components Required operations Taking address from PC and reading instruction from memory Incrementing PC to point at next instruction Components PC register Instruction Memory / Cache Adder to increment PC value CLK A PC From PC Instruction Word S B Register I-Cache / I-MEM Memory Adder

Fetch path PC value serves as address to instruction memory while also being incremented by 4 using the adder Instruction word is returned by memory after some delay New PC value is clocked into PC register at end of clock cycle 4 A Next PC = PC 4 S CLK B PC Current PC / Address Instruction Word I-Cache / I-MEM 6

Fetch path Example The PC and adder operation is shown The PC doesn t update until the end of the current cycle The instruction being read out from the instruction memory We have shown assembly syntax and the field by field machine code breakdown Next PC = PC 4 4 A S opcode rs rt rd shamt func B CLK ADD $6,$9,$ PC Current PC / Address (e.g. x2a82) Instruction Word Mark Redekopp and Gandhi Puvvada, All rights reserved I-Cache / I-MEM 7

Fetch path Question Can the adder used to increment the PC be an and be used/shared for instructions like ADD/SUB/etc. In a single-cycle CPU, resources cannot be shared thus we need a separate adder and separate Next PC = PC 4 4 A S B CLK PC Current PC / Address Instruction Word I-Cache / I-MEM 8

Fetch path Question 2 Do we need the enable signal on the PC register for our single-cycle CPU? In the single-cycle CPU, the PC is updated EVERY clock cycle (since we execute a new instruction each cycle). Thus we are writing the PC every cycle and don t need the write signal. Next PC = PC 4 4 A S B CLK PC Current PC / Address Instruction Word I-Cache / I-MEM 9

Fetch path Question 3 Can we just use a counter for the PC rather than a register and separate adder? This raises an important question, Do we really increment the PC every clock? No. We have to remember branch and jump equations cause the PC to skip to a new value. We should add that datapath Next PC = PC 4 4 A S CLK B PC Current PC / Address Instruction Word I-Cache / I-MEM

Modified Fetch path Below is the fetch datapath modified to support branch instructions Branch PC Next PC = PC 4 4 A S CLK B PC Current PC / Address Instruction Word PCSrc I-Cache / I-MEM

x48 Fetch Address in PC is used to fetch instruction while it is also incremented by 4 to point to the next instruction Remember, the PC doesn t update until the end of the clock cycle / beginning of next cycle Mux provides a path for branch target addresses Fetch 4 A x4c PC4 B branch target clk PC Adder time 44 x48 x4c 48 x4c x42 PC x48 Instruc. I-Cache x2a82 ADD $6,$9,$ opcode rs rt rd shamt func 2

Decode Opcode and func. field are decoded to produce other control signals Execution of an instruction (ADD $3,$,$2) requires reading 2 register values and writing the result to a third REG is an enable signal indicating the write data should be written to the specified register Instruction Word ADD $3,$,$2 opcode rs rt shamt rd func Mark Redekopp and Gandhi Puvvada, All rights reserved 2 3 Reg. # Reg. 2 # Reg. # Control Logic data data 2 Register File CLK REG Control Signals Value of $ Value of $2 Register File is the collection of GPR s. Our register file has 3 ports (port = ability to concurrently read or write a register). To see why we need 3, consider an ADD $3,$,$2. We need 2 read ports to read two operands (i.e. $ $2) and write port for the result ($3) Result from add 3

RegFile Question Why do we need the write enable signal, REG? We have certain instructions like BEQ or SW that do not cause a register to be updated. Thus we need the ability to NOT change a register. Instruction Word ex. instruc. opcode rs rt shamt rd func Mark Redekopp and Gandhi Puvvada, All rights reserved Reg. # Reg. 2 # Reg. # Control Logic data data 2 Register File CLK REG Control Signals Value of $ Value of $2 Result from add 4

RegFile Question 2 Can write to registers be level sensitive or does it have to be edge-sensitive? It must be edge-sensitive since a register may be source and destination (i.e. add $,$,$2). If it was level sensitive we would have an uncontrolled feedback loop. Instruction Word ex. instruc. opcode rs rt shamt rd func Mark Redekopp and Gandhi Puvvada, All rights reserved Reg. # Reg. 2 # Reg. # Control Logic data data 2 Register File CLK REG Control Signals Value of $ Value of $2 Result from add

RegFile Question 3 Since we need a write enable, do we need read enables (i.e. RE, RE2) We do not need read enables because reading a value does not change the state of the processor. It may be unnecessary even if no source registers are needed (e.g. Jmp), reading data out of the register file should not cause harm. Reg. # RE Reg. 2 # RE2 data data 2 Operand A value Operand B value Reg. # Register File Mark Redekopp and Gandhi Puvvada, All rights reserved CLK REG Result from add 6

path for instruction takes inputs from register file and performs the add, sub, and, or, slt, operations Result is written back to dest. register Instruc. word ADD $3,$,$2 2 3 Reg. # Reg. 2 # Reg. # data data 2 $ value $2 value op Zero Res. Sum Register File 7

Memory Access Components LW and SW require: Sign extension unit for address offset to compute (add) base address offset memory LW $4,xfff8($) opcode rs rt offset op Offset field from instruc. word Sign Extended Offset Sign 6 Extend 32 Base Address from register file Sign Extended Offset Zero Res. Sum = Effective address Sign Extension Unit (Adder) Memory Mark Redekopp and Gandhi Puvvada, All rights reserved 8

Sign Extension Unit In a LW or SW instructions with their base register offset format, the instruction only contains the offset as a 6-bit value Example: LW $4,-8($) Machine Code: x8c24fff8-8 = xfff8 The 6-bit offset must be extended to 32-bits before being added to base register offset = xfff8 Sign xfffffff8 6 Extend 32 LW $4,xfff8($) opcode rs rt offset Mark Redekopp and Gandhi Puvvada, All rights reserved 9

Sign Extension Question What logic is inside a sign-extension unit? How do we sign extend a number? Do you need a shift register? b b 4 b 3 b 6-bit offset Sign Extension Unit b b b b 4 b 3 b 32-bit sign-extended output 2

Memory Questions Do we need separate instruction and data memory or can we just use one (i.e. most personal computers only have one large set of RAM)? Do we need separate read/write address inputs or can we have just one address input used for both operations? Do we need separate read/write data input/output or a bidirectional input (for write) / output (for read)? Can we do away with the read control signal (similar to how we did away with read enables for register file)? Mem Mem 2

Memory Answers We do need separate memories for instruction and data memories since we want to fetch an instruction and read/write data in the same clock (i.e. can t share the memory) In the case of a single cycle CPU, we only perform one read/write at a time thus we can share address inputs and, if we want, make the data input/output bidirectional, however we can also have separate data input/outputs Without a read control signal the memory would always be reading based on the address input (which will be arbitrary values for non-memory instructions). This can have serious side effects such as invalid address and, since this memory is likely a cache, cache misses, etc. Mem Mem 22

Memory Access path Operands are read from register file while offset is sign extended calculates effective address Memory access is performed If LW, read data is written back to register LW $4,xfff8($) SW $3,xa($) 4 Reg. # Reg. 2 # Reg. # data data 2 Register File Sign Extend 32 $ value xffff fff8 ADD Zero Res. Sum D-Cache 3 Reg. # Reg. 2 # Reg. # data data 2 Register File Sign Extend 32 $ value xa Zero Res. $3 value Sum D-Cache 23

Branch path BEQ requires for comparison (examine zero output) Sign extension unit for branch offset Adder to add PC and offset Need a separate adder since is used to perform comparison PC4 (incremented PC) Instruc. word BEQ $,$2,offset 2 Reg. # Reg. 2 # Reg. # data data 2 Shift Left 2 $ value $2 value byte offset Adder op Sum Zero Res. Branch Target Address to PC ZERO Sum Register File Mark Redekopp and Gandhi Puvvada, All rights reserved word offset Sign Extend extended word offset 24

Branch path Question Is it okay to start adding branch offset even before determining whether the branch is taken or not? Yes, it does not hurt because the ZERO signal will control whether that Branch Target is used to update the PC or not PC4 (incremented PC) Instruc. word BEQ $,$2,offset 2 Reg. # Reg. 2 # Reg. # data data 2 Shift Left 2 $ value $2 value Adder Sum op Zero Res. Branch Target Address to PC ZERO Sum (To control logic) Register File Mark Redekopp and Gandhi Puvvada, All rights reserved word offset Sign Extend extended word offset 2

Combining paths Now we will take the datapaths for each instruction type and try to combine them into one Anywhere we have multiple options for a certain input we can use a mux to select the appropriate value for the given instruction Select bits must be generated to control the mux 26

Src Mux Mux controlling second input to instruction provides Register 2 data to the 2 nd input of LW/SW uses 2 nd input of as an offset to form effective address truc. word 2 3 Reg. # Reg. 2 # Reg. # Instruction data data 2 Register File $ value $2 value Reg. # op Zero Res. Sum 4 Reg. # Reg. 2 # Reg. # data data 2 Register File Sign Extend 32 $ value xffff fff8 ADD Zero Res. Sum D-Cache Mem. Instruction Reg. 2 # Reg. # data data 2 Register File Zero Res. Mark Redekopp and Gandhi Puvvada, All rights reserved Sign Extend 32 Src 27

MemtoReg Mux Mux controlling writeback value to register file instructions use the result of the LW uses the read data from data memory Reg. # Reg. 2 # Reg. # data data 2 Register File Sign 6 Extend 32 Zero Res. D-Cache MemtoReg 28

PC Mark Redekopp and Gandhi Puvvada, All rights reserved PCSrc Mux Next instruction can either be at the next sequential address (PC4) or the branch target address (PCoffset) 4 A B Instruc. I-Cache Reg. # Reg. 2 # Reg. # data data 2 Register File Sign 6 Extend 32 Sh. Left 2 Zero Res. Branch Target Address PCSrc D-Cache 29

PC Mark Redekopp and Gandhi Puvvada, All rights reserved RegDst Mux Different destination register ID fields for and LW instructions R-Type () rs rt rd shamt func 3-26 2-2 2-6 - -6 - Destination I-Type (LW) 3 or 43 rs rt address offset 3-26 2-2 2-6 - Register Number 4 A B Instruc. I-Cache rs rt rd RegDst Reg. # Reg. 2 # Reg. # data data 2 Register File Sign 6 Extend 32 Sh. Left 2 Zero Res. D-Cache 3

PC Mark Redekopp and Gandhi Puvvada, All rights reserved [:] Single-Cycle CPU path 4 A B Sh. Left 2 PCSrc Reg Branch Instruc. I-Cache [2:2] [2:6] [:] RegDst Reg. # Reg. 2 # Reg. # data data 2 Register File 6 Sign 32 Extend INST[:] Op[:] Src Zero Res. control Mem D-Cache Mem MemtoReg 3

PC Mark Redekopp and Gandhi Puvvada, All rights reserved [:] [3:26] Single-Cycle CPU path 4 A B Control Mem & Mem Op[:] MemtoReg RegDst Src Reg Sh. Left 2 Branch PCSrc Instruc. I-Cache [2:2] [2:6] [:] RegDst Reg. # Reg. 2 # Reg. # data data 2 Register File 6 Sign 32 Extend INST[:] Op[:] Src Zero Res. control Mem D-Cache Mem MemtoReg 32

PC Mark Redekopp and Gandhi Puvvada, All rights reserved [2:] [:] [3:26] Jump Instruc. Implementation Sh. 26 Left 2 28 32 Jump Address = {NewPC[3:28], INST[2:],} Next Instruc. Address 4 A B Control Jump Mem & Mem Op[:] MemtoReg RegDst Src Reg Sh. Left 2 Branch Branch Address PCSrc Jump Instruc. I-Cache [2:2] [2:6] [:] RegDst Reg. # Reg. 2 # Reg. # data data 2 Register File 6 Sign 32 Extend INST[:] Op[:] Src Zero Res. control Mem D-Cache Mem MemtoReg 33

Control Unit Design for Single-Cycle CPU Control Unit: Maps instruction to control signals Traditional Control Unit FSM: Produces control signals asserted at different times Design NSL, SM, OFL Single-Cycle Control Unit Every cycle we perform the same steps: Fetch, Decode, Execute Signals are not necessarily time based but instruction based => only combinational logic Inputs (Instruction/Opcode) NSL SM Traditional Control Unit OFL Outputs # of FF s in tightly-encoded state assignment: -8 states:, 9-6 states: Inputs (Instruction/Opcode) NSL SM State OFL Single-Cycle Control Unit Outputs Only state => FF s 34

Control Unit Most control signals are a function of the opcode (i.e. LW/SW, R-Type, Branch, Jump) Control is a function of opcode AND function bits. OpCode (Instruc.[3:26]) Func. (Instruc.[:]) OpCode (Instruc.[3:26]) Control Unit Control Unit Jump Branch Mem Mem MemtoReg Src RegDst Reg Control[2:] Jump Branch Mem Mem MemtoReg Src RegDst Reg Func. (Instruc.[:]) Op[:] Control Control[2:] 3

Control[2:] Control Control needs to know what instruction type it is: R-Type (op. depends on func. code) LW/SW (op. = ADD) BEQ (op. = SUB) Let main control unit produce Op[:] to indicate instruction type, then use function bits if necessary to produce Control[2:] Instruction Mark Redekopp and Gandhi Puvvada, All rights reserved Op[:] LW/SW Branch R-Type OpCode (Instruc.[3:26]) Control Unit Op[:] Func. (Instruc.[:]) Control Input Control Operation AND OR Add Subtract Set on less than Control unit maps instruction opcode to Needed Control Input for the to Op[:] encoding 36 perform the indicated operation

Control Truth Table Control[2:] is a function of: Op[:] and Func.[:] Instruc. Op[:] Instruction Operation Func.[:] Desired Action Control[2:] LW Load word X Add SW Store word X Add Branch BEQ X Subtract R-Type AND And R-Type OR Or R-Type Add Add R-Type Sub Subtract R-Type SLT Set on less than Produce each Control[2:] bit from the Op and Func. inputs 37

Control Logic Op[] Op[] Func[] Func[2] Control[2] Control[] Func[3] Func[] Control[] 38

Control Signal Generation Other control signals are a function of the opcode We could write a full truth table or (because we are only implementing a small subset of instructions) simply decode the opcodes of the specific instructions we are implementing and use those intermediate signals to generate the actual control signals OpCode (Instruc.[3:26]) Control Unit Jump Branch Mem Mem MemtoReg Src RegDst Reg Op[:] Could generate each control signal by writing a full truth table of the 6-bit opcode Mark Redekopp and Gandhi Puvvada, All rights reserved OpCode (Instruc.[3:26]) Decoder R-Type LW SW BEQ Jump Control Unit Jump Branch Mem Mem MemtoReg Src RegDst Reg Op[:] Simpler for human to design if we decode the opcode and then use individual instruction signals to generate desired control signals 39

[:] PC [2:] [3:26] Control Signal Truth Table R- Type LW SW BEQ J Jump Branch Reg Dst Src Memto- Reg Reg Mem Mem Op[] X X X X X X X X X Op[] Instruc. I-Cache Mark Redekopp and Gandhi Puvvada, All rights reserved 4 A B Sh. 26 Left 2 28 [2:2] [2:6] [:] RegDst Control Reg. # Reg. 2 # Reg. # Reg data data 2 Register File 32 Jump Mem & Mem Op[:] MemtoReg RegDst Src 6 Sign Extend 32 INST[:] Op[:] Jump Address Sh. Left 2 Branch Src Next Instruc. Address Zero Res. control Branch Address PCSrc Mem D-Cache Mem Jump MemtoReg 4

Control Signal Logic Op[] Op[4] Op[3] Op[2] Op[] Op[] Decoder R-Type LW SW BEQ J Jump Branch RegDst Src MemtoReg Reg Mem Mem Op Op 4

End of Single-Cycle CPU Slides 42

Src Drawings Each instruction will execute in one LONG clock cycle To understand the whole datapath we ll walk through it in five phases (Fetch, Decode, Execute, Memory, back) Reg. # Reg. 2 # Reg. # data data 2 Register File Zero Res. Sign 6 Extend 32 43

[:] PC [3:26] Single-Cycle CPU path 4 A B Control Mem & Mem Op[:] MemtoReg RegDst Src Reg Sh. Left 2 Branch PCSrc Instruc. I-Cache [2:2] [2:6] [:] Mark Redekopp and Gandhi Puvvada, All rights reserved RegDst Reg. # Reg. 2 # Reg. # data data 2 Register File 6 Sign 32 Extend INST[:] Op[:] Src Zero Res. control Mem D-Cache Mem MemtoReg 44

PC Mark Redekopp and Gandhi Puvvada, All rights reserved Single Cycle CPU path Each instruction will execute in one LONG clock cycle To understand the whole datapath we ll walk through it in five phases (Fetch, Decode, Execute, Memory, back) Fetch Decode Exec. Mem WB 4 A B Instruc. I-Cache Reg. # Reg. 2 # Reg. # data data 2 Register File Sign 6 Extend 32 Sh. Left 2 Zero Res. D-Cache CLK 4