The following table contains a conversion of 2 power some number (2 ^ X), to the corresponding hexadecimal number:
dec hex
2^00 1 1
2^01 2 2
2^02 4 4
2^03 8 8
2^04 16 10
2^05 32 20
2^06 64 40
2^07 128 80
2^08 256 100
2^09 512 200
2^10 1024 400
2^11 2048 800
2^12 4096 1000
2^13 8192 2000
2^14 16384 4000
2^15 32768 8000
2^16 65536 10000
2^17 131072 20000
2^18 262144 40000
2^19 524288 80000
2^20 1048576 100000
2^21 2097152 200000
2^22 4194304 400000
2^23 8388608 800000
2^24 16777216 1000000
2^25 33554432 2000000
2^26 67108864 4000000
2^27 134217728 8000000
2^28 268435456 10000000
2^29 536870912 20000000
dec hex
2^00 1 1
2^01 2 2
2^02 4 4
2^03 8 8
2^04 16 10
2^05 32 20
2^06 64 40
2^07 128 80
2^08 256 100
2^09 512 200
2^10 1024 400
2^11 2048 800
2^12 4096 1000
2^13 8192 2000
2^14 16384 4000
2^15 32768 8000
2^16 65536 10000
2^17 131072 20000
2^18 262144 40000
2^19 524288 80000
2^20 1048576 100000
2^21 2097152 200000
2^22 4194304 400000
2^23 8388608 800000
2^24 16777216 1000000
2^25 33554432 2000000
2^26 67108864 4000000
2^27 134217728 8000000
2^28 268435456 10000000
2^29 536870912 20000000
If you notice, the double of 80 in hex is 100 :)
This table is generated using this C code:
#include "stdio.h"
#include "math.h"
int main()
{
long i, t;
printf("%32s %20s", "dec", "hex");
for (i = 0; i < 30; i++) {
t = pow(2, i);
printf("\n%8s%2.2d %20ld %20X","2^", i, t, t);
if (i%5 == 0) printf("\n");
}
return 0;
}
No comments :
Post a Comment