+Carlos Serrano well, when you convert back to decimal, you will always have to add that 1 because when you are converting FROM again FROM Decimal to IEEE 754 binary, you just remove 1.(you only care about fraction) and if you look at 2:20 , he got that number from pink highlight, that was considered a fraction because it is separated from other exponent and sign number... sorry for late response.
This video is so simple some steps just doesn't make sense without explanation. Like how did he get 127 for bias? And why the p = 3 isn't brought into the next equations? SMH
how would you go about converting to double precision (64 bits)? would you proceed the same way and just fill in the extra slots in the exponent and mantissa with 0's?
When the number is negative and it is in two's complement, do i have to calculate the absolute value of this number first, or is it ok to put only the 1 at the beginning of ieee754?
So I am assuming the spaces are part of the notation? otherwise 100000 or 1000001 and many other things can be the exponent? edit: nvm, I just realize the exponent have to occupy 8 bits even if its 0000 0000
You probably figured this out. But in case someone else was confused...consider what .1 means in base 10. It's in the 10^-1 position ( the 1/10th position). 1*(1/10)=1/10=.1 It works the same way in base 2. .1 in base 2 is 1*2^-1=1/2=.5. In base 2, the places to the right of the decimal place are 1/2, 1/4, 1/8, 1/16, ... and so on. .111 in base 2 is, in base 10, 1/2+1/4+1/8=(4+2+1)/8=7/8=.875. Just remember that for all bases, the places of the number are the powers of the base. In base 10, we have ... 10^3, 10^2, 10^1, 10^0, 10^-1, 10^-2, ... ( 1000, 100, 10, 1, 1/10, 1/100). In base 2, we have ...2^3, 2^2, 2^1, 2^0, 2^-1, 2^-2 ( 8, 4, 2, 1, .5, .25).
Josh Oduyoye I think if you get a negative p that means you must shift your point leftwards. Imagine you ave, like in the example, 1.001... (adding that 1, as the uploader said), you would just shift the point to the left, and the result will be 0.1001... That in terms of computers is a non-normalized number, because its integer part is 0...
Whatever you get for the exponent part, you will always use that number to subtract 127 because in 8 bits the highest is 127 since it's from 0 to 127. In this case, if you have 1000|0010 = 128 + 2 = 130. Use 130 - 127 = 3. The idea of 127 is the same as adding a 1 in front of the fraction portion. It'll always be 1.###.... except in this case you will always subtract 127 because that's the highest it goes in 8 bits.
@@carlosserrano5194 In case you spent last 5 years trying to find answer, here it is. 1, (before the comma) is always there . ,001 (after the comma) is from fraction (bit 0-22)
1000 0010 = 128 + 2 = 130. Remember that it's in base of 2. That's an 8 bit, so it goes from right to left 2^0, 2^1, 2^2, 2^3, 2^4, 2^5, 2^6, 2^7. Because the first four numbers are 1000, we know that is 2^7 (128). The second 4 numbers are 0010, which we know that is 2^1 (2). Remember that we ignore the 0. Therefore, 128 + 2 = 130
suppose no. given was : 010000000 11000000 0000 0000 0000 0000 then as per my calculations P=1 ..., so in 1.1100000..... i shifted one decimal which gives me 11.100000..... so deciaml representation of (11) is 3 but answer is given 3.5
I know it is too late for you but for new person ... The answer is, to the left of "." you will have 2^-1, 2^-2 ... so you have 11 (equals 3) + 2^-1 (equal 0.5). The final result is 3.5.