A system of base-16 notation where the numbers O to 9 and the letters A to F - are used to represent 16 different digits. A hexadecimal digit corresponds to a group of four binary digits, or half a byte - sometimes called a 'nibble'. Each place of a binary number represents 2 (decimal) to the power of x, where x starts at O for the rightmost place and increments by 1 (decimal) as we move left; so 1001 binary, for example, is 1x2^0 + Ox2^1 + Ox2^2 + 1x2^3 = lxl + Ox2 + Ox4 + 1x8 = 9 in decimal. Since the value of a 4-bit group can go up to 15 (decimal), however, in order to represent it as a single digit we need to use base-16 maths (decimal is base 10) . That is, instead of counting up to 9 before rolling over to O and incrementing the place to the left (09 + 1 = 10; 19 + 1 = 20), we continue counting up to l5. Since we don't have any symbols for digits beyond 9, hex notation uses the letters A to F for the numbers 10 to 15. So to count up to 20 in hex we would write: 1,2,3,4,5,6,7,8,9, A,B,C,D,E,F,10,11,12,13,14. The aim of hex is to make it easier (!) for us to handle binary numbers with many digits when we're programming a computer in a low-level language - essential when some micromath can work on binary numbers 16, 32 or more bits in length. The sense of using hex immediately becomes clear when you compare the hex and decimal notations of those familiar values which often crop up in computing: 255 is FF hex; 4,095 is FFF; 65,535 is FFFF
|