
Originally Posted by
BooYa
I don't understand how u converted them, i used the table they gave at chapter 1.3 AoA
8000h = 1000 0000 0000 0000 so it's negative
100h = 0001 0000 0000 so it's positive // not 100h = 0110 0110 like u said???
7FFFh = 0111 1111 1111 1111 so it's positive
0FFFFh = 0000 1111 1111 1111 1111 so it should be positive yet it's negative?
0FFFh = 0000 1111 1111 1111 so it's positive
No, you can only have groups of eight binary digits. This is because eight bits make a byte. 0000 1111 1111 1111 1111 is 2.5 bytes, but the computer can only read one byte at a time so this is unrealistic, even if it is mathematically possible.
Here let me help you with the conversion. We will take it slow:
In decimal form: 90 = 9 groups of 10
90 also equals
9 * 10^1 = 90 That is 10 to the first power equals ten, so 9 * 10 = 90. You see every subsequent digit is multiplied by a power of ten. So
999 = (9 * 10^2) + (9 * 10^1) + (9* 10^0) = 900 + 90 + 9 = 999
So see a binary number would work the same way except every subsequent digit would be a multiple of 2 to what every power corresponds to the digits place. So
0001 = (1 * 2^0) = 1
0011 = (1*2^1) + (1*2^0) = 2 + 1 = 3
0111 = (1*2^2) + (1*2^1) + (1*2^0) = 4 + 2 + 1 = 7
finally
1111 = (1*2^3) + (1*2^2) + (1*2^1) + (1*2^0) = 8 + 4 + 2 + 1 = 15
Ok now that that's out of the way the conversion from hex to decimal also follows the same process:
Fh = 15 * 16^0 = 15
FFh = (15*16^1) + (15*16^0) = 240 + 15 = 255
Now before we go too far with hex conversions you should know that converting hex to binary is extremely easy, which is why hex was ever created in the first place. look at this:
Fh = 1111 Lol how easy was that
FFh = 1111 1111 See peice of cake
What about a digit other then F....
88h = 1000 1000 See I knew that 8 = 2^3 power So the 3rd bit must be 1 in each of these Nibbles (that is groups of 4 bits are commonly referred to as nibbles)
I hope this helped some. here try converting this to hex and then decimal:
0001 0001 =