EE 333 Fall 2006 EE 333 Exam 1 September 28, 2006 Name Answers Student ID Seat Instructions 1. Print your name, student ID, and seat in the above blanks. 2. This is a Closed Book exam. 3. Do all of the problems. They may vary in points but the total is 100. Questions are short answer and problems. 4. Do not use any additional pages of paper. If you run out of room, use the back sides. Do not remove the staple. 5. Please write clearly or print. Illegible or unreadable answers may not be graded for partial credit. 6. Mark your answer with a box or star. Lillevik 333f06-a1 University of Portland School of Engineering 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 100 1 EE 333 Fall 2006 MIPS machine language (decimal) You may also use the following pseudo-instructions: la rdest, address lb rt, address sb rt, address Lillevik 333f06-a1 University of Portland School of Engineering 2 EE 333 Fall 2006 MIPS architecture Lillevik 333f06-a1 University of Portland School of Engineering 3 EE 333 Fall 2006 Problem 1, (10 pts) What are the five classic components of a computer and what do they do? 1) Memory: holds instructions and data 2) Datapath: routes information around computer 3) Input: brings information into computer 4) Output: takes information away from computer 5) Control: coordinates the activities of computer Lillevik 333f06-a1 University of Portland School of Engineering 4 EE 333 Fall 2006 Problem 2, (10 pts) For the 16-bit hex number 0xff85 in two’s complement notation: _ A. What is it’s decimal value? n 0 ff85 n 0 007a 1 0 007b 7 161 11160 112 11 12310 B. What is it’s hex representation sign extended to 32-bits? 0 ffff ff85 Lillevik 333f06-a1 University of Portland School of Engineering 5 EE 333 Fall 2006 Problem 3, (10 pts) Find the assembly instruction for: 0x ac82 0010 43 4 16 2 1010 1100 1000 0010 0000 0000 0001 0000 op rs rt immed sw Lillevik 333f06-a1 University of Portland rs rt $2, 16($4) School of Engineering 6 EE 333 Fall 2006 Problem 4, (10 pts) For the MIPS assembly instruction div $9, $2 A. B. C. D. E. Lillevik What is the op code? op = 0 What is rs? rs = 9 What is rt? 0000 0001 0010 0010 0000 0000 0001 1010 rt = 2 What is the function? func = 26 = 0x 1a What is machine instruction in hex? 0x 0122 001a 333f06-a1 University of Portland School of Engineering 7 EE 333 Fall 2006 Problem 5, (10 pts) Write a program segment for c = a + b Lillevik 333f06-a1 University of Portland School of Engineering 8 EE 333 Fall 2006 Problem 6, (10 pts) Find the memory byte in hex. memory Address Contents 0x 0040 000c 0x 24020004 0x 0040 0008 0x 2108ffff 0x 0040 0004 0x 1420fffd Address 0x 0040 0006 0x 0040 000d 0x 0040 0001 0x 0040 000f 0x 0040 0002 (hex) Byte 0x20 0x00 0x6c 0x24 0x65 0x 0040 0000 0x 48656c6c Lillevik 333f06-a1 University of Portland School of Engineering 9 EE 333 Fall 2006 Problem 7, (10 pts) Complete the table below for LS181 ALU Lillevik 333f06-a1 University of Portland Func Add Xor M Cn S3 S2 L H H L H X L H Shift Left Invert Decre ment L H H L S1 S0 L H H L H H L L X L H H L H L H L H School of Engineering 10 EE 333 Fall 2006 Problem 8, (10 pts) Design a “shift left logical” circuit that accepts a 16-bit input A and 2-bit shift amount Shamt that shifts A either 0, 1, 2, or 3 positions. Use only 16-bit shift left logical one position (SLL1) circuits and 16-bit Muxes. Lillevik 333f06-a1 University of Portland School of Engineering 11 EE 333 Fall 2006 Problem 9, (10 pts) For the MIPS architecture, complete the table 1 2 3 add $1, $2, $3 4 x x x beq $1, $2, label 3 x x x lw $1, offset ($2) 5 x x x sub $1, $2, $3 4 x x x sw $1, offset ($2) 4 x x x j label 3 x x x Instruction 1 = Instruction Fetch 2 = Decode & Register Read 3 = Execution Lillevik Clock Total Clocks 333f06-a1 University of Portland 4 5 x x x x x 4 = Memory Access 5 = Register Write School of Engineering 12 EE 333 Fall 2006 Problem 10, (10 pts) Draw the trace for signal Sout Lillevik 333f06-a1 University of Portland School of Engineering 13 EE 333 Fall 2006 Statistics Prob Std Ave 1/10 1.2 9.3 2/10 1.7 8.0 3/10 2.6 8.8 4/10 1.9 8.8 5/10 2.1 8.1 6/10 0.4 9.9 7/10 2.1 7.6 8/10 3.2 8.3 9/10 2.9 5.3 10/10 2.6 7.1 Ave 13.8 81.2 Lillevik 333f06-a1 University of Portland School of Engineering 14