COMP 411 20-‐min Sakai Quiz #1 1) Approximately how many transistors are present inside the processor of a typical personal computer today? A) Hundreds B) Thousands C) Millions D) Billions Explanation: There are billions, which explains why your laptop's CPU may be in gigahertz (GHz)! 2) Suppose a program contains the following mix of instructions: 30% type A, 40% type B, and 30% type C. Type A instructions have CPI of 1, Type B have CPI of 2, and Type C have CPI of 3. What is the average CPI for the program? A) 1 B) 2 C) 3 D) 6 Explanation: 0.30(1) + 0.40(2) + 0.30(3) = 2 3) Suppose the average CPI for a program is 3.0. The program executes 3 billion (3x109) instructions. What is the execution time if the computer runs at 3 GHz clock speed? A) 3 s B) 9 s C) 27 s D) 30 s Explanation: 3 𝑐𝑦𝑐𝑙𝑒𝑠 1 𝑠 ∗ 3 ∗ 10! 𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠 ∗ = 3 𝑠 𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛 3 ∗ 10! 𝑐𝑦𝑐𝑙𝑒𝑠 4) Suppose the execution time of a program is 100 s, consisting of 80 s spent executing floating-‐point instructions and 20 s spent executing the rest. If an improvement to the architecture speeds up floating-‐point instructions by a factor of 8, how much is the overall speedup for this program? A) 8 B) 4 C) 0.3 D) 3.33 Explanation: Amdahl's law 1 = 𝑜𝑣𝑒𝑟𝑎𝑙𝑙 𝑠𝑝𝑒𝑒𝑑𝑢𝑝 𝐹 𝑟𝑒𝑠𝑡 𝑜𝑓 𝑡𝑖𝑚𝑒 𝑏𝑒𝑠𝑖𝑑𝑒𝑠 𝐹 + 𝑆 where F is the fraction of time you want to speedup and S is the factor of speedup. Thus, the equation to setup is the following: 1 ≈ 3.33 0.8 0.2 + 8 5) If given 8 bits and you had to apply the concept of 2’s compliment, which range of numbers would you be able to represent? A) -‐127 to 128 B) 0 to 255 C) -‐128 to 127 D) 0 to 127 Explanation: In 2's compliment, the leftmost bit represents a negative value. Thus the most negative value is 1000 0000 or -‐128. Since the leftmost bit is the signed bit, the number 0111 1111 is the most positive value, which is 127. Thus you can represent values between these two numbers. 6) Let’s say we have 20 students in COMP 410 and we have to give them each an ID from 0 to 19. How many bits (unsigned) will we need to encode these IDs? A) 3 bits B) 4 bits C) 5 bits D) 6 bits Explanation: Since the IDs must be unique, we want to see how many genuine combinations of a certain of bits we can make and assign to each person so that each person is represented individually. If we only had 4 bits, then there are 2*2*2*2=16 possible different combinations, which is not enough. If we have 5 bits, then there are 2*2*2*2*2=32 possible combinations which is more than enough. 7) Based on a 2’s compliment 8 bit binary representation of -‐127, which one of these hexadecimals is its equivalent? A) 0x81 B) 0x80 C) 0xFF D) 0x8F Explanation: Since in 2's compliment the leftmost bit is the only bit that can have a negative value (it is called the signed bit), 1000 0000 is the most negative number that we can represent in 8 bits. 1000 0000 = -‐1*27 = -‐128 Since we know what the binary of -‐128, let's just add it by 1 1000 0000 + 1 = 1000 0001 = 0x81 8) What does the 2’s compliment, 8 bit number of 1000 1000 represent? A) -‐100 B) 136 C) 16 D) -‐120 Explanation: 1000 1000two = -‐1*27 + 1*23 = 23(-‐24 + 1) = 8(-‐16 + 1) = 8*-‐15 = -‐120 9) Using 16 bit 2’s compliment, what is 324ten – 31007ten? (HINT: 324 in binary is 0000 0001 0100 0100 and -‐31007 in binary is 1000 0110 1110 0001) A) B) C) D) 0xF42B 0x7A63 0x8825 0x8888 Explanation: 0000 0001 0100 0100 + 1000 0110 1110 0001 -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ 1000 1000 0010 0101 <-‐-‐ Answer in binary 8 8 2 5 <-‐-‐ Answer in hex
© Copyright 2026 Paperzz