Solution printed. Do not start the test until instructed to do so! CS 2504 Intro Computer Organization Test 2 Spring 2006.

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

Do not start the test until instructed to do so!

CS 2506 Computer Organization II Test 2

CS 2506 Computer Organization II Test 1

CS 2506 Computer Organization II

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

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Summer I Instructions:

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring Instructions:

Processor (I) - datapath & control. Hwansoo Han

CS 2506 Computer Organization II

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

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

Chapter 5 Solutions: For More Practice

CSEN 601: Computer System Architecture Summer 2014

CS 2604 Data Structures Midterm Summer 2000 U T. Do not start the test until instructed to do so!

Do not start the test until instructed to do so!

The MIPS Processor Datapath

Systems Architecture

Mapping Control to Hardware

CS 2504 Intro Computer Organization Test 1

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

LECTURE 5. Single-Cycle Datapath and Control

CS 2505 Computer Organization I

Design of the MIPS Processor (contd)

CS 351 Exam 2 Mon. 11/2/2015

Project Description EEC 483 Computer Organization, Spring 2019

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

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

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

CC 311- Computer Architecture. The Processor - Control

Chapter 5: The Processor: Datapath and Control

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Design of the MIPS Processor

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

For More Practice FMP

COMP2611: Computer Organization. The Pipelined Processor

Chapter 4. The Processor

McGill University Faculty of Engineering FINAL EXAMINATION Fall 2007 (DEC 2007)

Problem 4 The order, from easiest to hardest, is Bit Equal, Split Register, Replace Under Mask.

Data paths for MIPS instructions

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

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

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Topic #6. Processor Design

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

ECE 313 Computer Organization EXAM 2 November 11, 2000

CS3350B Computer Architecture Quiz 3 March 15, 2018

Chapter 4. The Processor

Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control

CS 2505 Computer Organization I

EECS 270 Midterm Exam

Do not start the test until instructed to do so!

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

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

University of Jordan Computer Engineering Department CPE439: Computer Design Lab

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

Winter 2002 FINAL EXAMINATION

ECE369. Chapter 5 ECE369

The Processor: Datapath & Control

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

Name: University of Michigan uniqname: (NOT your student ID number!)

CS 3114 Data Structures and Algorithms Test 1 READ THIS NOW!

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

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

Problem 1 (logic design)

Points available Your marks Total 100

CS 351 Exam 2, Fall 2012

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

Single Cycle Data Path

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

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

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

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Chapter 4. The Processor Designing the datapath

ECE260: Fundamentals of Computer Engineering

Lab 8 (Sections 300, 301 and 302) Prelab: ALU and ALU Control

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

CPE 335. Basic MIPS Architecture Part II

CSE 2021 COMPUTER ORGANIZATION

EE380 Spring 2014 Exam 1 Answer Key

Laboratory 5 Processor Datapath

Do not start the test until instructed to do so!

CS2100 COMPUTER ORGANISATION

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

The Processor: Datapath & Control

Laboratory Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction

Do not start the test until instructed to do so!

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

ASIC = Application specific integrated circuit

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

ECE232: Hardware Organization and Design

NATIONAL UNIVERSITY OF SINGAPORE

Single Cycle CPU Design. Mehran Rezaei

Lets Build a Processor

ECE 30, Lab #8 Spring 2014

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

ENE 334 Microprocessors

Transcription:

VIRG INIA POLYTECHNIC INSTITUTE AND STATE U T PROSI M UNI VERSI TY Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet and the MIPS reference card. No calculators or other computing devices may be used. Answer each question in the space provided. If you need to continue an answer onto the back of a page, clearly indicate that and label the continuation with the question number. If you want partial credit, justify your answers, even when justification is not explicitly required. There are 10 questions, priced as marked. The maximum score is 100. When you have completed the test, sign the pledge at the bottom of this page and turn in the test. Note that either failing to return this test, or discussing its content with a student who has not taken it is a violation of the Honor Code. Do not start the test until instructed to do so! Name Solution printed Pledge: On my honor, I have neither given nor received unauthorized aid on this examination. signed 1

1. [6 points] The MIPS platform uses 2 s complement representation for signed integers. What important advantage(s) does this provide, compared to using sign-magnitude representation? The primary advantage is that the same algorithm can be used for both addition and subtraction; this simplifies the design of the ALU. Lesser advantages include the fact that there is only one representation for zero, and so a (very slightly) increase in the range of representation. There is no significant gain in efficiency for the individual operations, although there is a slight gain for in addition of signed numbers. For both representations, the high-order bit indicates the sign of the number and the low-order bit indicates whether the number is even or odd. 2. [12 points] Complete the truth table defining the output for a 1-bit full adder (with carry-in). A B Cin Sum Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 3. [10 points] Write a sum-of-products expression for the sum bit produced by the 1-bit full adder in the previous question. Sum = ~A*~B*Cin + ~A*B*~Cin + A*~B*~Cin + A*B*Cin 2

4. [10 points] Using only AND, OR and NOT gates, draw a circuit that computes the carry-out bit for the 1-bit full adder circuit from question 2. From the truth table: Sum = ~A*B*Cin + A*~B*~Cin + A*B*~Cin + A*B*Cin This yields the solution at left below. However, the expression above can be simplified because the last two terms reduce to A*B, and the negated variables in the first two terms can be viewed as don t cares. That yields the simpler solution at right below. 5. [12 points] Using only AND, OR and NOT gates, draw a circuit that computes the function Out1 defined by the truth table given below. The X entries indicate that the corresponding input is not used to determine output values in that row. Inputs Outputs A1 A2 F3 F2 F1 F0 Out1 Out2 Out3 ------------------------------------------ 0 0 X X X X 0 1 0 X 1 X X X X 1 1 0 1 X 0 0 0 0 0 1 0 1 X 0 0 1 0 1 1 0 1 X 0 1 0 0 0 0 0 1 X 0 1 0 1 0 0 1 1 X 1 0 1 0 1 1 1 ------------------------------------------ The corresponding expression is: Out1 = A2 + A1*~F3*~F2*F1*~F0 + A1*F3*~F2*F1*~F0 That yields the solution at left below. However, the expression can be simplified by factoring A1*~F2*F1*~F0 out of the last two terms and reducing the resulting term ~F2 + F2 to 1: Out1 = A2 + A1*~F2*F1*~F0. This yields the simpler solution at right below. 3

6. [6 points] What is the conceptual difference between a combinational logic circuit and a sequential logic circuit? The output of a combinational circuit depends only on the current state of its inputs. The output of a sequential circuit depends both on the state of its inputs, and on the previous value(s) of its output. For questions 7 10, feel free to refer to the copies of Fig 5.17 and 5.18 from P&H that were distributed along with the test. 7. [10 points] The single-cycle datapath shown in Fig 5.17 includes two different memory modules, one for data and one for instructions. Given that the design is for a single-cycle machine, is it logically necessary to have two different memories? Or is it convenient but not strictly necessary? Or is it not even justified by convenience? Justify your conclusion carefully. (You might want to base your argument on an example drawn from the MIPS instruction set.) In a single-cycle design, it is not possible to perform two different memory access operations (on a single memory unit) in a single cycle. For example, in executing the sw instruction, we must fetch the instruction from memory, use the ALU to compute a target address, and then write a value into memory at that address. Therefore, it is logically necessary to have separate memory units for instructions and for data. 8. [8 points] Refer to Fig 5.17 and 5.18. a) Explain briefly why, in order to execute the instruction lw, the ALUSrc signal must be set to 1 instead of 0. The ALUSrc signal determines whether the second operand to the ALU is retrieved from the register file (ALUSrc = 0) or from the instruction (ALUSrc = 0) being executed (after sign-extension). For a load word instruction, a value is being retrieved from a memory location whose address is contained within the instruction. b) Explain briefly why, in order to execute the instruction beq, the setting of the MemtoReg signal is a don t care; that is, it doesn t matter whether that signal is a 0 or a 1. The MemtoReg signal determines whether the value that is sent to be written to the register file is taken from the data memory or is computed by the ALU. However, the branch-on-equal instruction does not cause anything to be written to the register file (the RegWrite signal is set to low), so it doesn t matter what setting is used for MemtoReg. 4

9. [10 points] A friend proposes to simplify the single-cycle datapath shown in Fig 5.17 by eliminating the control signal MemtoReg. The multiplexor that currently takes MemtoReg as an input will instead use the ALUSrc control signal. Will the proposed modification work correctly? Why or why not? According to Fig 5.18, the value of MemtoReg only matters when R-type instructions and lw are executed. In both those cases, the values for MemtoReg and ALUSrc are identical. For the other instructions (sw and beq), the value of MemtoReg is a don t care, so no matter what the value of ALUSrc might be, it will do nicely. Therefore, yes, the design change will work correctly. Of course, this may fail if additional instructions are to be supported, but that is not relevant to the question that was posed. 10. [16 points] A stuck-at-x fault occurs when a signal is always x regardless of what it should be. Consider the single-cycle datapath shown in Fig 5.17. Which instructions from the set {add, lw, sw, beq}, if any, would not work correctly under the following conditions? Each part is independent; i.e., there is never more than one signal suffering a stuck-at-x fault. a) RegWrite is stuck at 0 can t write anything into the register file add, lw b) MemRead is stuck at 0 can t read from the data memory lw c) RegRead is stuck at 0 no such signal d) ALUOp is stuck at 00 from Fig 5.18, we couldn t set control for add, beq 5