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

Similar documents
Processor: Multi- Cycle Datapath & Control

CSE 2021 COMPUTER ORGANIZATION

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

CSE 2021 COMPUTER ORGANIZATION

LECTURE 6. Multi-Cycle Datapath and Control

Points available Your marks Total 100

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

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

CPE 335. Basic MIPS Architecture Part II

Chapter 5 Solutions: For More Practice

Control Unit for Multiple Cycle Implementation

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

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Systems Architecture I

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

Topic #6. Processor Design

CC 311- Computer Architecture. The Processor - Control

Multiple Cycle Data Path

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

RISC Processor Design

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

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

Chapter 5: The Processor: Datapath and Control

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

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

ECE369. Chapter 5 ECE369

The Processor: Datapath & Control

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

RISC Architecture: Multi-Cycle Implementation

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

RISC Architecture: Multi-Cycle Implementation

Major CPU Design Steps

Microprogramming. Microprogramming

EECE 417 Computer Systems Architecture

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

Mapping Control to Hardware

CS232 Final Exam May 5, 2001

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

Lab 8: Multicycle Processor (Part 1) 0.0

Multicycle Approach. Designing MIPS Processor

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

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

Final Project: MIPS-like Microprocessor

Processor (multi-cycle)

ENE 334 Microprocessors

Single vs. Multi-cycle Implementation

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

ECE 30, Lab #8 Spring 2014

RISC Design: Multi-Cycle Implementation

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Chapter 4 The Processor (Part 2)

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

Lets Build a Processor

Winter 2002 FINAL EXAMINATION

ECE 313 Computer Organization EXAM 2 November 9, 2001

Winter 2006 FINAL EXAMINATION Auxiliary Gymnasium Tuesday, April 18 7:00pm to 10:00pm

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

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

For More Practice FMP

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.

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

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

CS232 Final Exam May 5, 2001

Lecture 5: The Processor

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

Computer Science 141 Computing Hardware

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

Design of the MIPS Processor (contd)

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

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

LECTURE 5. Single-Cycle Datapath and Control

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

Systems Architecture

Design of the MIPS Processor

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

Lecture 2: MIPS Processor Example

ECE 313 Computer Organization EXAM 2 November 11, 2000

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

Week 6: Processor Components

Processor (I) - datapath & control. Hwansoo Han

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

Introduction to CMOS VLSI Design Lecture 2: MIPS Processor Example

CMOS VLSI Design. MIPS Processor Example. Outline

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

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

Very short answer questions. You must use 10 or fewer words. "True" and "False" are considered very short answers.

Digital Integrated Circuits Lecture 2: MIPS Processor Example

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

Multicycle conclusion

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

Review: Abstract Implementation View

Quick Verilog. Levels of Design Modeling

CSEN 601: Computer System Architecture Summer 2014

Midterm. Sticker winners: if you got >= 50 / 67

Lecture 4: MIPS Processor Example

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

Laboratory 5 Processor Datapath

COMP2611: Computer Organization. The Pipelined Processor

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

Transcription:

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 questions for multicycle implementation section of the final exam. Question 1 A. We have to modify the existing datapath so that PC + 4 can be written to register 31 (corresponding to $ra) while PC is written with the new jump address. To accomplish this, we expand 1. The multiplexor for RegDst to include 31 as an additional input. With three inputs to the multiplexor, control RegDst should be expanded to 2 bits. To select 31 as the input, we assume that RegDst = 10. 2. The multiplexor for MemtoReg to include PC + 4 as an additional input. With three inputs to the multiplexor, control MemtoReg is expanded to 2 bits. To select PC + 4, we set MemtoReg = 10. The execution steps for the jal instruction are: Step 1: Instruction Fetch: remains unchanged Step 2 Instruction Decode and Register Fetch: remains unchanged Step 3 Execution, Memory Address Computation, Branch, Jump or Jump and Link Completion: jal: Reg[31] = PC + 4; PC = PC[31-28] ( IR[25-0] << 2 ); The datapath for the jal instruction is shown using the bold lines in figure A2.1. B. A new state 10 is added from state 1, such that state 1 state 10 state 0 The control values for this new state are PCWrite, PCSource = 10, RegDst = 10, MemtoReg = 10, and RegWrite. Since RegDst and MemtoReg are now 2 bits, their corresponding values in the other states have to change as well to reflect this enhancement. We show the changes in fig. A3.2 using shaded blocks. C. Based on our result in part (b), the jal instruction will take 3 cycles (state 0 state 1 state 10 state 0). 1

Figure A3.1: Datpath for the jal instruction. Note that the RegDst Multiplexer and MemtoReg multiplexer have been modified to include three inputs. The control lines RegDst and MemtoReg are therefore 2-bit buses. 2

Fig. A3.2: Finite State Machine diagram that includes the jal instruction. States 4 and 7 are modified as RegDst and MemtoReg are 2-bit controls. State 10 is added as an additional state for the jal instruction. 3

Question 2: A. In Fig. 5.38, the states involved in executing beq are states 0, 1, and 8. If we look at states 0, 1 and 8 on the fig. 5.38, we can write out the control signals as seen in each state. Any control signal not mentioned will be deasserted. In state 0, the states asked for have the following values: ALUSrcA = 0, IRWrite is asserted, ALUOp = 00, IorD = 0, and PCSource = 00. The other states set are: ALUSrcB=01, MemRead asserted, PCWrite asserted In state 1, the states asked for have the following values: ALUSrcA = 0, ALUOp = 00, IRWrite is deasserted as are the other signals not shown in the state circle IorD = 0, and PCSource = 00. In state 8, the states asked for have the following values: ALUSrcA = 1, IRWrite is de-asserted, ALUOp = 01, IorD = 0, and PCSource = 01. The other controls mentioned are PCWriteCond= 01, ALUScrB = 00. B. A fault in the control unit forces PCSource to be 0 at all times: This fault will not affect states 0 (instruction fetch) and 1 (instruction decode/register fetch). However during state 8 (branch completion), if a branch is to take place, PCSource stuck at 0 will prevent the branch target address from the ALUOut buffer to be written to PC. The content of PC will be the output of the ALU unit at this time A-B. C. A fault in the control unit forces ALUOp to be 0 at all times: Again, this fault will not affect states 0 (instruction fetch) and 1 (instruction decode/register fetch). However during state 8 (branch completion), in order to determine if a branch is to take place, the ALU will have to perform an equality test by evaluating A B. ALUOp stuck at 0 will cause the ALU to evaluate A + B, instead of A B. The branch will take place incorrectly when A+B = 0. D. A fault in the control unit forces ALUSrcB to be 1 at all times: This fault will not affect state 0 (instruction fetch). During state 1 (instruction decode/register fetch), when the datapath has to compute the branch target address, ALUSrcB stuck at 1 will caused the datapath to pick up the value 4, instead of the branch offset. The resulting branch target address will not be correct. Furthermore, during state 8 (branch completion), in order to determine if a branch is to take place, the ALU will have to perform an equality test by evaluating A B. ALUSrcB stuck at 1 will cause the ALU to evaluate A - 4, instead of A B. This will result in branch taking place only if A is also equal to 4, which is not what was intended. Question 3: A. add $a0, $s0, $t0 there are no errors or anomalies. Register $a0 becomes 4 + 6 = 10. B. add $a0, $s0, $t0 There are no errors. It is an anomaly that MemtoReg is set to 0 at all times' but it has no effect on the execution of this instruction. Register $a0 becomes 4 + 6 = 10. C. It is an anomaly that MemtoReg is set to 1 in cycles 1 through 3 but this has no effect on the execution of this instruction in these cycles. There is an error in cycle #4 because the instruction is trying to add (add $s0, $t0, $a0) but MemToReg 4

is always asserted and this leads to the machine language code for the instruction being stored in $a0. Register $a0 becomes: 00000010000010000010000000100000 D. sw $t0, 2($s0) or sw $t0, 2($s0) or sb $t0, 2($s0). Any answer is OK. There are no errors. Since $s0=4, the instruction stores the content of $t0 (i.e. 6) at memory address 2+4 = 6. If this is a sb, byte 6 in DRAM becomes 6. If this is a sh, byte 6 in DRAM becomes 0 and byte 7 becomes 6. If this is a sw, then there is an anomaly because the address (6) is not a multiple of 4. Nevertheless, any of the following answers will be accepted: A mis-aligned exception is thrown. Locations 6,7,8,9 will become: 0,0,0,6 (respectively). Locations 4,5,6,7 will become: 0,0,0,6 (respectively). 5