Hexadecimal

Most people know what decimal figures are, the majority also know what hexadecimal figures are.
For those few who do not:

The Hexadecimal figure-scope is a 16-base number-table,
and uses the first six letters of the alphabet to count upwards to 10.

As the value 10 in a 16-base table is in fact the value 16 in decimal,
i shall create a little table how decimal figures matches hexadecimal figures:

DecimalHexadecimal
0000
0101
0202
0303
0404
0505
0606
0707
0808
0909
100A
110B
120C
130D
140E
150F
1610

If you learn the above table from the back of your head,
converting decimal figures to hexadecimal and back is a piece of cake, watch below neat tricks:

We define a #xx as decimal and $xx as hexadecimal.

Dec2Hex

To convert a decimal value to a hexadecimal value, you devide the figure by 16.

e.g.:#145 / #16 is #9.xxx, okay, snoop off the extra digits, #9*#16 = #144, #145 - #144 = #1.
If we look up #1 in the Hex table it is identical to the decimal value.
#9* $10 (which is still #16 in decimal) = $90. $90 + $01 = $91.
The hexadecimal figure for #145 is $91.
Next example:#122 / #16 = #7.625, #7* #16 = #112, #122 - #112 = #10,
#10 looked up in the Hex table above is $0A so #7*$10 = $70, $70 + $0A = $7A
If the decimal is lower than 16, simply use your memorised table-value.

Hex2Dec

To be able to calculate a Hexadecimal value to a decimal value,
you simply subtract the last digit from the figure and devide the figure by $10
(if the hex value is not $10 or lower), this amount you multiply by 16
and you add the converted last digit from the hex-table to it.

Okay so:
$233 → $233 - $03 = $230 → $230 / #10 = #23 → #23 *#16 = #368 → $03 = #03 → #368 +#03 = #371?

beeep

Wrong.
$230 / #10 is not #23 since after $90 we do not get $100 but $A0
(and $B0, $C0 and 16 decimal digits after $F0 we get $100),
so we miss #2 x #6 which is #12 * $10. why 6? A to F are six times a hexadecimal full-house.
Okay, but why twice of 6? Because we have twice a $100 range
Again
$233 → $233 - $03 = $230 → $230 / #10 = #23 + #2*#6 = #12+#23=#35
→ #35 *#16 = #560 → $03 = #03 → #560 +#03 = #563

Owh and what about binary to decimal?
Hmmz, it falls outside this scope actually.
But for the true nerds,
I’ll teach you the table of 15 and a quick conversion trick & this is all you get from me.

DecimalBinary
000000
010001
020010
030011
040100
050101
060110
070111
081000
091001
101010
111011
121100
131101
141110
151111


Pick the binary figure you want to convert,
slice it into blocks of four 1′s from low-end to high end (from right to left),
each block can be up to value 15 which is value $0f in hexadecimal.
For any shortcoming of one, two or three binary figures paste the amount of missing zero’s to the high-end

e.g.:
high-end →0b111010110110101011←low end
0b11 1010 1101 1010 1011
pasting another 2 zero’s to the 0b11 high-end block:

Binary00111010110110101011
Decimal0310131011
Hex030A0D0A0B


The hex value for 0b111010110110101011 = $3ADAB

I can do the whole conversion trick from Hex2Dec again, but try to figure out yourself how i got #241067.

And is converting back to binary just as easy as converting to decimal?
Same routine, if you only have a simple calc some notepad and a pencil, this is the only way to go.
Besides a lot of calculators do not support very large bit-ranges.
Currently for me, this is the quickest trick (besides using the scientific part of the M$ calculator)