Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ECE 6913 INET Quiz 1 Solutions
1. Assume a 10-bit floating point representation format where the Exponent Field has 4 bits and the
Fraction Field has 5 bits and the sign bit field uses 1 bit
a. What is the representation of -8.80158 x 10-2 in this Format (in binary:
-0.00010110100010000011 )
[assume:
bias = 2N-1 - 1= 24-1 -1= 7 (where N = number of exponent field bits) for normalized
representation, and 1-bias = -6 = bias for denormalized representation]. What
10-bit pattern represents the number −0.125 = −1/8? What base-10 integer or fraction does this
10-bit floating point representation format of 0101001001 equal to?
• normalizing,
-8.80158 x 10-2 = -1.0110100010000011 x 2-4
val(exp) = exp field – bias
exp field = -4 + 7 = + 3 = 0011
Fraction field = 01101
-1.01101 x 2-4
= 0.087890625 = 8.7890625 x 10-2
ratio of represented number to actual value
= 0.087890625 / 0.0880158 = 0.9974239
error = 1- 0.9974239 = 0.002576 = 0.2576 %
• -0.125 = -0.001002 = -1.002 x 2-3
S = 1
F = 00100
val(exp) = exp field – bias = -3 = exp field – 7 => exp field = 4
E = 0100
Exponent Field: 4 bits Fraction Field: 5 bits S
0011 01101 1
0100 00000 1
• 10 bit floating point representation of 0101001001 :
E = 10102; exp field = 10decimal; F = 01001
So, val(exp) = 10 – 7 = 3
1.01001 x 23
= 1010.012 = 10.2510
b. What is the range of representation for positive normalized numbers – what is the largest and smallest
normalized number represented in this format? What is the range of representation for positive
denormalized numbers? – what is the largest and smallest denormalized number represented in this
format?
• Normalized Numbers:
Maximum value represented: val (exp) = exp field – bias = 14 – 7 = 7
= 1.11111 x 27 = 28 – 0.00001 x 27 = 256 – 2-5 x 27 = 256 – 4 = 252
Minimum value represented: val (exp) = exp field – bias = 1-7 = -6;
fractional field = 00000
1 x 2-6 = 0.015625
Range: 0.015625 → 252
• Denormalized numbers:
Maximum value represented: val (exp) = 1 – bias = – 6
= 0.11111 x 2-6 = = 2-6-0.00001 x 2-6 = 2-6 – 2-11
= 0.015625 - 0.000488281250 = 0.01513672
Minimum value represented: val (exp) = 1 – bias = – 6
= 0.00001 x 2-6 = = 2-5 x 2-6 = 2-11 = 0.00048828125
Range = 0.00781250 → 0.00048828125
1010 01001 0
1110 11111 0
0001 00000 0
0000 11111 0
0000 00001 0
2. Implement in RISC V these line of code in C:
(i) f = g - A[B[C[27]]]
(ii) f = g - A[ C[10] + B[11] ]
(iii) A[i] = 4B[4i-44] + 3C[32i+32]
3. Hypersonic Computers, your employer, has just bought a new dual Core processor, and you
have been tasked with optimizing your software for this processor - for two applications on this
dual Core processor, but the resource requirements are not equal. The first one needs 80% of the
resources, and the second only 20%.
(i) Assume that 40% of the first application is parallelizable, how much speedup would
you achieve with that application if run in isolation?
Speed-up = 1/(0.6 + 0.4/2) = 1.25
Assume that 99% of the second application is parallelizable, how much speedup would this
application observe if run in isolation?
Speed-up = 1/(0.01 + 0.99/2) = 1.98
(iii) Given that 40% of the first application is parallelizable, how much overall system
speedup would you observe if you parallelized it? Given that 99% of the second application is
parallelizable, how much overall system speedup would you observe if you parallelized it?
Speed-up = 1/(0.2+0.8x0.6+0.8x[0.4/2]) = 1/(0.2+0.48+0.16)=1.19
Speed-up=1/(0.8+0.2x0.01+0.2x[0.99/2]) = 1/(0.8+0.002+0.099)=1.11