EECS 322 Sample Test 2 Solutions Wednesday March 21, 2001 Problem 1 (50%): A group of EECS students have decided to compete with Intel Corporation in the.

Slides:



Advertisements
Similar presentations
1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
Advertisements

Microprocessor Design Multi-cycle Datapath Nia S. Bradley Vijay.
{ CPU Design-Project CPU Design-Project Multicycle Datapath with Finite State Machine as Control Unit N.S.V Ravi Tej Uppu.
1 Chapter Five The Processor: Datapath and Control.
The Processor Data Path & Control Chapter 5 Part 2 - Multi-Clock Cycle Design N. Guydosh 2/29/04.
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
EECE476 Lecture 9: Multi-cycle CPU Datapath Chapter 5: Section 5.5 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
CSE378 Multicycle impl,.1 Drawbacks of single cycle implementation All instructions take the same time although –some instructions are longer than others;
1 5.5 A Multicycle Implementation A single memory unit is used for both instructions and data. There is a single ALU, rather than an ALU and two adders.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 TopicI: Building a Multicycle Data Path and a Control Path for a Microprocessor.
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
©UCB CS 161Computer Architecture Chapter 5 Lecture 11 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
EECE476 Lectures 10: Multi-cycle CPU Control Chapter 5: Section 5.5 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
Preparation for Midterm Binary Data Storage (integer, char, float pt) and Operations, Logic, Flip Flops, Switch Debouncing, Timing, Synchronous / Asynchronous.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
Spring W :332:331 Computer Architecture and Assembly Language Spring 2005 Week 11 Introduction to Pipelined Datapath [Adapted from Dave Patterson’s.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
CMPE 421 Advanced Computer Architecture Supplementary material for Pipelining PART1.
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
C HAPTER 5 T HE PROCESSOR : D ATAPATH AND C ONTROL M ULTICYCLE D ESIGN.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
Multicycle Implementation
IT 251 Computer Organization and Architecture Multi Cycle CPU Datapath Chia-Chi Teng.
LECTURE 6 Multi-Cycle Datapath and Control. SINGLE-CYCLE IMPLEMENTATION As we’ve seen, single-cycle implementation, although easy to implement, could.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Fall 2015, Sep ELEC / Lecture 5 1 ELEC / Computer Architecture and Design Fall 2015 Datapath and Control (Chapter.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
RegDst 1: RegFile destination No. for the WR Reg. comes from rd field. 0: RegFile destination No. for the WR Reg. comes from rt field.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 10: Control Design
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 7: Multicycle CPU Instructor: Francis G. Wolff Case Western Reserve University.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
1 The final datapath. 2 Control  The control unit is responsible for setting all the control signals so that each instruction is executed properly. —The.
EECS 322 Test 3 SolutionsWednesday March 22, 2000 Problem 1 (50%): A group of EECS students have decided to compete with Intel Corporation in the microcontroller.
Design a MIPS Processor (II)
CSE 331 Computer Organization and Design Fall 2007 Week 10 & 11
Multi-Cycle Datapath and Control
Chapter 5: A Multi-Cycle CPU.
IT 251 Computer Organization and Architecture
ECE/CS 552: Multicycle Data Path
Systems Architecture I
Multi-Cycle CPU.
Extensions to the Multicycle CPU
Single Cycle Processor
D.4 Finite State Diagram for the Multi-cycle processor
Multi-Cycle CPU.
Basic MIPS Architecture
The Multicycle Implementation
Vishwani D. Agrawal James J. Danaher Professor
Computer Organization Ellen Walker Hiram College
Chapter Five The Processor: Datapath and Control
Drawbacks of single cycle implementation
CSE378 Midterm Review Moore’s Law -- What are the two versions?
The Multicycle Implementation
Systems Architecture I
Vishwani D. Agrawal James J. Danaher Professor
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Chapter Four The Processor: Datapath and Control
Control Unit for Multiple Cycle Implementation
5.5 A Multicycle Implementation
Processor Design Datapath and Design.
Systems Architecture I
Control Unit for Multiple Cycle Implementation
FloorPlan for Multicycle MIPS
Presentation transcript:

EECS 322 Sample Test 2 Solutions Wednesday March 21, 2001 Problem 1 (50%): A group of EECS students have decided to compete with Intel Corporation in the microcontroller market. Their first prototype called the RISCEE1 computer is a 16 bit single-cycle computer build in a secret lab in Olin building. The all 16 registers, pc, and alu are eight bits wide. Register zero (r0) contains only a zero and cannot be overwritten. There is only one instruction format shown as follows: The delay time of the functional units are as follows Memory Write 5 ns, Memory Read 3 ns, Register (read or write) 2 ns, and ALU & Adders 2 ns. Opcode 4 bits Register 4 bits 11-8 Data or Address field 8 bits 7-0

PCPC PCPC Read address Instruction [15-0] Instruction Memory Read address Instruction [15-0] Instruction Memory Read Read Register Data Write Register Write Data Read Read Register Data Write Register Write Data ALU3 address Write Data Read Data address Write Data Read Data ADD1 ADD2 2 MemWrite RegDst RegWrite Instruction[7-0] Instruction[11-8] P0 BZ RISCEE 1 Architecture A=1 X-Y 2 X+Y 3 X Y Y X Zero

(a, 10%) Fill in the settings of the control lines determined by the all the instructions (use X for Don’t Care) Instruction addi reg, data8 subi reg, data8 load reg, address8 store reg, address8 beq reg, address8 jmp address8 jal reg, address8 Operation reg = reg + data8 reg = reg - data8 reg = Memory[address8] Memory[address8]=reg if(reg==0) {pc=pc+2+address8} pc=address8 reg=pc+2; pc=address8 RegDst X X X 0 A X X MemWrite RegWrite BZ P (b, 10%) Write “fail” for instructions that will stuck-at-fault for RegDst Instruction addi reg, data8 subi reg, data8 load reg, address8 store reg, address8 beq reg, address8 jmp address8 jal reg, address8 Stuck-at-0 fail Stuck-at-1 fail

(c, 10%) Fill in the critical path times for each instruction InstructionInstruction memory Register Read ALU operation Data Memory Register Write Total Time Clock Cycles addi load store subi 3 ns 2 ns 3 ns 5 ns 2 ns 9 ns 10 ns 12 ns beq3 ns2 ns 7 ns1 jmp3 ns 1 jal3 ns 2 ns5 ns1

(d, 10%) Fill in the Clock, CPI, and MIPS in the above table and show all calculations (Hint, single-cycle computer). Clock speed 83.3 Mhz CPI1 MIPS83.3 MIPS = 1*0.40+1*0.0+1*0.25+1*0.10+1*0.25+1*0+1*0 = 83.3 Mhz/1 = 1/12ns=83.3 Mhs Clock speed is the slowest instruction (e, 10%) Using the RISCEE1 instruction set, show how to swap two registers r1 and r2 (hint, use memory). Pick any 2 memory addresses, say, 100 and 102 storer1, 100 storer2, 102 loadr1,102 loadr2,100

Problem 2 (50%): The brokerage firm said they talked to their investors and said they will only invest in multi-cycle computers. Furthermore, CPU Benchmarks showed that the subi, jmp, and jal instructions are not used. The multi-cycle version is called RISCEE 2. (a, 20%) Draw the finite state machine for RISCEE instructions (addi, load, store, beq). (b, 5%)Place next to each state the amount of to process each state. see next page

PCPC PCPC address Read Data Write Data address Read Data Write Data Read Read Register Data Write Register Write Data Read Read Register Data Write Register Write Data ALU ALU Out MemWrite RegDst RegWrite 1 0 Instruction[7-0] Instruction[11-8] RISCEE 2 Architecture A A MDR I R ALUSrcA ALUSrcB Instruction[7-0] PCsource Pcwrite+(AluZero*PCwriteCond) IorD MemRead IRWrite ALUop= 1 X-Y 2 X+Y 3 X Y Y X

MemRead=1, MemWrite=0 IorD=1 (MemAddr  PC) IRWrite=1 (IR  Mem) ALUSrcA=0 (2) ALUSrcB=0 (PC) ALUOP=2 (PC  2+PC) PCWrite=1, PCSource=1 (ALU) RegWrite=0, RegDst=X, MemRead=0, MemWrite=0 IorD=X IRWrite=0 ALUSrcA=1 (IR[7-0]) ALUSrcB=0 (PC) ALUOP=2 (PC  IR[7-0]+PC) PCWrite=0, PCSource=X RegWrite=0, RegDst=X, MemRead=1, MemWrite=0 IorD=0 (ALUOut) IRWrite=0 ALUSrcA=X ALUSrcB=X ALUOP=X PCWrite=0, PCSource=X RegWrite=0, RegDst=X, MemRead=0, MemWrite=0 IorD=X IRWrite=0 ALUSrcA=X ALUSrcB=X ALUOP=X PCWrite=0, PCSource=X RegWrite=1, RegDst=1 (MDR) MemRead=0, MemWrite=1 IorD=0 (ALUOut) IRWrite=0 ALUSrcA=X ALUSrcB=X ALUOP=X PCWrite=0, PCSource=X RegWrite=0, RegDst=X, MemRead=0, MemWrite=0 IorD=X IRWrite=0 ALUSrcA=1 (IR[7-0]) ALUSrcB=X ALUOP=3 (X+0) PCWrite=0, PCSource=X RegWrite=0, RegDst=X, MemRead=0, MemWrite=0 IorD=X IRWrite=0 ALUSrcA=2 (A) ALUSrcB=1 (IR[7-0]) ALUOP=2 (A+IR[7-0]) PCWrite=0, PCSource=X RegWrite=0, RegDst=X, MemRead=0, MemWrite=0 IorD=X IRWrite=0 ALUSrcA=X ALUSrcB=X ALUOP=X PCWrite=0, PCSource=X RegWrite=1,RegDst=0(Aluout) MemRead=0, MemWrite=0 IorD=X IRWrite=0 ALUSrcA=1 (IR[7-0]) ALUSrcB=0 (PC) ALUOP=2 (PC  IR[7-0]+PC) PCWrite=1, PCSource=0 or 1 RegWrite=0, RegDst=X, PCwriteCond=1 op=‘LW’ op=‘SW’ op=‘ADDI’ op=‘BEQ’ op=‘LW’ or ‘SW’ Start Instruction Fettch Instr. Decode & Register FetchBranch Completion Memory Access - Read R-type completionMemory Access - Write (1) 2ns (0) 3ns (8) 2ns (2) 2 ns (6) 2 ns (7) 2ns (5) 5 ns (3) 3ns (4) 2ns (State) Time ns

InstructionInstruction memory Register Read ALU operation Data Memory Register Write Total Time Clock Cycles addi store beq load 3 ns 2 ns 2 (c, 5%) Fill in critical path times for each instruction (copy delay times from part b). 3 ns 5 ns 2 ns 9 ns 12 ns 7 ns (d, 5%) Determine the fastest clock speed for the computer to work properly in frequency and show why. Clock period is the slowest resource in any one step: 5 ns Clock frequency = 1/period = 1/5ns = 200 Mhz

InstructionClock Cycles Instruction Mix addi store beq load % 25% 10% 25% 2 (d, 10%) Fill in the Clock, CPI, and MIPS in the above table and show all calculations. Clock speed 200 Mhz CPI4 MIPS50 MIPS = 4*0.40+5*0.25+4*0.10+3*0.25 = 200 Mhz/4

2 (f, 5%) Suppose you do not know the instruction mix. Explain which one functional unit (Memory write 5ns, Memory Read 3ns, Register 2ns, ALU 2ns) would you chose to improve by 1 ns and what will be the new clock speed? (show calculations) The clock period is determined by the slowest resource at any one stage,which is in this case the memory write speed of 5ns. Therefor improving the memory write from 5ns to 4ns will change the clock speed from 1/5ns (=200Mhz) to 1/4ns (=250Mhz).

Extra Credit b) Give the two’s complement of the 8 bit binary 0x12 First convert hex to binary: Then do a 1’s complement: Then add one: c) Convert  25 into a 8 bit binary. First convert +25 = Then do a 1’s complement: Then add one: Double check:  = 25

d) Convert the 5 bit signed binary into decimal For a signed number, the highest bit is a negative power Line up the bits: Then decimal is:-16+2 = -14 e) Add 0x2 and 0xF and what is the overflow bit. Cin Sum0001 Cout111 OV = 1^1 = 0

f) Multiply the 3 bit signed numbers 010 by 110 into a 6 bit signed number. First sign extend any negative numbers (only care about last 6 bits) Double check: 010 x 110 = 2 x -2 Double check product: is = -4