CSE Quiz 3 - Fall 2009

Similar documents
Codeword[1] Codeword[0]

ECS 154B Computer Architecture II Spring 2009

COMP2611: Computer Organization. The Pipelined Processor

EE557--FALL 1999 MAKE-UP MIDTERM 1. Closed books, closed notes

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

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

ECE260: Fundamentals of Computer Engineering

CSE 378 Midterm 2/12/10 Sample Solution

EE557--FALL 1999 MIDTERM 1. Closed books, closed notes

Processor Design Pipelined Processor (II) Hung-Wei Tseng

Pipelined datapath Staging data. CS2504, Spring'2007 Dimitris Nikolopoulos

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

Processor (I) - datapath & control. Hwansoo Han

University of Jordan Computer Engineering Department CPE439: Computer Design Lab

CS3350B Computer Architecture Quiz 3 March 15, 2018

ECE154A Introduction to Computer Architecture. Homework 4 solution

Perfect Student CS 343 Final Exam May 19, 2011 Student ID: 9999 Exam ID: 9636 Instructions Use pencil, if you have one. For multiple choice

CSEN 601: Computer System Architecture Summer 2014

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

CPE 335 Computer Organization. Basic MIPS Pipelining Part I

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

Computer Organization and Structure

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

CS 351 Exam 2, Fall 2012

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

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

Systems Architecture

The Evolution of Microprocessors. Per Stenström

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

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

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

MIPS-Lite Single-Cycle Control

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

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

Single Cycle CPU Design. Mehran Rezaei

Pipelining. Ideal speedup is number of stages in the pipeline. Do we achieve this? 2. Improve performance by increasing instruction throughput ...

Virtual memory. Hung-Wei Tseng

Lecture 9. Pipeline Hazards. Christos Kozyrakis Stanford University

CS 61C Summer 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

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

Machine Organization & Assembly Language

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

Pipeline design. Mehran Rezaei

ECE260: Fundamentals of Computer Engineering

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

ECE232: Hardware Organization and Design

LECTURE 5. Single-Cycle Datapath and Control

CS 61C Fall 2016 Guerrilla Section 4: MIPS CPU (Datapath & Control)

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

Improving Performance: Pipelining

CSE 2021 COMPUTER ORGANIZATION

CS232 Final Exam May 5, 2001

EE2011 Computer Organization Lecture 10: Enhancing Performance with Pipelining ~ Pipelined Datapath

Virtual memory. Hung-Wei Tseng

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

Major CPU Design Steps

COMPUTER ORGANIZATION AND DESIGN

Laboratory Exercise 6 Pipelined Processors 0.0

4. (2 pts) What is the only valid and unimpeachable measure of performance?

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception

ECE473 Computer Architecture and Organization. Pipeline: Data Hazards

Machine Organization & Assembly Language

A Simplified MIPS Processor in Verilog

CS/CoE 1541 Exam 1 (Spring 2019).

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

Design of the MIPS Processor

CS 2506 Computer Organization II Test 1. Do not start the test until instructed to do so! printed

NATIONAL UNIVERSITY OF SINGAPORE

CSE 2021 COMPUTER ORGANIZATION

Pipelining. Pipeline performance

CS 351 Exam 2 Mon. 11/2/2015

COSC 6385 Computer Architecture - Pipelining

CPU Organization (Design)

Lecture 10: Simple Data Path

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

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

ECE3055B Fall 2004 Computer Architecture and Operating Systems Final Exam Solution Dec 10, 2004

The Processor: Datapath & Control

Pipelined Processor Design. EE/ECE 4305: Computer Architecture University of Minnesota Duluth By Dr. Taek M. Kwon

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

cs470 - Computer Architecture 1 Spring 2002 Final Exam open books, open notes

Single Cycle Data Path

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

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

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds?

Processor: Multi- Cycle Datapath & Control

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

COMPUTER ORGANIZATION AND DESIGN

CENG 3420 Lecture 06: Datapath

Chapter 5 Solutions: For More Practice

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

Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

Chapter 4. The Processor

Pipelined Processor Design

ECE369. Chapter 5 ECE369

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

CC 311- Computer Architecture. The Processor - Control

CS232 Final Exam May 5, 2001

Transcription:

Student #: ID: B CSE 221 - Quiz 3 - Fall 29 Problem 1. (a) Enter an appropriate value in each table cell corresponding to the Instruction in the column. Enter an X if the value is not applicable for the instruction. Note there is a format for the control bits (see note below the table) and there is reference figures and tables to help you in the following pages. ID EX MEM WB Ins lw $3, ($sp) Ins add $6, $5, $7 Ins. lw $5, ($2) Ins. or $2, $3, $4 Mem 1 Mem 1 MEM 1 Write Reg EX 1 EX 1 Address 2 Write Data 2 rs AddResult Write Data rt ALUResult 2 WB Reg rd Zero operand rt rd Notes: 1. Format for control bits: EX: RegDst, ALUOp[1:], ALUSrc, Mem: Branch, MemRead, MemWrite, WB: MemtoReg 2. Provide the expression for the contents of this portion of the pipeline register. The format of the expression should be the same as given on the MIPS Reference Data sheet, Core Instruction Set table, Operation (in Verilog) column for the instruction in the question. 1 of 7

(b) Identify any data hazards by filling out the following table (an example is shown for illustration only): Hazards Instruction 1 Instruction 2 Ins 1 REG.item Ins 2 REG.item Stall or Forward? add $3, $2, $1 sub $5, $4, $3 EX/MEM.Rd FD/EX.Rt Forward 2 of 7

M ux 1 IF/ID opcode Control ID/EX WB M EX/MEM WB MEM/WB EX M WB Add PC 4 Address Instruction memory Instruction Rs Rt Rd RegWrite Read register 1 Read Read data 1 register 2 Registers Read Write data 2 register Write data Rs Rt Shift left 2 Rs Rt M ux 1 Add result Add ALUSrc Zero ALU ALU result Branch MemWrite Address Data memory Write data Read data MemtoReg 1 M ux Instruction [15 ] Instruction [2 16] Instruction [15 11] Sign extend ALU operand control ALUOp M ux 1 RegDst Result WB Reg MemRead Write Register Write Data Reference Figure - 1 3 of 7

Reference Table - 1 Reference Table - 2 4 of 7

2. Convolutional encoding is commonly used on cell phones to ensure data is received with few errors using the low transmit power typically available on a cell phone. A convolutional encoder is to be included in the core of a cell phone processor and requires a Verilog module to be written. The module will use a finite state machine approach and will accept two inputs - databit and state[1:] and produce two outputs codeword[1:] and nextstate[1:]. The encoding process is diagrammed below, which shows the databit and state bits. The process outputs 2 bits for every 1 input bit. The nextstate[1:] is defined by [databit : state 1]. In other words, the bits are shifted to the right to continue the process. The codeword bits are formed by XOR ing the indicated bits together. Codeword[] databit State[1] State[] Codeword[1:] (a) What type of finite state machine is this and why? Codeword[1] (b) Fill out the following table for nextstate and codeword outputs databit state[1:] nextstate[1:] codeword[1:] 1 1 11 1 1 1 1 1 1 11 5 of 7

(c) Write the conv module based on the above description. module conv(state, databit, nextstate, codeword); endmodule (d) A test bench Verilog module has been written (see below). What is the output from this? module testbench; reg [1:] state; reg [3:] test_data; reg test_bit; wire [1:] codeword, nextstate; integer i; conv uut_conv(state, test_bit, nextstate, codeword); initial begin 6 of 7

test_data = 4'b11; state = 2'b; for (i = ; i < 4; i = i+1) begin #2 test_bit = test_data[i]; #1 $display($time, " databit = %b, state = %b, nextstate = %b codeword = %b",test_bit, state, nextstate, codeword); state = nextstate; end $finish; end endmodule Output: 7 of 7

ID: B CSE 221 - Quiz 3 - Fall 29 Answer Section PROBLEM 1. ANS: (a) ID EX MEM WB Ins lw $3, ($sp) Ins add $6, $5, $7 Ins. lw $5, ($2) Ins. or $2, $3, $4 1 WB1 Mem 1 X 1 Mem 1 X MEM 1 X1 Write Reg 2 EX 1 1 EX 1 1 1 Address 2 R[rs]+SignExtImm Write Data 2 R[rs] R[rt] or R[$3] R[$4] rs 29 (or $sp or R[$29]) AddResult X Write Data X rt 3 or R[$3] ALUResult 2 R[rs] + R[rt] or R[$5]+R$7] WB Reg 5 rd X Zero X operand rt X or R[$7] or $7 rd 6 (b) 1 of 4

ID: B Hazards Instruction 1 Instruction 2 Ins 1 REG.item Ins 2 REG.item Stall or Forward? add $3, $2, $1 sub $5, $4, $3 EX/MEM.Rd FD/EX.Rt Forward lw $5 ($2) add $6, $5, $7 ID/EX.Rd IF/ID.Rs Stall PTS: 1 2 of 4

ID: B 2. ANS: (a) Meely machine - next state depends on both the input and the current state. (b) databit state[1:] nextstate[1:] codeword[1:] 1 11 1 1 1 11 1 1 1 1 11 1 1 1 1 1 11 1 1 11 11 1 (c) module conv(state, databit, nextstate, codeword); input [1:] state; input databit; output[1:] nextstate, codeword; endmodule (d) assign nextstate[1] = databit; assign nextstate[] = state[1]; assign codeword[] = databit^state[1]^state[]; assign codeword[1] = databit^state[]; 3 of 4

ID: B PTS: 1 4 of 4