ࡱ> ` Qbjbj 3hUUU8.V4bViZ W W(2W2W2WXXX0i2i2i2i2i2i2i$GlhnXViQbYX"XbYbYVi2W2Wgi8\8\8\bY82W2W0i8\bY0i8\8\8\2WV pMUbY8\<] i0i8\q[q8\q8\X"X8\X YYXXXViVi[jXXXibYbYbYbYd;rBrB EEL 4713/5764, Spring 2006 Computer Architecture Midterm Exam #2 Administered Wednesday, March 22 Instructions: Open book/notes/calculators. No talking, texting or IMing. You have 50 minutes to complete the exam (12:55-1:45), or about 16 minutes per problem, so pace yourself. Each problem is worth 35 points, for a maximum score of 105, and full credit is 100 points. Raise your hand if you need a clarification on any problem. Problem 1. [35] Floating-Point Representations (CIO 4 aeo) Suppose you are looking at a memory dump of a program that works exclusively with floating-point data, and you see that the region of memory that holds a particular numeric program variable contains the two hexadecimal words 0xe4790000 0x00000000. You want to know what actual numeric value (floating-point number) is contained in that program variable. (a) [10] Identify the engineering problem. (i) [5] What is the name of the engineering standard that specifies the most common format for floating-point representations? (ii) [5] If the variable represents one real number and it occupies both words, then is it a single-precision or double-precisison floating-point number? How do you know? Explain briefly. (b) [10] Formulate the engineering problem. Show how to break up the binary words into the appropriate constituent bit fields, and write down an algebraic expression giving the value of the floating-point number in terms of the unsigned integer value of each field. (c) [15] Solve the engineering problem. Calculate the value of the specific floating-point number being represented and write it in ordinary decimal scientific notation. Problem 2. [35] Multipliers and Dividers (CIO 6 ao) The following MIPS subroutine takes a 4-bit signed (twos complement) multiplicand and multiplier, sign-extended to 32 bits, in registers $a0 and $a1 respectively, and returns their 8-bit signed product (sign-extended to 32 bits) in $v0. line# 1 MULT4S: li $v0,0 # Clear product register 2 andi $t1,$a1,0x08 # bit = multiplier & 0x08; (extract sign bit) 3 beq $t1,$0,ENDIF1 # if (bit != 0) 4 subu $v0,$v0,$a0 # product -= multiplicand; 5 ENDIF1: li $t0,0x04 # mask = Mask for first +ive bit position (bit 2). 6 LOOP: sll $v0,$v0,1 # prod = prod << 1; (shift product left 1 place). 7 and $t1,$a1,$t0 # bit = multiplier & mask; (extract current bit) 8 beq $t1,$0,ENDIF # if (bit != 0) 9 addu $v0,$v0,$a0 # product += multiplicand; 10 ENDIF: srl $t0,$t0,1 # mask = mask >> 1; (shift mask right 1 place) 11 bne $t0,$zero,LOOP # if (mask != 0) goto LOOP; 12 jr $ra # $v0 now contains complete product; return it. Hand-simulate the execution of this code given the initial values $a0 = 11, $a1 = "3. a) [10] First, write out the given input numbers as full 32-bit binary register values. bit #:31MSB2423161587LSB0$a0$a1 b) [25] Next, fill in the table with an execution trace until the JR is reached. Indicate each line of code executed, and each value written back to a register. We have filled in the initial values and the first six lines of the table for you. Also record whether each branch is taken, and its destination label and line number if it is taken. Iter. No.Line No. $a0 $a1$t0$t1$v0Branch behavior, taken v. notBranch dest (if taken)Initially:11"3???01002803not taken04"1105416 Problem 3. [35] Datapath and Control (CIO 2 aeo) Below is the single-cycle MicroMIPS datapath from the textbook (fig. 13.3, p. 248). Suppose you are told that the SLTI instruction on a certain test chip is malfunctioning. You suspect that the problem may be that one of the lines in the below diagram may be broken or disconnected.  a) [10] Identify the problem to be solved. Which data and control lines in the above diagram are required to be connected for successful functioning of the SLTI instruction? Highlight all the lines or sections of wires that are required. Assume that any broken lines will always read as all 0s (a stuck-at-0 fault). b) [15] Formulate a strategy for solving the diagnosis problem. How would you go about determining which of these lines are most likely to be the broken ones, if you could not get test probes inside the chip? Give a strategy for narrowing down the possibilities. Hint: It should involve performing test executions of other instructions of various types to see if they work correctly. List such a series of tests, and for each one, say what you will learn from it about which of the wires might be broken. c) [10] Solve the problem. Suppose that, after some investigation,2;@ABCDQZ\det  a i   . 2 B E ORWZ{hThy OJQJ^J h&&hy h}h= hJh= h7h= h=6h=OJQJ^Jhy h?@hCJh?@h h 5h=CJaJh CJaJh=h hhh5CJaJ5e U V    8^8`gd= 0^`0gd=^gd= ^`gd=^gd=gd=gd=gd0QQQ-R]b+$$d%d&d'dNOPQa$gdy $a$gdy gdy gdy gd={|#+,-.RS"#,-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555555 5 5 5 5 5 555555555555555555 5 !#v#vB#v#v#v#v#v #v #v#v#v#v#v#v #v !:V t6,!55B55555 5 555555 5 !/ / / /  /  /  / /  /  / / /  /  / / /  /  / !4 kd$$If!       !B         t06քքքք44 a$$If!v!h55B5555555 5 5 5 5 5 555555555555555555 5 !#v#vB#v#v#v#v#v #v #v#v#v#v#v#v #v !:V t6,!55B55555 5 555555 5 !/ / /  /  /  / /  /  / / /  /  / / /  /  4 kd>$$If!       !B         t06քքքք44 a$$If!v h555555555 F#v#v#v#v#v F:Vl4 t6, 55555 F/ Tkd$$IfTl4 ,` r UF t06$$$$44 laTt$$If!vh5C5555555F#vC#v#v#vF:Vl  tP65C555F/ pPTkd$$IfTlִ` r UCF  tP06    44 lapPT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 F/ Tkd $$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd#$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd`&$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd+)$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd+$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd.$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd1$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdW4$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd"7$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd9$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd<$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd?$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdNB$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdE$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdG$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdJ$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdzM$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdEP$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdS$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdU$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdX$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdq[$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkd<^$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkda$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdc$$IfTl ,` r UF t06$$$$44 laT$$If!v h555555555 F#v#v#v#v#v F:Vl t655555 FTkdf$$IfTl ,` r UF t06$$$$44 laT@@@ NormalCJ_HaJmH sH tH Z@Z = Heading 1$<@&5CJ KH OJQJ\^JaJ \@\ .^ Heading 2$<@& 56CJOJQJ\]^JaJDA@D Default Paragraph FontRi@R  Table Normal4 l4a (k@(No Listj@j .^ Table Grid7:V0dOd .^Heading 2 Char056CJOJQJ\]^J_HaJmH sH tH V>@V Title$<@&a$5CJ KHOJQJ\^JaJ >O"> WSolutionB*OJQJph4@24 =Header  !4 @B4 =Footer  !.)@Q. = Page NumberHB`bH y Body Text x*$1$OJPJQJtH;;TeUV -R ] 1 n  $ ' ( ) - . / 2 5 6 7 8 9 : ; > A B C D E F G I K L M Q R S U V Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z {        ! % C Z [ f i l n p r s t u w y z { | }        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~/0/0123456789:;<=>?@5789<0000000000000000000000000000000000000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 000000000000000000000000000000000000y00y00y00y00y00y00y00y00@0y00@0y00H@0@00UV-] 1 n U V z {  Z [ f i l n p r s t u {    #$%&*-./04789:>ABCDHKLMNRUVWXz}~<{007{007{004{004{004{004{00;{00 \fJ{00 {00 {00{00p{0D0{0D0{0D0{0!0~{0!0}{0!0|{0!0{0!0{00{0 0{00{0 0{0'0({0'0{0'0{0 0{0 0{0 0{0 0{0 0{020n{00{00{00 {00 {00 {00 {00 {00 {00 {00{00 {00{00{00 {00{00{00{00 {0 0 {0 0{00 {0 0 {0 0 {0 0 {0 0{0 0 {0 0 {0 0 {0M0NY{00{00{0 0 {0_0O`{0_0O`{00{0b0Q{0b0O{00{00{00{00{00{00{00{00{00{00{00{00{00{0L00M{00{0N00O{00{0P00Q{00{0R00S{00{0T00U{00{00{00 {00{00{00{00{00 {00{00{00{00{00 {00{00{00{00{00{00{00{00{00{00{00 {00{00 {00{0 0{0 0 {00{0 0! {0 0!{0"0{0"0 {0 0!{0"0# {0"0#{0$0{0$0 {0"0#{0$0% {0$0%{0&0{0&0{0$0{0&0{0&0{0&0{0&0{0&0{0(0{0(0{0(0{0&0{00 s00s00s00{00s00{00{00*{00{00 __{|HQ'MnR3Mg@Q !"#$%&)Qelns~!l,2$ѺʲaHuni.T@(  P  S A ??B S  ?;e tzefRy{eft+ </ <9*urn:schemas-microsoft-com:office:smarttagsplace D ai79]_" $ g i 5 7 9BHM67<3333333333333333333333333333 % C X"&67<{67<;:-RB .W 9i2%8'[(VG196G>?@EFMGCJ?KM3?Qb,XVZ6X^b/meruuu0FgfFvSAOp=8.^_A)t!u=Wa;;i y Y7yyG^=h6)O^k $ ' ( ) - . / 2 5 6 7 8 9 : ; > A B C D E F G I K L M Q R S U V Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z {       ! % C Z [ f i l n p r s t u w y z { | }        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<@||?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghiklmnopqrstuvwxyz{|}~Root Entry F@MData 5hi1TablejqWordDocument3hSummaryInformation(DocumentSummaryInformation8CompObjq  FMicrosoft Office Word Document MSWordDocWord.Document.89q