Wednesday, 8 December 2010

Hexadecimal

Another way to represent numbers in addition to binary and denary (base 10) is through using hexadecimal.  This system is often used to represent machine code or binary op-codes, and the digits 0-9 retain their normal meanings when used as integers, but letters A-F represent the numbers 10 to 15.  Each hexadecimal letter is worth 16 times what that digit would have been worth one place to the right.  For example, AA would equal 170 (16x10 + 10).

Worked example: 212

Converted into binary, 212 = 11010100.  Next we look at the first four and last four digits of this binary number separately.  The first four which represent 208, which is 13 x 16.  The other four represent 4.  As such this number becomes D4.

No comments:

Post a Comment