CMSC411 Assignment 1 Fall 2023 On-time Due: September 16 by 11:00 PM General instruction • Submit a PDF file to GradeScope – You may edit the PDF file directly, scan your work on paper, or can also use an app (e.g., Scannable) to create a PDF file from photos of your work. • After uploading your work, don’t forget to create mapping between questions and your answers. 5 percent of the total points assigned to a this assignment will be deducted if mapping is not (or incorrectly) given. • Unless specified, all questions will be graded. • Unless specified, justify your answers always. If justifications are missing or do not show reasonably how your answers are derived, 0 points will be assigned regardless of the correctness of the answers. • Write neatly in case you write your answers on paper. Especially, for table completion questions, if your answers are not given neatly in well-drawn tables, the answers won’t be graded. • This assignment must be done by yourself without any unauthorized assistance. Write your name and numeric student ID in the space below, and put your signature after reading the pledge statement. Name: Nerea De Vicente Serrano SID (Numeric): 120408533 I pledge my honor that all parts of this assignment were done by me individually and without any unauthorized assistance or collaboration with others. Signature: e DO NOT SHARE THE QUESTIONS ON-/OFF-LINE. 1 Q1. Availability Availability is the most important consideration for designing servers, followed closely by scalability and throughput. (a) We have a single processor with a failures in time (FIT) of 100. What is the mean time to failure (MTTF) for this system? FIT= 1/MTTF => MTTF MTTF 1/FIT = 1.109 10-210* 105hours=MTTF = = = =1140.77 years (b) If it takes 1 day to get the system running again, what is the availability of the system? Availability MTTF/MTTF+MTTR = 187 Availability 18"+ 24 =0.99 = Availability = (c) Imagine that the government, to cut costs, is going to build a supercomputer out of inexpensive computers rather than expensive, reliable computers. What is the MTTF for a system with 1000 processors? Assume that if one fails, the entire system fail. More processors Less MTTF -> MTTF system = =104 hours 2 1 2 year MTTF = and a months Q2. Speedup Assume that we are considering enhancing a machine by adding vector hardware to it. When a computation is run in vector mode on the vector hardware, it is 10 times faster than the normal mode of execution. We call the percentage of computation time that could be spent using vector mode the percentage of vectorization. We haven’t discussed vector machines yet, but you don’t need to know anything about how they work to answer this question. Simply assume it is a performance enhancement applied to the hardware. (a) What percentage of vectorization is needed to achieve a speedup of 2? 10 · · faster times speedup=2 speedup=altime G => new-time 18 =2 2f E 1 - = + = + 107 => - 8 5 f = = 3/q = 0.55 55.55% = = (b) (continued from the previous question) if a speedup of 2 is achieved, what percentage of the computation time is spent in vector mode when we run the computation on the enhanced machine? Total time speedup initially of does not change be - 100%, now is 50% de to the 2. The total time 11 is spent so of vector mode out with the data in as 0.555 0.4451. However, now, as = 0.501. So the time 0.50-0.445 0.055. As = 3 spent a we by said total time would vector mode percentage:3.5% would be Q3. MIPS Instruction Set Architecture Complete the following MIPS code that counts the number of occurrences of a specific character in a string (char array). Consider the following additional assumptions for this question. • • • • • Each character in the string takes a byte. The string is NULL-terminated. Keep the count in a register Do NOT use the Load Immediate (li) or the Load Address (la) iinstruction. Recall that every alphabet letter is mapped to an ASCII code value. .text # code section main: la $t1,str # $t1 will be the address of the first array element lb $t3,char # and $t3 will hold the char # YOUR CODE HERE!! while: ebut4($ +1) beqz$t4 bne addi nochar: done $t4$t3 1 to nochar $tO addi$-1$t1 b #load byte #if itis equal ift3 character # F #if its 1 #Add e 1 to zero equal to count #add 1 for next while done: jr Iva # assume that MIPS code to terminate program is given here .data # data section str: .asciiz "The purpose of our lives is to be happy." char: .asciiz "b" 4