Opening the calculator to do such tiny stuff appears annoying to me ,and I strongly believe in ths saying "the more you know,the better!" so here I am asking you how to convert hexadecimal to decimal.
Till that moment I use the following formula:
Hex: Decimal:
12 12+6
22 22+2*6
34 34+3*6
49 49+4*6
99 99+9*6
I get confused when I move on at higher numbers like C0 or FB
What is the formula(brain,not functional) that you're using?
If you consider that hexadecimal is base 16, its actually quite easy: Start from the least significant digit and work towards the most significant (right to left) and multiply the digit with increasing powers of 16, then sum the result. NOTE: This is good only if you need to convert 2 digit hexadecimals.
Hexadecimal allows humans to interact with binary in a human readable form. Hexadecimal is compact and easy for humans to read. Large numbers can be represented in a smaller number of digits, making them easier and more accurately read by humans. Hexadecimal can be easily converted to binary and vice verse.
If you consider that hexadecimal is base 16, its actually quite easy:
Start from the least significant digit and work towards the most significant (right to left) and multiply the digit with increasing powers of 16, then sum the result.
For example:
0x12 = 2 + (1 * 16) = 18
0x99 = 9 + (9 * 16) = 153
Then, remember that A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15
So,
0xFB = 11 + (15 * 16) = 251
That's not the formula.. that's not even somewhat like the formula...
The formula is:
X*16^y where X is the number you want to convert and y is the position for the number (from right to left).
So.. if you want to convert DA145 to decimal would be..
(5 * 16^0) + (4 * 16^1) + (1 * 16^2) + (10 * 16^3) + (13 * 16^4)
And you have to remember that the letter are:
A - 10
B - 11
C - 12
D - 13
E - 14
F - 15
I pretty much stopped doing this when I found the hex numbers I was working with were 32 bits. Not much fun there.
For smaller numbers, I (eventually) memorized some patterns: 10 = 16, 20 = 32, 40 = 64, 80 = 128 (because 100 = 256, and 80 is one bit less). 200 = 512 I remember because of some machine I used to use whose page size was 512 (no longer remember what machine!). 1000 = 4096 because that's another machine's page size.
also, 64=100, 32=50, B8=200
That's about all. Beyond that, I add.
For the record, your brain does use a functional method of finding the answer. Here's the function my brain uses to find the value of a hexadecimal number:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With