CSE 2021 COMPUTER ORGANIZATION

Similar documents
CSE 2021 COMPUTER ORGANIZATION

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W10-M

Processor: Multi- Cycle Datapath & Control

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

CPE 335. Basic MIPS Architecture Part II

LECTURE 6. Multi-Cycle Datapath and Control

Points available Your marks Total 100

Topic #6. Processor Design

Systems Architecture I

Multiple Cycle Data Path

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR

EECE 417 Computer Systems Architecture

CC 311- Computer Architecture. The Processor - Control

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

ECE369. Chapter 5 ECE369

Chapter 5: The Processor: Datapath and Control

RISC Processor Design

CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation

The Processor: Datapath & Control

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Alternative to single cycle. Drawbacks of single cycle implementation. Multiple cycle implementation. Instruction fetch

RISC Architecture: Multi-Cycle Implementation

Control Unit for Multiple Cycle Implementation

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

RISC Design: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation

Chapter 5 Solutions: For More Practice

ENE 334 Microprocessors

Note- E~ S. \3 \S U\e. ~ ~s ~. 4. \\ o~ (fw' \i<.t. (~e., 3\0)

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

Design of the MIPS Processor (contd)

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

Chapter 4 The Processor (Part 2)

Lets Build a Processor

Major CPU Design Steps

Multicycle Approach. Designing MIPS Processor

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W9-W

Design of the MIPS Processor

Single vs. Multi-cycle Implementation

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Processor (multi-cycle)

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

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

Mapping Control to Hardware

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

Using a Hardware Description Language to Design and Simulate a Processor 5.8

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University

Computer Science 141 Computing Hardware

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

EE457. Note: Parts of the solutions are extracted from the solutions manual accompanying the text book.

ECE 3056: Architecture, Concurrency and Energy of Computation. Single and Multi-Cycle Datapaths: Practice Problems

Processor Implementation in VHDL. University of Ulster at Jordanstown University of Applied Sciences, Augsburg

Systems Architecture

Microprogramming. Microprogramming

Lecture 5: The Processor

ECE 30, Lab #8 Spring 2014

Multicycle conclusion

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

Microprogrammed Control Approach

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

Processor (I) - datapath & control. Hwansoo Han

COMP2611: Computer Organization. The Pipelined Processor

LECTURE 5. Single-Cycle Datapath and Control

ECE 313 Computer Organization FINAL EXAM December 11, Multicycle Processor Design 30 Points

Lecture 9: Microcontrolled Multi-Cycle Implementations. Who Am I?

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

Computer Architecture, IFE CS and T&CS, 4 th sem. Single-Cycle Architecture

CS232 Final Exam May 5, 2001

Implementing the Control. Simple Questions

Lab 8: Multicycle Processor (Part 1) 0.0

EE457 Lab 4 Part 4 Seven Questions From Previous Midterm Exams and Final Exams ee457_lab4_part4.fm 10/6/04

Final Project: MIPS-like Microprocessor

ECE Exam I - Solutions February 19 th, :00 pm 4:25pm

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

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

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller

ECE232: Hardware Organization and Design

Winter 2002 FINAL EXAMINATION

Week 6: Processor Components

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007

Inf2C - Computer Systems Lecture Processor Design Single Cycle

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

CSE 141 Computer Architecture Spring Lectures 11 Exceptions and Introduction to Pipelining. Announcements

Computer Organization & Design The Hardware/Software Interface Chapter 5 The processor : Datapath and control

Beyond Pipelining. CP-226: Computer Architecture. Lecture 23 (19 April 2013) CADSL

CS152 Computer Architecture and Engineering. Lecture 8 Multicycle Design and Microcode John Lazzaro (

Announcements. This week: no lab, no quiz, just midterm

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining

Introduction to Pipelined Datapath

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

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

Lecture 2: MIPS Processor Example

ECE 313 Computer Organization EXAM 2 November 9, 2001

CSEN 601: Computer System Architecture Summer 2014

CSSE232 Computer Architecture I. Mul5cycle Datapath

Example Sketch a stick diagram for a CMOS gate computing Y = (A + B + C) D (see Figure 1.18) and estimate the cell width and height.

CMOS VLSI Design. MIPS Processor Example. Outline

Transcription:

CSE 2021 COMPUTER ORGANIZATION HUGH LAS CHESSER 1012U HUGH CHESSER CSEB 1012U W10-M

Agenda Topics: 1. Multiple cycle implementation review 2. State Machine 3. Control Unit implementation for Multi-cycle core Patterson: Section 4.5, Appendix C Reminder: Quiz #2 Wednesday (November 7) W10-M 2

Breaking the Instruction Execution into Clock Cycles Execution of each instruction is broken into a series of steps Each step is balanced to do almost equal amount of work Each step takes one clock cycle Each step contains at the most 1 ALU operation, or 1 register file access, or 1 memory access Operations listed in 1 step occurs in parallel in 1 clock cycle Different steps occur in different clock cycles Different steps are: 1. IF: Instruction fetch step 2. ID: Instruction decode and register fetch step 3. EX: Execution, memory address computation, or branch completion step 4. MEM: Memory access of R-type instruction completion step 5. WB: Write back completion step W10-M 3

Multicycle Implementation: Control Units added W10-M 4

Action of 2-bit Control Signals Control Input ALUOp ALUSrcB Value Effect 00 ALU performs an add operation 01 ALU performs a subtract operation 10 The function field of Instruction defines the operation of ALU 00 The second operand of ALU comes from Register B 01 The second operand of ALU = 4 10 The second operand of ALU is sign extended Instruction[15-0] 11 The second operand of ALU is sign extended, 2-bit left shifted Instruction[15-0] PCSource 00 Output of ALU (PC + 4) is sent to PC 01 Contents of ALUOut (branch target address = PC + 4 + 4 x offset) is sent to PC 10 Contents of Instruction[25-0], shift left by 2, and concatenated with the MSB 4- bits of PC is sent to PC (jump instruction) W10-M 5

Action of 1-bit Control Signals Control Input Effect when Deasserted (0) Effect when asserted (1) IorD PC supplies address to memory (instruction fetch) ALUout supplies address to memory (lw/sw) MemRead None Memory content specified by address is placed on Memdata o/p (lw/any instruction) MemWrite None I/p Write data is stored at specified address (sw) IRWrite None MemData o/p is written on IR (instruction fetch) RegDst RegWrite Write Register specified by Instruction[20-16] (lw) None WriteRegister specified by Instruction[15-11] (Rtype) Data from WriteData i/p is written on the register specified by WriteRegister number ALUSrcA PC is the first operand in ALU (increment PC) Register A is the first operand in ALU MemtoReg WriteData of the register file comes from ALUOut WriteData of the register file comes from MDR PCWrite PCWriteCond Operation at PC depends on PCWriteCond and zero output of ALU Operation at PC depends on PCWrite PC is written; Source is determined by PCSource PC is written if zero o/p of ALU = 1; Source is determined by PCSource W10-M 6

Summary of Steps used in different Instructions Step Name IF - Instruction fetch ID - Instruction decode / Register fetch EX R-type Execution / address comp. / Branch /Jump MEM - Memory Access / R-type Completion WB - Memory Read Completion R-type Instruction ALUOut=A op B Reg[IR[15-11]] = ALUOut; Memory Reference Instruction Action for IR = Memory[PC]; PC = PC + 4; Branch A = Reg[IR[25-21]]; B = Reg[IR[20-16]]; ALUOut = PC + (sign-extend(ir[15-0])<<2); ALUOut = A + signextend(ir[15-0]) lw: MDR = Memory[ALUOut] or sw: Memory[ALUOut] = B lw: Reg[IR[20-16]]=MDR; if(a == B) then PC = ALUOut; Jump PC = PC[31-28] (IR[25-0)<<2); W11-M 7

Multipath Datapath Implementation: Control Recall that design of single cycle datapath was based on a combinational circuit Design of multicycle datapath is more complicated 1. Instructions are executed in a series of steps 2. Each step must occur in a sequence 3. Control of multicycle must specify both the control signals and the next step The control of a multicycle datapath is based on a sequential circuit referred to as a finite state machine State 0 A finite state diagram for a 2-bit counter Each state specifies a set of outputs By default, unspecified outputs are assumed disabled The number of the arrows identify inputs 00 State 1 11 01 State 3 10 W11-M 8 State 2

Finite State Machine? See Appendix C A sequential logic function which has a state and inputs the logic function determines the next state and outputs Moore machine outputs depend on just the current state Mealy machine outputs depend on current state and inputs Book uses Moore machine description W11-M 9

Finite State Machine Control of Multicycle Datapath (1) Start Instruction fetch/decode and register fetch (Figure 4.36) Memory access Instructions (Figure 4.20) R-type instructions Figure (4.19) Branch instruction (Figure 4.21) Jump instruction (Figure 4.24) High-Level View W11-M 10

Finite State Machine Control of Multicycle Datapath (2) Start 0 Instruction fetch MemRead ALUSrcA = 0 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCWrite PCSource = 00 Instruction decode/ Register fetch 1 ALUSrcA = 0 ALUSrcB = 11 ALUOp = 00 (Op = 'LW') or (Op = 'SW') (Op = R-type) (Op = 'BEQ') (Op = 'JMP') Memory reference FSM R-type FSM Branch FSM Jump FSM Fig. D.3.1: Steps 1 and 2: Instruction Fetch and Decode Instructions W11-M 11

Finite State Machine Control of Multicycle Datapath (3) From state 1 2 (Op = 'lw') or (Op = 'sw') Memory address computation ALUSrcA = 1 ALUSrcB = 10 ALUOp = 00 Finite State Machine for Memory Reference Instructions (Op = 'lw') Memory access (Op = 'sw') Memory access 3 5 MemRead IorD = 1 MemWrite IorD = 1 Write-back step 4 RegWrite MemtoReg = 1 RegDst = 0 To state 0 W11-M 12

Finite State Machine Control of Multicycle Datapath (4) 6 From state 1 (Op = R-type) Execution ALUSrcA = 1 ALUSrcB = 00 ALUOp = 10 7 RegDst = 1 RegWrite Memto Reg = 0 R-type completion To state 0 Finite State Machines for R-type Instructions W11-M 13

Finite State Machine Control of Multicycle Datapath (5) From state 1 (Op = 'beq') From state 1 (Op = 'j') 8 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond PCSource = 01 Branch completion 9 PCWrite PCSource = 10 Jump completion To state 0 To state 0 Finite State Machine for Branch Instruction Finite State Machine for Jump Instruction W11-M 14

2 Memory address computation ALUSrcA = 1 ALUSrcB = 10 ALUOp = 00 Start (Op = 'lw' or 'sw') Execution Instruction fetch 0 MemRead = 1 ALUSrcA = 0 1 IorD = 0 IRWrite ALUSrcB = 01 ALUOp = 00 PCWrite = 1 PCSource = 00 6 ALUSrcA = 1 ALUSrcB = 00 ALUOp = 10 (Op = R-type) 8 Branch completion ALUSrcA = 1 ALUSrcB = 00 ALUOp = 01 PCWriteCond = 1 PCSource = 01 (Op = 'beq') 9 Instruction decode/ register fetch ALUSrcA = 0 ALUSrcB = 11 ALUOp = 00 (Op = 'j') Jump completion PCWrite = 1 PCSource = 10 3 (Op = 'lw') Memory access MemRead = 1 IorD = 1 5 (OP = 'sw') Memory access MemWrite = 1 IorD = 1 7 RegDst = 1 RegWrite = 1 MemtoReg = 0 R-type completion 4 Write-back step RegDst = 0 RegWrite = 1 MemtoReg = 1 W11-M 15

Finite State Machine Control of Multicycle Datapath (5) Outputs Control logic Inputs W11-M 16

Control Logic Truth Table Note that control outputs depend only on current state (Op column is blank for all output rows) Next state depends on current state and inputs (opcode from instruction) W11-M 17