Let me take a shot at it :) So the binary number under consideration is : 1.111000 (note that this is a 7 bit binary number, does not make a big difference for this explanation) We have the following specifications given to us: a. The mantissa is 4 bits long b. The exponent is 3 bits long So from the binary number, we get: The exponent --> 000 The mantissa --> 1.111 NOTE: Its important to remember that the exponent and the mantissa are both in 2s complement form here. We need to get the decimal value out of this 2s complement floating point number. We need to convert this 2s complement representation into decimal. Note that, we can get the decimal format of a positive 2s complement number by simply reading it as a binary number. No extra operations are needed. Since the left-most bit is 0, it is a positive number. Hence we consider the entire exponent as it is. Here, the value of 000 in binary = 0 in decimal. This makes things easy. We do not have to touch the decimal point in this case since 10^0 = 1. Some examples : If the value of exponent was 010, we would have 010 in binary = 2 in decimal ( Since the left most bit is 0, this is a positive number). And 10^2 = 100. Hence we would have to move the decimal point, 2 positions to the right. If the value of exponent was 110, we need to take get the original number from the 2s complement representation. We do this by considering the first index as negative and all others as positive and adding the corresponding weights. We get, 1* (-4) + 1* (2) + 0* (1) = -4+2 = -2. And 10^-2 = 0.01. Hence we would have to move the decimal point 2 positions to the left. Now back to the original example. Since we have not touched the decimal point at all, we simply have to interpret the original mantissa [which is 1.111 as per the specifications] . Since the left most digit of the mantissa is 1 and since the mantissa is also expressed in a 2s complement form, we can get the decimal values as, -1 * 2^0 +1 * 2^(-1) +1 * 2^(-2) +1 * 2^(-3) ------------------ -1 + 0.5 + 0.25 + 0.125 = -0.125 ------------------ Hope this helps :D
This is the first video I found in youtube that is spoken in English! Wonderful playing amounts.
Really appreciate your explanation, Andy!
Keep up the good work!
you're a godsend Andy
Thank you Andy!
Great video, very helpful. Thank you.
thank god finally a helpful video!!
Thanks man!
Thank you so much, Andy!
Great video
4:37 it should be precision instead of accuracy. anyways good explanation.
Thanks
Its resolution actually. What he is calling range is precision.
Excellent video.
Thanks Michael Knox
17:30 I tried doing 2's comp but I didn't get the same answer
can you show how you did it in a comment?
Let me take a shot at it :)
So the binary number under consideration is : 1.111000 (note that this is a 7 bit binary number, does not make a big difference for this explanation)
We have the following specifications given to us:
a. The mantissa is 4 bits long
b. The exponent is 3 bits long
So from the binary number, we get:
The exponent --> 000
The mantissa --> 1.111
NOTE: Its important to remember that the exponent and the mantissa are both in 2s complement form here. We need to get the decimal value out of this 2s complement floating point number.
We need to convert this 2s complement representation into decimal. Note that, we can get the decimal format of a positive 2s complement number by simply reading it as a binary number. No extra operations are needed.
Since the left-most bit is 0, it is a positive number. Hence we consider the entire exponent as it is. Here, the value of 000 in binary = 0 in decimal. This makes things easy. We do not have to touch the decimal point in this case since 10^0 = 1.
Some examples : If the value of exponent was 010, we would have 010 in binary = 2 in decimal ( Since the left most bit is 0, this is a positive number). And 10^2 = 100. Hence we would have to move the decimal point, 2 positions to the right.
If the value of exponent was 110, we need to take get the original number from the 2s complement representation. We do this by considering the first index as negative and all others as positive and adding the corresponding weights. We get, 1* (-4) + 1* (2) + 0* (1) = -4+2 = -2. And 10^-2 = 0.01. Hence we would have to move the decimal point 2 positions to the left.
Now back to the original example. Since we have not touched the decimal point at all, we simply have to interpret the original mantissa [which is 1.111 as per the specifications] . Since the left most digit of the mantissa is 1 and since the mantissa is also expressed in a 2s complement form, we can get the decimal values as,
-1 * 2^0
+1 * 2^(-1)
+1 * 2^(-2)
+1 * 2^(-3)
------------------
-1 + 0.5 + 0.25 + 0.125 = -0.125
------------------
Hope this helps :D
Rahul Dharamdasani good effort👍
Thank you
First english person doing spell mistakes 😅
First
Hindi mai ni samjha sakte
English jaruri hai kya
totally poppycocks he blabbers. just disgusting..
Thank you