Unformatted text preview:

Wawrzynek, WeaverFall 2021CS 61CFinalPrint your name:,(last) (first)Print your student ID:Read the following honor code and sign your name.I understand that I may not collaborate with anyone else on this exam, or cheat in any way. I am awareof the Berkeley Campus Code of Student Conduct and acknowledge that academic misconduct will bereported to the Center for Student Conduct and may further result in, at minimum, negative points onthe exam and a corresponding notch on Nick’s Stanley Fubar demolition tool.Sign your name:You have 170 minutes. There are 9 questions of varying credit (100 points total).For questions with circular bubbles, you may select only one choice.Unselected option (completely unfilled)Only one selected option (completely filled)For questions with square checkboxes, you may select one or more choices.You can selectmultiple squares (completely filled).Anything you write that you cross out will not be graded. Anything you write outside the answer boxeswill not be graded.If an answer requires hex input, make sure you only use capitalized letters! For example,0xDEADBEEFinstead of0xdeadbeef. Please include hex (0x) or binary (0b) prefixes in your answers. For all other bases,do not add the suffix or prefixes.Page 1 of 19This page intentionally left with only one sentence.Final Page 2 of 19 CS 61C – Fall 2021Q1 Potpourri (12 points)Q1.1(1 point) True or False: The assembler translates code from a human-readable language (suchas C) to an assembly language (such as RISC-V assembly).True FalseQ1.2(1 point) True or False: Jumps made to statically linked libraries are fully resolved in the linker.True FalseQ1.3(1 point) True or False: The OS allows for higher reliability; if a program has a bug, only thatprogram will crash, instead of the entire system.True FalseQ1.4(1 point) True or False: For high-performance network devices, polling tends to be used whenthere’s a low data rate, while interrupts tend to be used when there’s a high data rate.True FalseQ1.5 (1 point) True or False: A multithreaded program is considered correct as long as at least oneorder of the threads yields the correct answer, since we can force the scheduler to follow thatthread order.True FalseQ1.6(1 point) True or False: It is cheaper to locate warehouse-scale computers in a cooler climate,in order to reduce total energy consumption.True FalseWe decide to set up 10 1 TiB disks together in a single RAID configuration. What is the effective amountof storage we have if we decide to use:Q1.7 (0.5 points) RAID 0?TiBQ1.8 (0.5 points) RAID 5?TiBFinal Page 3 of 19 CS 61C – Fall 2021Q1.9 (1 point) We run the following code on two threads.1 i n t y = 0 ;2 i n t x = 1 0 ;3 #pra gma omp p a r a l l e l4 {5 while ( x > 0 )6 {7 y = y + 1 ;8 x = x − 1 ;9 }10 }What is the smallest possible value y can contain after this runs?Q1.10(1 point) Justin purchased his HP Pavilion 15t-cs300 laptop 1,000 days ago. During this time, it hasbroken twice, and had to be repaired. Each repair took 10 days to complete, during which time thelaptop was unusable. What is the mean time to failure (MTTF) of Justin’s laptop, in days?daysQ1.11 (1 point) What is the availability of Justin’s laptop?Q1.12(1 point) We’ve devised an error-correcting code which is able to fix 1 bit errors. If 0x61C is a validcodeword, which of the following can NOT be a valid codeword, regardless of the error-correctingscheme we have? Select all that apply.0x71C0x51C0x70D0xC160x16CNone of the aboveQ1.13(1 point) A program originally takes 1 second to run. We manage to parallelize 90% of our code tobe 10 times faster, at the cost of 10 milliseconds of overhead. How many times faster is our newcode?Final Page 4 of 19 CS 61C – Fall 2021Q2 Rounding Errop (14 points)Note: we think Q2 and Q3 are harder questions. Feel free to skip them and come back later.When working with floating point arithmetic, it is often the case that the exact result can’t be stored inthe floating point format. In this case, IEEE-754 defines the following rounding rule, which is commonlyused: Compute the value precisely, then round to the nearest floating point number. In the event thatthe number is exactly halfway between two floating point numbers, round to the number with a leastsignificant bit of 0.For example, if we had a 10-bit minifloat with 5 exponent bits (and standard bias of -15) and 4 significandbits, the numbers 32 and 34 would be precisely representable (with no other representable numbersbetween them). When evaluating 32 + 0.5 = 32.5, we would round down to 32, while evaluating 34 -0.5 = 33.5 would round up to 34. The expression 16 +17 = 33 would round to 32, because 32’s binaryrepresentation as a 10-bit float is0b0 10100 0000(which has a 0 as its least significant bit), and 34’sbinary representation as a 10-bit float is 0b0 10100 0001.You may assume that for any two adjacent floating point numbers, one will have a LSB of 1 and theother will have a LSB of 0. Further, you may assume for this question that you will not need to round toinfinity. Assume that any division in this question is float division (not integer division).For the following questions, we will work with a 10-bit floating point representation that follows allconventions of IEEE-754 (including NaNs, denorms, etc.) but with 5 exponent bits (and standard bias of-15) and 4 significand bits.What is the rounded values of the following (decimal) floating point numbers? You may express youranswer either as an decimal value, or as an odd integer multiplied by a power of 2:Q2.1 (3.5 points) 37Q2.2 (3.5 points) 1/3 (whose binary representation is 0b0.0101 0101.. . )We compute the following infinite sums under this floating point system, using left-association foraddition (that is, a+b+c is evaluated in the order ((a+b)+c)), rounding after each addition. Eventually,this converges to some value, after which any further iterations don’t change the sum. What is thatvalue? You may express your answer either as an decimal value, or as an odd integer multiplied by apower of 2.Q2.3 (3.5 points) 1 + (1/2) + (1/4) + . . .Q2.4 (3.5 points) 2 + 2 + 2 + 2 + . . .Final Page 5 of 19 CS 61C – Fall 2021Q3 Wait, why was this RISC-y, anyway? (14 points)Note: we think Q2 and Q3 are harder questions. Feel free to skip them and come back later.Recall the definition of the function verifypassword:The function verifypassword is defined as follows:• Input: No register input; however, the function receives a string


View Full Document
Download Final
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Final and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Final 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?