Just a hex headache that came to me
-
well, the calc agreed with me
now this is a problem, was bored on school earlier, so i managed to get 856 (in hex) to 2134 (in dec)
now how would that be possible?
i got to have 133,37…and that i wont get calculating from 856
i came to this:
85 * 16 = 1360 \ 10 = 136 - 0.6 = 135.4 x 16 = 2166
but that isnt correct either, how could i get that 2134?
-
2134 to hex
8 in that example because you can only get 8 256’s out of 2134
8 x 256 = 2048, 9 x 256 = 2304 which will not fit, so you have
8 (256’s) then you go down to the next magnitude 256/16 = 162134 - 2048 (the 8 x 256 number) leaves 86
In that 86 there are 5 16’s thus your second number
you now have 6 left, equating to the 1 level of magnitude, your last number
so 2134 decimal = 856 hex  (8x256) + (5x16) + (6 x1)
Remember
in decimal 456 represents (4 x 100) + (5 x 10) + (6 x 1)in hexiadecimal
456 represents (4 x 256) + (5 x 16) + (6 x 1) -
why 8x256?
sorry im an idiot ;D
EDIT: yes im aware of hex decimals has to be multiplied by 16
lets convert the following to dec:
0x1111you can convert any hex number in a base-multiply-format in dec, like this:
1111 (hex) = 1x16³ + 1x16² + 1x16¹ + 1x16º (dec)some notes:
16º = 1
16¹ = 16
16² = 256
and so onso, 0x39FB would be
3x16³ + 9x16² + 15x16¹ + 11x16ºsome other notes:
a (hex) = 10
b = 11
c = 12
…
f = 15 -
w0dk4’s method also allows you to convert just about any base to and from any base, such as binary numbers. You simply have to change the number’s base (in this case 16) to the one you want to convert from (in binary that’d be 2). The exponent is the place of the particular number (beginning at 0 for units and growing).
Don’t try to transform floating-point values with that though ;D
-
Uhm… yeah… and in English!!!
Seriously guys, my head hurt just reading that.
-
Now do a few pages of homework on it, Roo. Oh, and throw some hex<->binary and dec<->binary in there for good measure. =P
Also, yeah, the method w0dk4 mentioned is what I learned in my C++ class. Fun fact, but this can also be applied to binary as well - just multiply by 2x instead of 16x. So, 1101 in binary would be: 120 + 021 + 122 + 123 = 13
120 = 1
021 = 0
122 = 4
123 = 8
1+4+8 = 13Now to go actually do my homework.
Edit: Oop, FF already beat me to it. Drat! =P