17.4510= (17+0.45)101710= (16+1)10 =24+20 = (10001)2 24 23 22 21 20 1 0 0 0 1 0.45= (0111 0011 0011 0011 0011 001)217.4510= (1000 1. 0111 0011 0011 0011 0011 001…)217.45= 1000 1. 0111 0011 0011 0011 0011 001… * 2017.
45= 1.0001 0111 0011 0011 0011 0011 001… * 24Exponent= 127+4 = 131131= 128+2+1 27 26 25 24 23 22 21 20 1 0 0 0 0 0 1 1 Therefore, IEEE 754 single precision format for 17.45 is Sign Exponent Significant 1 10000011 0111 0011 0011 0011 0011 001 (b) Converting 1.
25 from base 10 to base 2 will be 1.01 which is finite while converting 1.26 to binary will be 1.
0100 0101 0011 11…. which is a lot. Since 1.25 ends at 2 decimal places as 1.01 in binary, the rest of the numbers to fit in the IEEE 754 single precision will be all 0s. Therefore, 1.26 which has a longer time to convert will have more 1 in the mantissa when converting to binary numbers. (c)A biased notation means an excess notation which is another way to represent both negative and positive integers.
It is used in IEEE single format biased by 127. Excess notation makes it easy to compare two numbers and represent exponents. Compared to the standard 8-bit excess notation (-127 to +128), biased 8-bit notation uses number range from -127 to +128 making it able to represent more positive numbers. Question 2(a) No.
of total track = 6.512000 revolutions (rev) = 1 minute = 60 secs1 rev = 60/12000 = 5 msRotation latency= 5/2 =2.5 msTransfer time= total track * amt of data on track to be read = 6.5*5 = 32.5 msSeek time= 6msTotal time taken= seek time + 1 rotation delay + transfer time = (6+2.5+32.5) ms = 41ms(b) Total sector= total track read * no of track/sector = 6.
5 * 500 = 32501 sector transfer time = 1 rev/ sectors/track = 5ms/500 = 0.01ms1 sector time= 1 seek time + rotation delay + 1 sector transfer time = (6+2.5+0.01) ms = 8.51 msTotal time to read= 3250 * 8.
51 = 27657.5 ms(c) X/ Y * 100= (41/27657.5) * 100% = 0.2 % (Ceiling Value) Question 3(a) The locality of reference can be known as the principle of the locality which refers to storage locations frequently accessed based on memory pattern.
There are two basic kinds: temporal and spatial. Temporal locality is based on time and states to be accessed at one point can be accessed again in the near future. Spatial locality is based on space and states to be accessed at the relatively close storage location. There is also a sequential locality which is a part of spatial locality. It happens when the data elements are arranged and accessed in an ascending or descending order. Through Diagram 1, it can be said the closer the data is to the CPU, the faster the CPU can get data since spatial locality depends on the space between the data and CPU. | CPU |ß CPU, superfast and always want more data.
|L1 – Cache|ß runs at 100% of CPU speed (fast)|L2 – Cache|ß runs at 25% of CPU speed (medium)· · ß Memory bus with limited bandwidth. | Main-memory |ß runs at 10% of CPU speed. | Main-memory |ß Big but slow main memory· · ß Slower wire to the hard disk| Hard disk |ß Works at 0,001% of CPU speed(Diagram 1, Memory Hierarchy)In the temporal locality, data will stay in the main memory but cannot stay in the cache as cache can replace old data with new.
In the spatial locality, the RAM usually used is not Random Accessed Memory. It is slow if accessed randomly but with sequential locality, it can be accessed a bit faster. It is better if the related data are kept close together so as to be able to be accessed faster with sequential locality. (b)1 byte = 8 bits16kB = 16 000b * 8 = 128 000 bits1 word = 8 bits1 block = 128000/8 = 16000 wordsIn order to hold 16 000 words, no. of bits to have (at least) = 214Therefore, no of offsets = 14Index set = 33 – 11 – 14 = 8 bitsTherefore there are 28 = 256 blocks in the cache.
Question 4 (a) 1 2 3 4 5 6 7 8 9 10 11 ADD R1, R2, R1 IF ID EX MEM WB INC R5, R5 IF ID EX MEM WB ADDR2, R5, R5 IF ID EX MEM WB SUB R1, R3, R3 IF ID EX MEM WB ADD R3, R4, R4 IF ID EX MEM WB (b) 11 secs (c) 1 2 3 4 5 6 7 8 9 IF ID EX MEM WB IF ID EX MEM WB IF ID EX MEM WB IF ID EX MEM WB IF ID EX MEM WB 1) ADD R1, R3, R1 2) INC R5, R53) SUB R1, R3, R34) ADD R3, R4, R45) ADD R2, R5, R5 This order will take 9 seconds, giving same results but with time reduced by 2 seconds.