ECE 2030 I Computer Engineering Spring 2003 Final Exam, Exams of Computer Science

The instructions and problems for the ece 2030 i computer engineering spring 2003 final exam. The exam covers various topics including logic design, counter design, shifting and counting, subtraction and memory, assembly language programming, and reverse engineering. Students are required to solve problems using only the given resources and without the use of calculators or notes.

Typology: Exams

2012/2013

Uploaded on 04/08/2013

seetharaman_sehgal
seetharaman_sehgal ๐Ÿ‡ฎ๐Ÿ‡ณ

4.4

(11)

117 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 2030 I Computer Engineering Spring 2003
6 problems, 8 pages Final Exam 28 April 2003
1
Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a
question, raise your hand and I will come to you. Please work the exam in pencil and do not
separate the pages of the exam. For maximum credit, show your work.
Good Luck!
Your Name (please print) ________________________________________________
1 2 3 4 5 6 total
22 20 12 18 8 20 100
pf3
pf4
pf5
pf8

Partial preview of the text

Download ECE 2030 I Computer Engineering Spring 2003 Final Exam and more Exams Computer Science in PDF only on Docsity!

6 problems, 8 pages Final Exam 28 April 2003

Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate the pages of the exam. For maximum credit, show your work. Good Luck!

Your Name ( please print ) ________________________________________________

1 2 3 4 5 6 total

6 problems, 8 pages Final Exam 28 April 2003

Problem 1 (3 parts, 22 points) Logic Design

Consider the following expression:

Out =( A โ‹… B โ‹… C )+( A โ‹… C )+( A โ‹… B ) Part A (8 points) Implement the expression using only NOR and NOT gates. Assume you do not have the compliments of the inputs. Use proper mixed logic notation. Do not simplify the expression. Determine the number of transistors used in this implementation.

number of transistors:

Part B (8 points) Implement the expression using N and P type switches. Assume the inputs, A, B, and C, are available in their true and complemented forms.

Part C (6 points) Now simplify the expression and produce a sum of products SOP expression. List all prime implicants and indicate which are essential.

A

A

B B

C

C

C

prime implicants

essential? yes no

simplified SOP expression

6 problems, 8 pages Final Exam 28 April 2003

Problem 3 (2 parts, 12 points) Shifting and Counting

Part A (6 points) Suppose the following inputs (in hexadecimal) are applied to the 32-bit barrel shifter used in the datapath. Determine the output (in hexadecimal). Assume the shift amount is drawn from the 16-bit immediate value.

Shift Type Shift Amount Input Value Output Value rotate 0x000C^ B9569AF

arithmetic 0x0008^ B826E

logical 0xFFF4^ CBA

Part B (6 points) Suppose you are given the following incorrect implementation of a counter. Complete the timing diagram below by showing the outputs (O 0 , O 1 , and O 2 ) for clock cycles 7 through 14.

TE Out Clr

TE Out Clr

O 0

CLR O 1

CE

TE Out Clr

O 2

CE

CLR

Clock

Cycle 1 2 3 4 5 6 7 8 9 10 11 12 13 14

6 problems, 8 pages Final Exam 28 April 2003

Problem 4 (3 parts, 18 points) Subtraction and Memory

Part A (8 points) Convert each subtraction problem (X-Y=Z) below to an addition problem (X+(- Y)=Z) and compute the result of the addition. Also indicate whether an error occurs assuming all numbers are expressed using a six bit twoโ€™s complement representation and then indicate whether an error occurs using a six bit unsigned representation.

  • 1 1 1 0 0 โ‡’ +.
  • 1 1 0 0 0 1 โ‡’ +.

Result Signed Error? Unsigned Error?

Part B (5 points) Draw a DRAM memory cell. Label all signals.

Part C (5 points) Consider a memory system built using a 4Mbit DRAM chip organized as 1 million addresses of 4-bit words. Given a memory system with 32 DRAM chips total and a 3-to- memory decoder, what are the following parameters? number of banks number of chips used in one bank

number of addresses word size (in bits )

memory system capacity (in MBytes )

6 problems, 8 pages Final Exam 28 April 2003

Problem 6 (5 parts, 20 points) Reverse Engineering

Consider the following MIPS subroutine. The attached sheet lists the instruction set.

Address label instruction 2000 abc: addi $1, $0, 200 2004 lw $2, ($1) 2008 addi $1, $1, 4 2012 loop: lw $4, ($1) 2016 slt $3, $2, $ 2020 bne $3, $0, target 2024 add $2, $0, $ 2028 target: addi $1, $1, 4 2032 slti $3, $1, 500 2036 bne $3, $0, loop 2040 jr $

Part A (4 points) How many words of data are read in from memory (using lw) by abc?

number words read:

Part B (4 points) What must be true of $2 and $4 for the instruction at address 2024 to be executed?

Part C (4 points) What function does this subroutine compute?

Part D (4 points) The following subroutine (start) calls abc. Insert instructions to push the return address before the call to abc and to pop the return address when abc returns. Use register 29 to hold the stack pointer.

Address label instruction comment 1000 start: addi $25, $0, 3 # init $25 to 3 1004 sub $7, $7, $7 # clear $ 1008 # push return address 1012 1016 jal abc # call abc 1020 # pop return address 1024

1028 sw $2, ($25) # store result 1032 jr $31 # return Part E (4 points) Given the following branch instruction, what is the branch target address?

address label instruction 7052 beq $7, $8, -

Branch target address :.

6 problems, 8 pages Final Exam 28 April 2003

MIPS Instruction Set (subset) instruction example meaning add add $1,$2,$3 $1 = $2 + $ subtract sub $1,$2,$3 $1 = $2 - $ add immediate addi $1,$2,100 $1 = $2 + 100 multiply mul $1,$2,$3 $1 = $2 * $ divide div $1,$2,$3 $1 = $2 / $ and and $1,$2,$3 $1 = $2 & $ or or $1,$2,$3 $1 = $2 | $ and immediate andi $1,$2,100 $1 = $2 & 100 or immediate ori $1,$2,100 $1 = $2 | 100 xor xor $1, $2, $3 (^) $1 = $2 โŠ• $ xor immediate xori $1, $2, 255 (^) $1 = $2 โŠ• 255 shift left logical sll $1,$2,5 $1 = $2 << 5 (logical) shift right logical srl $1,$2,5 $1 = $2 >> 5 (logical) shift left arithmetic sla $1,$2,5 $1 = $2 << 5 (arithmetic) shift right arithmetic sra $1,$2,5 $1 = $2 >> 5 (arithmetic) load word lw $1, ($2) $1 = memory [$2] store word sw $1, ($2) memory [$2] = $ load upper immediate lui $1,100 (^) $1 = 100 x 2 16 branch if equal beq $1,$2,100 if ($1 = $2), PC = PC + 4 + (1004) branch if not equal bne $1,$2,100 (^) if ($1 โ‰  $2), PC = PC + 4 + (1004) set if less than slt $1, $2, $3 if ($2 < $3), $1 = 1 else $1 = 0 set if less than immediate slti $1, $2, 100 if ($2 < 100), $1 = 1 else $1 = 0 jump j 10000 PC = 10000* jump register jr $31 PC = $ jump and link jal 10000 $31 = PC + 4; PC = 10000*