MIPS Architecture. Fibonacci (C) Fibonacci (Assembly) Another Example: MIPS. Example: subset of MIPS processor architecture

Size: px
Start display at page:

Download "MIPS Architecture. Fibonacci (C) Fibonacci (Assembly) Another Example: MIPS. Example: subset of MIPS processor architecture"

Transcription

1 Another Eample: IPS From the Harris/Weste book Based on the IPS-like processor from the Hennessy/Patterson book IPS Architectre Eample: sbset of IPS processor architectre Drawn from Patterson & Hennessy IPS is a -bit architectre with s Consider -bit sbset sing -bit path Only implement s ($ - $7) $ hardwired to -bit program conter Set Encoding -bit instrction encoding Reqires for cycles to fetch on -bit path format eample encoding R add $rd, $ra, $rb ra rb rd fnct 5 5 I beq $ra, $rb, imm ra rb imm J j dest dest Fibonacci (C) f = ; f - = - f n = f n- + f n- f =,,,, 5,,, Fibonacci (Assembly) st statement: n = How do we translate this to assembly?

2 Fibonacci (Assembly) Fibonacci (Binary) st statement: addi $, $, How do we translate this to machine langage? Hint: se instrction encodings below format eample encoding R add $rd, $ra, $rb ra rb rd fnct 5 5 I beq $ra, $rb, imm ra rb imm J j dest dest Fibonacci (Binary) achine langage program IPS icroarchitectre lticycle μarchitectre from Patterson & Hennessy PCEn Cond IorD em em emtoreg Otpts Control PCSorce ALUOp ALUSrcB ALUSrcA Reg IR[:] Op [5: ] RegDst PC Address emory emdata [:] [5 : ] [ : ] [5 : ] [7: ] [5:] Shift left [5: ] Registers A B Zero ALU ALU reslt Jmp address ALUOt emory ALU control ALUControl [5: ] lticycle Controller Logic Design em em ALUSrcA = ALUSrcA = IorD = IorD = IR IR ALUSrcB = ALUSrcB = ALUOp = ALUOp = PCSorce = PCSorce = Reset emory address comptation 5 ALUSrcA = ALUSrcB = ALUOp = (Op = 'L B') (Op = 'S B') fetch em em decode/ ALUSrcA = ALUSrcA = fetch IorD = IorD = 4 IR IR ALUSrcB = ALUSrcB = ALUSrcA = ALUOp = ALUOp = ALUSrcB = ALUOp = PCSorce = PCSorce = (Op = 'L B ') or (Op = 'S B ') emory emory access access R-type completion RegDst = em em Reg IorD = IorD = emtoreg = -back step 7 (Op = R-type) Branch Jmp Eection completion completion (Op = 'BEQ') 9 ALUSrcA = ALUSrcA = ALUSrcB = ALUSrcB = ALUOp = PCSorce = ALUOp= Cond PCSorce = (Op = 'J') Start at t level Hierarchically decompose IPS into nits T-level interface crystal oscillator Clk reset memread memwrite IPS processor adr write mem eternal memory RegDst= Reg emtoreg=

3 PCEn PC Address emory emdata emory Cond IorD em em emtoreg PCSorce ALUOp ALUS rcb ALUS rca Otpts Control RegWri te Op IR[:] RegDst [5: ] [5 : ] [: ] [5 : ] [ : ] [5 : ] [5: ] [7 : ] Registers Wr ite Wr ite [5 : ] Shift left A Zero ALU ALU reslt B ALU control ALUControl Jmp address ALUOt Verilog Code Block Diagram // t level design incldes both mips processor and memory modle mips_mem #(parameter WIDTH =, REGBITS = )(clk, reset); inpt clk, reset; wire memread, memwrite; wire [WIDTH-:] adr, write; wire [WIDTH-:] mem; // instantiate the mips processor mips #(WIDTH,REGBITS) mips(clk, reset, mem, memread, memwrite, adr, write); // instantiate memory for code and emem #(WIDTH) emem(clk, memwrite, adr, write, mem); memwrite memread ph ph reset adr[7:] write[7:] mem[7:] zero [5:] alsrca alsrcb[:] controller pcen pcsorce[:] memtoreg regdst iord regwrite irwrite[:] path al[:] alcontrol fnct[5:] alcontrol[:] // simplified IPS processor modle mips #(parameter WIDTH =, REGBITS = ) (inpt clk, reset, inpt [WIDTH-:] mem, otpt memread, memwrite, otpt [WIDTH-:] adr, write); wire [:] instr; wire zero, alsrca, memtoreg, iord, pcen, regwrite, regdst; wire [:] al,pcsorce,alsrcb; wire [:] irwrite; wire [:] alcont; controller cont(clk, reset, instr[:], zero, memread, memwrite, alsrca, memtoreg, iord, pcen, regwrite, regdst, pcsorce, alsrcb, al, irwrite); alcontrol ac(al, instr[5:], alcont); path #(WIDTH, REGBITS) dp(clk, reset, mem, alsrca, memtoreg, iord, pcen, regwrite, regdst, pcsorce, alsrcb, irwrite, alcont, zero, instr, adr, write); T-level code modle controller(inpt clk, reset, inpt [5:], inpt zero, otpt reg memread, memwrite, alsrca, memtoreg, iord, otpt pcen, otpt reg regwrite, regdst, otpt reg [:] pcsorce, alsrcb, al, otpt reg [:] irwrite); parameter FETCH = 4'b; parameter FETCH = 4'b; parameter FETCH = 4'b; parameter FETCH4 = 4'b; parameter DECODE = 4'b; parameter EADR = 4'b; parameter LBRD = 4'b; parameter LBWR = 4'b; parameter SBWR = 4'b; parameter RTYPEEX = 4'b; parameter RTYPEWR = 4'b; parameter BEQEX = 4'b; parameter JEX = 4'b; parameter ADDIWR = 4'b; // added for ADDI parameter LB = 'b; parameter SB = 'b; parameter RTYPE = 'b; parameter BEQ = 'b; parameter J = 'b; parameter ADDI = 'b; /// added for ADDI reg [:] state, netstate; reg pcwrite, pcwritecond; State Encodings... Opcodes... Local reg variables... Controller Parameters ain state machine NS logic Setting Control Signal Otpts // state if(reset) state <= FETCH; else state <= netstate; // net state logic (combinational) case(state) FETCH: netstate <= FETCH; FETCH: netstate <= FETCH; FETCH: netstate <= FETCH4; FETCH4: netstate <= DECODE; DECODE: case() LB: netstate <= EADR; SB: netstate <= EADR; ADDI: netstate <= EADR; RTYPE: netstate <= RTYPEEX; BEQ: netstate <= BEQEX; J: netstate <= JEX; // shold never happen defalt: netstate <= FETCH; EADR: case() LB: netstate <= LBRD; SB: netstate <= SBWR; ADDI: netstate <= ADDIWR; // shold never happen defalt: netstate <= FETCH; LBRD: netstate <= LBWR; LBWR: netstate <= FETCH; SBWR: netstate <= FETCH; RTYPEEX: netstate <= RTYPEWR; RTYPEWR: netstate <= FETCH; BEQEX: netstate <= FETCH; JEX: netstate <= FETCH; ADDIWR: netstate <= FETCH; // shold never happen defalt: netstate <= FETCH; // set all otpts to zero, then // conditionally assert jst the // apprriate ones irwrite <= 4'b; pcwrite <= ; pcwritecond <= ; regwrite <= ; regdst <= ; memread <= ; memwrite <= ; alsrca <= ; alsrcb <= 'b; al <= 'b; pcsorce <= 'b; iord <= ; memtoreg <= ; case(state) FETCH: memread <= ; irwrite <= 4'b; alsrcb <= 'b; pcwrite <= ; FETCH: memread <= ; irwrite <= 4'b; alsrcb <= 'b; pcwrite <= ; FETCH: memread <= ; irwrite <= 4'b; alsrcb <= 'b; pcwrite <= ; FETCH4: memread <= ; irwrite <= 4'b; alsrcb <= 'b; pcwrite <= ; DECODE: alsrcb <= 'b;...

4 modle alcontrol(inpt [:] al, inpt [5:] fnct, otpt reg [:] alcont); Verilog: alcontrol case(al) 'b: alcont <= 'b; // add for lb/sb/addi 'b: alcont <= 'b; // sb (for beq) defalt: case(fnct) // R-Type instrctions 'b: alcont <= 'b; // add (for add) 'b: alcont <= 'b; // sbtract (for sb) 'b: alcont <= 'b; // logical and (for and) 'b: alcont <= 'b; // logical or (for or) 'b: alcont <= 'b; // set on less (for slt) defalt: alcont <= 'b; // shold never happen modle al #(parameter WIDTH = ) (inpt [WIDTH-:] a, b, inpt [:] alcont, otpt reg [WIDTH-:] reslt); wire [WIDTH-:] b, sm, slt; Verilog: al assign b = alcont[]? ~b:b; assign sm = a + b + alcont[]; // slt shold be if most significant bit of sm is assign slt = sm[width-]; always@(*) case(alcont[:]) 'b: reslt <= a & b; 'b: reslt <= a b; 'b: reslt <= sm; 'b: reslt <= slt; Verilog: regfile modle regfile #(parameter WIDTH =, REGBITS = ) (inpt clk, inpt regwrite, inpt [REGBITS-:] ra, ra, wa, inpt [WIDTH-:] wd, otpt [WIDTH-:] rd, rd); reg [WIDTH-:] RA [(<<REGBITS)-:]; // three ported file // read two ports combinationally // write third port on rising edge of clock // hardwired to if (regwrite) RA[wa] <= wd; assign rd = ra? RA[ra] : ; assign rd = ra? RA[ra] : ; Verlog: Other stff modle zerodetect #(parameter WIDTH = ) (inpt [WIDTH-:] a, otpt y); assign y = (a==); modle fl #(parameter WIDTH = ) (inpt clk, inpt [WIDTH-:] d, otpt reg [WIDTH-:] q); q <= d; modle flen #(parameter WIDTH = ) (inpt clk, en, inpt [WIDTH-:] d, otpt reg [WIDTH-:] q); if (en) q <= d; modle flenr #(parameter WIDTH = ) (inpt clk, reset, en, inpt [WIDTH-:] d, otpt reg [WIDTH-:] q); if (reset) q <= ; else if (en) q <= d; modle m #(parameter WIDTH = ) (inpt [WIDTH-:] d, d, inpt s, otpt [WIDTH-:] y); assign y = s? d : d; modle m4 #(parameter WIDTH = ) (inpt [WIDTH-:] d, d, d, d, inpt [:] s, otpt reg [WIDTH-:] y); case(s) 'b: y <= d; 'b: y <= d; 'b: y <= d; 'b: y <= d; IPS icroarchitectre lticycle μarchitectre from Patterson & Hennessy PC PCEn Address emory emdata [:] [5 : ] [ : ] [5 : ] [7: ] emory Cond IorD em em emtoreg IR[:] [5: ] Otpts Control Op [5: ] PCSorce ALUOp ALUSrcB ALUSrcA Reg RegDst [5:] Shift left Registers A B ALU control Zero ALU ALU reslt ALUControl Jmp address ALUOt modle path #(parameter WIDTH =, REGBITS = ) (inpt clk, reset, inpt [WIDTH-:] mem, inpt alsrca, memtoreg, iord, pcen, regwrite, regdst, inpt [:] pcsorce, alsrcb, inpt [:] irwrite, inpt [:] alcont, otpt zero, otpt [:] instr, otpt [WIDTH-:] adr, write); // the size of the parameters mst be changed to match the WIDTH parameter localparam CONST_ZERO = 'b; localparam CONST_ONE = 'b; wire [REGBITS-:] ra, ra, wa; wire [WIDTH-:] pc, netpc, md, rd, rd, wd, a, src, src, alreslt, alot, const4; // shift left constant field by assign const4 = {instr[width-:],'b}; // file address fields assign ra = instr[regbits+:]; Verilog: Datapath assign ra = instr[regbits+5:]; m #(REGBITS) regm(instr[regbits+5:], instr[regbits+:], regdst, wa); [5: ] 4

5 // indepent of bit width, load instrction into for -bit s over for cycles flen #() ir(clk, irwrite[], mem[7:], instr[7:]); flen #() ir(clk, irwrite[], mem[7:], instr[5:]); flen #() ir(clk, irwrite[], mem[7:], instr[:]); flen #() ir(clk, irwrite[], mem[7:], instr[:4]); // path flenr #(WIDTH) pcreg(clk, reset, pcen, netpc, pc); fl #(WIDTH) areg(clk, rd, a); fl fl #(WIDTH) mdr(clk, mem, md); #(WIDTH) wrd(clk, rd, write); fl #(WIDTH) res(clk, alreslt, alot); Verilog: Datapath m #(WIDTH) adrm(pc, alot, iord, adr); m #(WIDTH) srcm(pc, a, alsrca, src); m4 #(WIDTH) srcm(write, CONST_ONE, instr[width-:], const4, alsrcb, src); m4 #(WIDTH) pcm(alreslt, alot, const4, CONST_ZERO, pcsorce, netpc); m #(WIDTH) wdm(alot, md, memtoreg, wd); regfile #(WIDTH,REGBITS) rf(clk, regwrite, ra, ra, wa, wd, rd, rd); al #(WIDTH) alnit(src, src, alcont, alreslt); zerodetect #(WIDTH) zd(alreslt, zero); Start at t level Logic Design Hierarchically decompose IPS into nits T-level interface crystal oscillator Clk reset memread memwrite IPS processor adr write mem eternal memory Verilog: ememory Verilog: ememory // eternal memory accessed by IPS modle ememory #(parameter WIDTH = ) (clk, memwrite, adr, write, mem); inpt clk; inpt memwrite; inpt [WIDTH-:] adr, write; otpt reg [WIDTH-:] mem; reg [:] RA [(<<WIDTH-)-:]; wire [:] word; initial $readmemh("memfile.dat",ra); // read and write bytes from -bit word if(memwrite) case (adr[:]) 'b: RA[adr>>][7:] <= write; 'b: RA[adr>>][5:] <= write; 'b: RA[adr>>][:] <= write; 'b: RA[adr>>][:4] <= write; assign word = RA[adr>>]; case (adr[:]) 'b: mem <= word[7:]; 'b: mem <= word[5:]; 'b: mem <= word[:]; 'b: mem <= word[:4]; // eternal memory accessed by IPS modle emem #(parameter WIDTH = ) (clk, memwrite, adr, write, mem); inpt inpt inpt otpt clk; memwrite; [WIDTH-:] adr, write; [WIDTH-:] mem; wire memwriteb, clkb; // UC RA has active low write enable... not(memwriteb, memwrite); // Looks like yo need to clock the memory early // to make it work with the crrent control... not(clkb, clk); // Instantiate the UC SPRA modle UCSPRA mips_ram (.CK(clkB),.CEN('b),.WEN(memwriteB),.OEN('b),.ADR(adr),.DI(write),.DOUT(mem)); Verilog: ememory Verilog: ememory Use makemem to generate memory Limited to 4 rows... Can bild it ot of mltiple SRAs SRA4 (for cies) Appro 454microns each... 5

6 Verilog: ememory Simlation model is the switch-level simlation of the Verilog strctral netlist Or yo cold write a behavioral model...

MIPS Architecture. An Example: MIPS. From the Harris/Weste book Based on the MIPS-like processor from the Hennessy/Patterson book

MIPS Architecture. An Example: MIPS. From the Harris/Weste book Based on the MIPS-like processor from the Hennessy/Patterson book An Eample: IPS From the Harris/Weste book Based on the IPS-like processor from the Hennessy/Patterson book IPS Architectre w Eample: sbset of IPS processor architectre n Drawn from Patterson & Hennessy

More information

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

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University Compter Architectre Chapter 5 Fall 25 Department of Compter Science Kent State University The Processor: Datapath & Control Or implementation of the MIPS is simplified memory-reference instrctions: lw,

More information

The final datapath. M u x. Add. 4 Add. Shift left 2. PCSrc. RegWrite. MemToR. MemWrite. Read data 1 I [25-21] Instruction. Read. register 1 Read.

The final datapath. M u x. Add. 4 Add. Shift left 2. PCSrc. RegWrite. MemToR. MemWrite. Read data 1 I [25-21] Instruction. Read. register 1 Read. The final path PC 4 Add Reg Shift left 2 Add PCSrc Instrction [3-] Instrction I [25-2] I [2-6] I [5 - ] register register 2 register 2 Registers ALU Zero Reslt ALUOp em Data emtor RegDst ALUSrc em I [5

More information

The single-cycle design from last time

The single-cycle design from last time lticycle path Last time we saw a single-cycle path and control nit for or simple IPS-based instrction set. A mlticycle processor fies some shortcomings in the single-cycle CPU. Faster instrctions are not

More information

The extra single-cycle adders

The extra single-cycle adders lticycle Datapath As an added bons, we can eliminate some of the etra hardware from the single-cycle path. We will restrict orselves to sing each fnctional nit once per cycle, jst like before. Bt since

More information

1048: Computer Organization

1048: Computer Organization 48: Compter Organization Lectre 5 Datapath and Control Lectre5A - simple implementation (cwli@twins.ee.nct.ed.tw) 5A- Introdction In this lectre, we will try to implement simplified IPS which contain emory

More information

1048: Computer Organization

1048: Computer Organization 48: Compter Organization Lectre 5 Datapath and Control Lectre5B - mlticycle implementation (cwli@twins.ee.nct.ed.tw) 5B- Recap: A Single-Cycle Processor PCSrc 4 Add Shift left 2 Add ALU reslt PC address

More information

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

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours. This exam is open book and open notes. You have 2 hours. Problems 1-4 refer to a proposed MIPS instruction lwu (load word - update) which implements update addressing an addressing mode that is used in

More information

Exceptions and interrupts

Exceptions and interrupts Eceptions and interrpts An eception or interrpt is an nepected event that reqires the CPU to pase or stop the crrent program. Eception handling is the hardware analog of error handling in software. Classes

More information

Lecture 2: MIPS Processor Example

Lecture 2: MIPS Processor Example Introduction to CMOS VLSI Design Lecture 2: MIPS Processor Example Outline Design Partitioning MIPS Processor Example Architecture t Microarchitecture Logic Design Circuit Design Physical Design Fabrication,

More information

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

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007 Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007 Final Exam This is a closed-book take-home exam. You are permitted a calculator and two 8.5x sheets of paper with notes. The exam

More information

Review Multicycle: What is Happening. Controlling The Multicycle Design

Review Multicycle: What is Happening. Controlling The Multicycle Design Review lticycle: What is Happening Reslt Zero Op SrcA SrcB Registers Reg Address emory em Data Sign etend Shift left Sorce A B Ot [-6] [5-] [-6] [5-] [5-] Instrction emory IR RegDst emtoreg IorD em em

More information

Introduction to CMOS VLSI Design Lecture 2: MIPS Processor Example

Introduction to CMOS VLSI Design Lecture 2: MIPS Processor Example Introduction to CMOS VLSI Design Lecture 2: MIPS Processor Example David Harris Harvey Mudd College Spring 2004 Outline Design Partitioning MIPS Processor Example Architecture Microarchitecture Logic Design

More information

CSE 2021 COMPUTER ORGANIZATION

CSE 2021 COMPUTER ORGANIZATION 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

More information

RISC Processor Design

RISC Processor Design RISC Processor Design Single Cycle Implementation - MIPS Virendra Singh Indian Institute of Science Bangalore virendra@computer.org Lecture 13 SE-273: Processor Design Feb 07, 2011 SE-273@SERC 1 Courtesy:

More information

Lecture 7. Building A Simple Processor

Lecture 7. Building A Simple Processor Lectre 7 Bilding A Simple Processor Christos Kozyrakis Stanford University http://eeclass.stanford.ed/ee8b C. Kozyrakis EE8b Lectre 7 Annoncements Upcoming deadlines Lab is de today Demo by 5pm, report

More information

LECTURE 6. Multi-Cycle Datapath and Control

LECTURE 6. Multi-Cycle Datapath and Control LECTURE 6 Multi-Cycle Datapath and Control SINGLE-CYCLE IMPLEMENTATION As we ve seen, single-cycle implementation, although easy to implement, could potentially be very inefficient. In single-cycle, we

More information

CMOS VLSI Design. MIPS Processor Example. Outline

CMOS VLSI Design. MIPS Processor Example. Outline COS VLSI Design IPS Processor Example Outline Design Partitioning IPS Processor Example Architecture icroarchitecture Logic Design Circuit Design Physical Design Fabrication, Packaging, Testing Slide 2

More information

Control Unit for Multiple Cycle Implementation

Control Unit for Multiple Cycle Implementation Control Unit for Multiple Cycle Implementation Control is more complex than in single cycle since: Need to define control signals for each step Need to know which step we are on Two methods for designing

More information

Digital Integrated Circuits Lecture 2: MIPS Processor Example

Digital Integrated Circuits Lecture 2: MIPS Processor Example Digital Integrated Circuits Lecture 2: MIPS Processor Example Chih-Wei Liu VLSI Signal Processing LAB National Chiao Tung University cwliu@twins.ee.nctu.edu.tw DIC-Lec2 cwliu@twins.ee.nctu.edu.tw 1 Outline

More information

Processor: Multi- Cycle Datapath & Control

Processor: Multi- Cycle Datapath & Control Processor: Multi- Cycle Datapath & Control (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann, 27) COURSE

More information

Review. A single-cycle MIPS processor

Review. A single-cycle MIPS processor Review If three instrctions have opcodes, 7 and 5 are they all of the same type? If we were to add an instrction to IPS of the form OD $t, $t2, $t3, which performs $t = $t2 OD $t3, what wold be its opcode?

More information

Digital Design and Computer Architecture Harris and Harris

Digital Design and Computer Architecture Harris and Harris Digital Design and Computer Architecture Harris and Harris Lab 0: Multicycle Processor (Part ) Introduction In this lab and the next, you will design and build your own multicycle MIPS processor. You will

More information

Digital Design and Computer Architecture

Digital Design and Computer Architecture Digital Design and Computer Architecture Lab 0: Multicycle Processor (Part ) Introduction In this lab and the next, you will design and build your own multicycle MIPS processor. You will be much more on

More information

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

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón ICS 152 Computer Systems Architecture Prof. Juan Luis Aragón Lecture 5 and 6 Multicycle Implementation Introduction to Microprogramming Readings: Sections 5.4 and 5.5 1 Review of Last Lecture We have seen

More information

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

ECE 313 Computer Organization FINAL EXAM December 11, Multicycle Processor Design 30 Points This exam is open book and open notes. Credit for problems requiring calculation will be given only if you show your work. 1. Multicycle Processor Design 0 Points In our discussion of exceptions in the

More information

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle Boris Grot School of Informatics University of Edinburgh Previous lecture: single-cycle processor Inf2C Computer Systems - 2017-2018. Boris

More information

CSE Introduction to Computer Architecture Chapter 5 The Processor: Datapath & Control

CSE Introduction to Computer Architecture Chapter 5 The Processor: Datapath & Control CSE-45432 Introdction to Compter Architectre Chapter 5 The Processor: Datapath & Control Dr. Izadi Data Processor Register # PC Address Registers ALU memory Register # Register # Address Data memory Data

More information

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

CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation Note that these questions are taken from the previous final exmas of CSE2021 and should serve as practice

More information

CPE 335. Basic MIPS Architecture Part II

CPE 335. Basic MIPS Architecture Part II CPE 335 Computer Organization Basic MIPS Architecture Part II Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE232 Basic MIPS Architecture

More information

Major CPU Design Steps

Major CPU Design Steps Datapath Major CPU Design Steps. Analyze instruction set operations using independent RTN ISA => RTN => datapath requirements. This provides the the required datapath components and how they are connected

More information

Points available Your marks Total 100

Points available Your marks Total 100 CSSE 3 Computer Architecture I Rose-Hulman Institute of Technology Computer Science and Software Engineering Department Exam Name: Section: 3 This exam is closed book. You are allowed to use the reference

More information

Lecture 6: Microprogrammed Multi Cycle Implementation. James C. Hoe Department of ECE Carnegie Mellon University

Lecture 6: Microprogrammed Multi Cycle Implementation. James C. Hoe Department of ECE Carnegie Mellon University 8 447 Lectre 6: icroprogrammed lti Cycle Implementation James C. Hoe Department of ECE Carnegie ellon University 8 447 S8 L06 S, James C. Hoe, CU/ECE/CALC, 208 Yor goal today Hosekeeping nderstand why

More information

PART I: Adding Instructions to the Datapath. (2 nd Edition):

PART I: Adding Instructions to the Datapath. (2 nd Edition): EE57 Instrctor: G. Pvvada ===================================================================== Homework #5b De: check on the blackboard =====================================================================

More information

Hardware Design Tips. Outline

Hardware Design Tips. Outline Hardware Design Tips EE 36 University of Hawaii EE 36 Fall 23 University of Hawaii Otline Verilog: some sbleties Simlators Test Benching Implementing the IPS Actally a simplified 6 bit version EE 36 Fall

More information

Lecture 4: MIPS Processor Example

Lecture 4: MIPS Processor Example Lecture 4: MIPS Processor Example Slides courtesy of Deming Chen Slides based on the initial set from David Harris CMOS VLSI Design Outline Design Partitioning MIPS Processor Example Architecture Microarchitecture

More information

Systems Architecture I

Systems Architecture I Systems Architecture I Topics A Simple Implementation of MIPS * A Multicycle Implementation of MIPS ** *This lecture was derived from material in the text (sec. 5.1-5.3). **This lecture was derived from

More information

CSE 2021 COMPUTER ORGANIZATION

CSE 2021 COMPUTER ORGANIZATION CSE 22 COMPUTER ORGANIZATION HUGH CHESSER CHESSER HUGH CSEB 2U 2U CSEB Agenda Topics:. Sample Exam/Quiz Q - Review 2. Multiple cycle implementation Patterson: Section 4.5 Reminder: Quiz #2 Next Wednesday

More information

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

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W10-M CSE 22 Computer Organization Hugh Chesser, CSEB 2U Agenda Topics:. ultiple cycle implementation - complete Patterson: Appendix C, D 2 Breaking the Execution into Clock Cycles Execution of each instruction

More information

RISC Architecture: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation RISC Architecture: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay

More information

CC 311- Computer Architecture. The Processor - Control

CC 311- Computer Architecture. The Processor - Control CC 311- Computer Architecture The Processor - Control Control Unit Functions: Instruction code Control Unit Control Signals Select operations to be performed (ALU, read/write, etc.) Control data flow (multiplexor

More information

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

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction Multi-cycle Approach Single cycle CPU State element Combinational logic State element clock one clock cycle or instruction Multi-cycle CPU Requires state elements to hold intermediate values State Element

More information

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

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions COP33 - Computer Architecture Lecture ulti-cycle Design & Exceptions Single Cycle Datapath We designed a processor that requires one cycle per instruction RegDst busw 32 Clk RegWr Rd ux imm6 Rt 5 5 Rs

More information

Lecture 9: Microcontrolled Multi-Cycle Implementations

Lecture 9: Microcontrolled Multi-Cycle Implementations 8-447 Lectre 9: icroled lti-cycle Implementations James C. Hoe Dept of ECE, CU Febrary 8, 29 S 9 L9- Annoncements: P&H Appendi D Get started t on Lab Handots: Handot #8: Project (on Blackboard) Single-Cycle

More information

Computer Architecture

Computer Architecture Compter Architectre Lectre 4: Intro to icroarchitectre: Single- Cycle Dr. Ahmed Sallam Sez Canal University Based on original slides by Prof. Onr tl Review Compter Architectre Today and Basics (Lectres

More information

RISC Architecture: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation RISC Architecture: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay

More information

Computer Architecture

Computer Architecture Compter Architectre Lectre 4: Intro to icroarchitectre: Single- Cycle Dr. Ahmed Sallam Sez Canal University Spring 25 Based on original slides by Prof. Onr tl Review Compter Architectre Today and Basics

More information

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.

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. V DD A B C D.6 DESIGN PARTITIONING 35 Example Sketch a stick diagram for a CMOS gate computing Y = (A + B + C) D (see Figure.8) and estimate the cell width and height. Solution: Figure.47shows a stick

More information

ENE 334 Microprocessors

ENE 334 Microprocessors ENE 334 Microprocessors Lecture 6: Datapath and Control : Dejwoot KHAWPARISUTH Adapted from Computer Organization and Design, 3 th & 4 th Edition, Patterson & Hennessy, 2005/2008, Elsevier (MK) http://webstaff.kmutt.ac.th/~dejwoot.kha/

More information

ECE369. Chapter 5 ECE369

ECE369. Chapter 5 ECE369 Chapter 5 1 State Elements Unclocked vs. Clocked Clocks used in synchronous logic Clocks are needed in sequential logic to decide when an element that contains state should be updated. State element 1

More information

Review: Computer Organization

Review: Computer Organization Review: Compter Organization Pipelining Chans Y Landry Eample Landry Eample Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 3 mintes A B C D Dryer takes 3 mintes

More information

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

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control معماري كامپيوتر پيشرفته معماري MIPS data path and control abbasi@basu.ac.ir Topics Building a datapath support a subset of the MIPS-I instruction-set A single cycle processor datapath all instruction actions

More information

Review. How to represent real numbers

Review. How to represent real numbers PCWrite PC IorD Review ALUSrcA emread Address Write data emory emwrite em Data IRWrite [3-26] [25-2] [2-6] [5-] [5-] RegDst Read register Read register 2 Write register Write data RegWrite Read data Read

More information

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

ECE 3056: Architecture, Concurrency and Energy of Computation. Single and Multi-Cycle Datapaths: Practice Problems ECE 3056: Architecture, Concurrency and Energy of Computation Single and Multi-Cycle Datapaths: Practice Problems 1. Consider the single cycle SPIM datapath. a. Specify the values of the control signals

More information

EEC 483 Computer Organization

EEC 483 Computer Organization EEC 483 Compter Organization Chapter 4.4 A Simple Implementation Scheme Chans Y The Big Pictre The Five Classic Components of a Compter Processor Control emory Inpt path Otpt path & Control 2 path and

More information

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

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath COMP33 - Computer Architecture Lecture 8 Designing a Single Cycle Datapath The Big Picture The Five Classic Components of a Computer Processor Input Control Memory Datapath Output The Big Picture: The

More information

The multicycle datapath. Lecture 10 (Wed 10/15/2008) Finite-state machine for the control unit. Implementing the FSM

The multicycle datapath. Lecture 10 (Wed 10/15/2008) Finite-state machine for the control unit. Implementing the FSM Lectre (Wed /5/28) Lab # Hardware De Fri Oct 7 HW #2 IPS programming, de Wed Oct 22 idterm Fri Oct 2 IorD The mlticycle path SrcA Today s objectives: icroprogramming Etending the mlti-cycle path lti-cycle

More information

Quiz #1 EEC 483, Spring 2019

Quiz #1 EEC 483, Spring 2019 Qiz # EEC 483, Spring 29 Date: Jan 22 Name: Eercise #: Translate the following instrction in C into IPS code. Eercise #2: Translate the following instrction in C into IPS code. Hint: operand C is stored

More information

Topic #6. Processor Design

Topic #6. Processor Design Topic #6 Processor Design Major Goals! To present the single-cycle implementation and to develop the student's understanding of combinational and clocked sequential circuits and the relationship between

More information

Chapter 5: The Processor: Datapath and Control

Chapter 5: The Processor: Datapath and Control Chapter 5: The Processor: Datapath and Control Overview Logic Design Conventions Building a Datapath and Control Unit Different Implementations of MIPS instruction set A simple implementation of a processor

More information

ECE 313 Computer Organization Name SOLUTION EXAM 2 November 3, Floating Point 20 Points

ECE 313 Computer Organization Name SOLUTION EXAM 2 November 3, Floating Point 20 Points ECE Computer Organization Name SOLTION EA November, This exam is open book and open notes. Credit for problems requiring calculation will be given only if you show your work.. Floating Point Points Translate

More information

RISC Design: Multi-Cycle Implementation

RISC Design: Multi-Cycle Implementation RISC Design: Multi-Cycle Implementation Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay http://www.ee.iitb.ac.in/~viren/

More information

CS 251, Winter 2019, Assignment % of course mark

CS 251, Winter 2019, Assignment % of course mark CS 25, Winter 29, Assignment.. 3% of corse mark De Wednesday, arch 3th, 5:3P Lates accepted ntil Thrsday arch th, pm with a 5% penalty. (7 points) In the diagram below, the mlticycle compter from the corse

More information

Quick Verilog. Levels of Design Modeling

Quick Verilog. Levels of Design Modeling Introduction to CMOS VLSI Design Quick Lecture by Peter Kogge Fall 29, 2, 22, 25, 28 University of Notre Dame Using some slides by Jay Brockman Notre Dame 28, and David Harris, Harvey Mudd College http://www.cmosvlsi.com/coursematerials.html

More information

Instruction fetch. MemRead. IRWrite ALUSrcB = 01. ALUOp = 00. PCWrite. PCSource = 00. ALUSrcB = 00. R-type completion

Instruction fetch. MemRead. IRWrite ALUSrcB = 01. ALUOp = 00. PCWrite. PCSource = 00. ALUSrcB = 00. R-type completion . (Chapter 5) Fill in the vales for SrcA, SrcB, IorD, Dst and emto to complete the Finite State achine for the mlti-cycle datapath shown below. emory address comptation 2 SrcA = SrcB = Op = fetch em SrcA

More information

ECE 313 Computer Organization EXAM 2 November 9, 2001

ECE 313 Computer Organization EXAM 2 November 9, 2001 ECE 33 Computer Organization EA 2 November 9, 2 This exam is open book and open notes. You have 5 minutes. Credit for problems requiring calculation will be given only if you show your work. Choose and

More information

The Processor: Datapath & Control

The Processor: Datapath & Control Chapter Five 1 The Processor: Datapath & Control We're ready to look at an implementation of the MIPS Simplified to contain only: memory-reference instructions: lw, sw arithmetic-logical instructions:

More information

Comp 303 Computer Architecture A Pipelined Datapath Control. Lecture 13

Comp 303 Computer Architecture A Pipelined Datapath Control. Lecture 13 Comp 33 Compter Architectre A Pipelined path Lectre 3 Pipelined path with Signals PCSrc IF/ ID ID/ EX EX / E E / Add PC 4 Address Instrction emory RegWr ra rb rw Registers bsw [5-] [2-6] [5-] bsa bsb Sign

More information

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

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR Microprogramming Exceptions and interrupts 9 CMPE Fall 26 A. Di Blas Fall 26 CMPE CPU Multicycle From single-cycle to Multicycle CPU with sequential control: Finite State Machine Textbook Edition: 5.4,

More information

PS Midterm 2. Pipelining

PS Midterm 2. Pipelining PS idterm 2 Pipelining Seqential Landry 6 P 7 8 9 idnight Time T a s k O r d e r A B C D 3 4 2 3 4 2 3 4 2 3 4 2 Seqential landry takes 6 hors for 4 loads If they learned pipelining, how long wold landry

More information

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

Using a Hardware Description Language to Design and Simulate a Processor 5.8 5.8 Using a Hardware Description Language to Design and Simulate a Processor 5.8 As mentioned in Appix B, Verilog can describe processors for simulation or with the intention that the Verilog specification

More information

Processor (I) - datapath & control. Hwansoo Han

Processor (I) - datapath & control. Hwansoo Han Processor (I) - datapath & control Hwansoo Han Introduction CPU performance factors Instruction count - Determined by ISA and compiler CPI and Cycle time - Determined by CPU hardware We will examine two

More information

What do we have so far? Multi-Cycle Datapath

What do we have so far? Multi-Cycle Datapath What do we have so far? lti-cycle Datapath CPI: R-Type = 4, Load = 5, Store 4, Branch = 3 Only one instrction being processed in datapath How to lower CPI frther? #1 Lec # 8 Spring2 4-11-2 Pipelining pipelining

More information

Final Project: MIPS-like Microprocessor

Final Project: MIPS-like Microprocessor Final Project: MIPS-like Microprocessor Objective: The objective of this project is to design, simulate, and implement a simple 32-bit microprocessor with an instruction set that is similar to a MIPS.

More information

EEC 483 Computer Organization

EEC 483 Computer Organization EEC 83 Compter Organization Chapter.6 A Pipelined path Chans Y Pipelined Approach 2 - Cycle time, No. stages - Resorce conflict E E A B C D 3 E E 5 E 2 3 5 2 6 7 8 9 c.y9@csohio.ed Resorces sed in 5 Stages

More information

CS 251, Winter 2018, Assignment % of course mark

CS 251, Winter 2018, Assignment % of course mark CS 25, Winter 28, Assignment 4.. 3% of corse mark De Wednesday, arch 7th, 4:3P Lates accepted ntil Thrsday arch 8th, am with a 5% penalty. (6 points) In the diagram below, the mlticycle compter from the

More information

4.13 Advanced Topic: An Introduction to Digital Design Using a Hardware Design Language 345.e1

4.13 Advanced Topic: An Introduction to Digital Design Using a Hardware Design Language 345.e1 .3 Advanced Topic: An Introdction to Digital Design Using a Hardware Design Langage 35.e.3 Advanced Topic: An Introdction to Digital Design Using a Hardware Design Langage to Describe and odel a Pipeline

More information

Chapter 5 Solutions: For More Practice

Chapter 5 Solutions: For More Practice Chapter 5 Solutions: For More Practice 1 Chapter 5 Solutions: For More Practice 5.4 Fetching, reading registers, and writing the destination register takes a total of 300ps for both floating point add/subtract

More information

1048: Computer Organization

1048: Computer Organization 8: Compter Organization Lectre 6 Pipelining Lectre6 - pipelining (cwli@twins.ee.nct.ed.tw) 6- Otline An overview of pipelining A pipelined path Pipelined control Data hazards and forwarding Data hazards

More information

Multiple Cycle Data Path

Multiple Cycle Data Path Multiple Cycle Data Path CS 365 Lecture 7 Prof. Yih Huang CS365 1 Multicycle Approach Break up the instructions into steps, each step takes a cycle balance the amount of work to be done restrict each cycle

More information

CS232 Final Exam May 5, 2001

CS232 Final Exam May 5, 2001 CS232 Final Exam May 5, 2 Name: This exam has 4 pages, including this cover. There are six questions, worth a total of 5 points. You have 3 hours. Budget your time! Write clearly and show your work. State

More information

Lab 8 (All Sections) Prelab: ALU and ALU Control

Lab 8 (All Sections) Prelab: ALU and ALU Control Lab 8 (All Sections) Prelab: and Control Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received nathorized aid on this academic work Objective In this lab yo will

More information

COMP303 Computer Architecture Lecture 9. Single Cycle Control

COMP303 Computer Architecture Lecture 9. Single Cycle Control COMP33 Computer Architecture Lecture 9 Single Cycle Control A Single Cycle Datapath We have everything except control signals (underlined) RegDst busw Today s lecture will look at how to generate the control

More information

Pipelining. Chapter 4

Pipelining. Chapter 4 Pipelining Chapter 4 ake processor rns faster Pipelining is an implementation techniqe in which mltiple instrctions are overlapped in eection Key of making processor fast Pipelining Single cycle path we

More information

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

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control ELEC 52/62 Computer Architecture and Design Spring 217 Lecture 4: Datapath and Control Ujjwal Guin, Assistant Professor Department of Electrical and Computer Engineering Auburn University, Auburn, AL 36849

More information

Mapping Control to Hardware

Mapping Control to Hardware C A P P E N D I X A custom format such as this is slave to the architecture of the hardware and the instruction set it serves. The format must strike a proper compromise between ROM size, ROM-output decoding,

More information

Lab 8: Multicycle Processor (Part 1) 0.0

Lab 8: Multicycle Processor (Part 1) 0.0 Lab 8: ulticycle Processor (Part ). Introduction In this lab and the next, you will design and build your own multicycle IPS processor! Your processor should match the design from the text reprinted below

More information

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization CS/COE0447: Computer Organization and Assembly Language Datapath and Control Sangyeun Cho Dept. of Computer Science A simple MIPS We will design a simple MIPS processor that supports a small instruction

More information

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization A simple MIPS CS/COE447: Computer Organization and Assembly Language Datapath and Control Sangyeun Cho Dept. of Computer Science We will design a simple MIPS processor that supports a small instruction

More information

EECE 417 Computer Systems Architecture

EECE 417 Computer Systems Architecture EECE 417 Computer Systems Architecture Department of Electrical and Computer Engineering Howard University Charles Kim Spring 2007 1 Computer Organization and Design (3 rd Ed) -The Hardware/Software Interface

More information

Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design

Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design Harris Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design The controller for your MIPS processor is responsible for generating the signals to the datapath to fetch and execute each instruction.

More information

CENG 3420 Lecture 06: Datapath

CENG 3420 Lecture 06: Datapath CENG 342 Lecture 6: Datapath Bei Yu byu@cse.cuhk.edu.hk CENG342 L6. Spring 27 The Processor: Datapath & Control q We're ready to look at an implementation of the MIPS q Simplified to contain only: memory-reference

More information

LECTURE 5. Single-Cycle Datapath and Control

LECTURE 5. Single-Cycle Datapath and Control LECTURE 5 Single-Cycle Datapath and Control PROCESSORS In lecture 1, we reminded ourselves that the datapath and control are the two components that come together to be collectively known as the processor.

More information

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

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface Chapter 4 The Processor: A Based on P&H Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined

More information

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

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu CENG 342 Computer Organization and Design Lecture 6: MIPS Processor - I Bei Yu CEG342 L6. Spring 26 The Processor: Datapath & Control q We're ready to look at an implementation of the MIPS q Simplified

More information

Systems Architecture

Systems Architecture Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some or all figures from Computer Organization and Design: The Hardware/Software

More information

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

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19 CO2-3224 Computer Architecture and Programming Languages CAPL Lecture 8 & 9 Dr. Kinga Lipskoch Fall 27 Single Cycle Disadvantages & Advantages Uses the clock cycle inefficiently the clock cycle must be

More information

CSSE232 Computer Architecture I. Mul5cycle Datapath

CSSE232 Computer Architecture I. Mul5cycle Datapath CSSE232 Compter Architectre I Ml5cycle Datapath Class Stats Next 3 days : Ml5cycle datapath ing Ml5cycle datapath is not in the book! How long do instrc5ons take? ALU 2ns Mem 2ns Reg File 1ns Everything

More information

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

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination May 23, 2014 Name: Email: Student ID: Lab Section Number: Instructions: 1. This

More information

CS 251, Spring 2018, Assignment 3.0 3% of course mark

CS 251, Spring 2018, Assignment 3.0 3% of course mark CS 25, Spring 28, Assignment 3. 3% of corse mark De onday, Jne 25th, 5:3 P. (5 points) Consider the single-cycle compter shown on page 6 of this assignment. Sppose the circit elements take the following

More information