Also...

Jun 12, 2009 17:04

Thanks to all of my math-geek and general-geek friends for their answers re: non-base 10 numeric systems!

I was confused by the alphanumic bits, though. Someone care to elucidate in language a two-year-old could grasp? Pretty please? I'll cook for you or something in return!

math is hard; let's go shopping!

Leave a comment

kieferskunk June 16 2009, 16:33:25 UTC
Hehe, cool! Glad to help. :)

In case you're wondering where hexadecimal is useful, it's very useful among computer programmers to represent numbers in a shortened form. I'm sure you've heard of things being "8-bit", "16-bit", etc. A bit is a base-2 number (binary), whose possible values are 0 or 1. 8 of those put together form a byte and are expressed like: 00101101 (which represents the decimal number 53). In hexadecimal, the same number is "2D". (This is sometimes notated as 0x2D - the 0x is just a way of signalling to the computer and/or to whoever's reading the code that it's hexadecimal.)

Every four bits translates to one hexadecimal digit. This makes working with numbers more convenient for programmers when they're concerned about bitwise values, and it compacts the data they're looking at more than converting to base-10. In the above example, the two digits are broken down as follows:

0010 = 2 (base-10) = 2 (hex)

1101 = 13 (base-10) = D (hex)

The first "digit" above has to be computed and added to the second in base-10 to give the actual number represented by all 8 bits. It's difficult to explain this process without going into binary math and/or describing tricky formulas. However, you can immediately see how easy it is to go from binary to hexadecimal. This is part of why this system is so popular among programmers.

Also, numbers that are not inherently meaningful in base-10 can be very meaningful to programmers in hex. 0xFF (255) = binary 11111111. 0xFFFF is 65535 (16 bits all set to 1). And figuring out the binary is much easier going from hex than from decimal: 0xD15F = 1101 0001 0101 1111. The equivalent decimal number (53599) would take a lot more effort to decode.

(edits are to clean up my comment so it displays correctly and so I don't have bad grammar in it. ;))

Reply

ssha June 18 2009, 16:04:58 UTC
Very elucidating, thank you!

I have previously had some basic instruction in how binary works, but have since forgotten almost everything about it.

My brain groks most math & science related things quite well, even post-brain surgeries. The difficulty comes in when I try to do things without paper. I used to be able to do long-division and multi-digit multiplication in my head without a problem. If I try now, I forget too quickly to make any sense of it. Though, I did devise a non-traditional system for doing math in my head that makes things a lot easier, so long as I don't have to remember anything too complex, or too many values at a time.

Reply


Leave a comment

Up