Docsity

ECE 2030 Spring 2000 Final Exam Solutions, Exams of Computer Science

Toggle sidebar
bg1
ECE 2030 Computer Engineering Spring 2000
4 problems, 3 pages Final Exam Solutions 4 May 2000
1
Problem 1 (3 parts, 30 points) Implementing Storage
For each part of this problem, connect the inputs and output of your design to the named signals.
Part A (10 points) Using only the devices below, implement a two-to-one mux.
Part B (10 points) Now using this two-to-one mux, implement a transparent latch using basic
gates (NAND, NOR, AND, OR, NOT, pass). Try to minimize transistors.
Part C (10 points) Now using a two-to-one mux and two transparent latches, implement a register
with read and write enable using basic gates (NAND, NOR, AND, OR, NOT, pass).
pf3

Partial preview of the text

Download ECE 2030 Spring 2000 Final Exam Solutions and more Exams Computer Science in PDF only on Docsity!

4 problems, 3 pages Final Exam Solutions 4 May 2000 Problem 1 (3 parts, 30 points) Implementing Storage For each part of this problem, connect the inputs and output of your design to the named signals. Part A (10 points) Using only the devices below, implement a two-to-one mux.

Part B (10 points) Now using this two-to-one mux, implement a transparent latch using basic gates (NAND, NOR, AND, OR, NOT, pass). Try to minimize transistors.

Part C (10 points) Now using a two-to-one mux and two transparent latches, implement a register with read and write enable using basic gates (NAND, NOR, AND, OR, NOT, pass).

4 problems, 3 pages Final Exam Solutions 4 May 2000

Problem 2 (4 parts, 30 points) Assembly Language Programming Consider the following MIPS program subroutine. The attached sheet lists the instruction set. address label instruction 1000 games: addi $1, $0, 5000 1004 addi $5, $0, 5996 1008 lw $3, 0($1) 1012 loop: addi $1, $1, 4 1016 lw $2, 0($1) 1020 slt $4, $2, $ 1024 beq $4, $0, skip 1028 add $3, $2, $ 1032 skip: bne $1, $5, loop 1036 jr $ Part A (10 points) How many times is the loop body in this program fragment executed? number of loop iterations: 249 Part B (5 points) Under what conditions, relative to $2 and $3, is the instruction at address 1028 executed. The instruction executes if $2 < $ Part C (10 points) What is contained in register $3 when the fragment completes (what does this fragment do?) The subroutine finds the minimum value (returned in $3) of a 250 word array stored in memory starting at address 5000. Part D (5 points) What is the name of the value stored in $31 when this fragment begins? return address

Problem 3 (1 part, 15 points) Instruction Formats Suppose a datapath has three operand busses (two source, one destination), 25 instruction types, and 16 registers where each register is 32 bits wide. Immediate operands can be in the range of ±4K. Determine the following values for the resulting instruction format. For the last two questions, assume the same operand number and types used in the MIPS format.

bits needed to specify an opcode 5 bits needed to specify a register operand (^) 4

bits needed to specify an immediate operand 13 bits needed to specify an R-format instruction 5 + 4 + 4 + 4 = 17 bits needed to specify an I-format instruction (^) 5 + 4 + 4 + 13 = 26