Sei sulla pagina 1di 3

Where, How, and Why is it used on

Computers?
Copyright © 1996, 1999, 2000, 2002, 2004, 2011 by Daniel B. Sedory

Introduction

"Hexa... What?" Well, that's hexa- (six) plus decimal (ten),


or sixteen.
It stands for the Base 16 Number System. Programmers often
refer to it assimply, Hex (which by itself should mean only six,
such as the number of sides that a "Hex wrench" has, but it
almost always means Hexadecimal if the subject is computer
software rather than hardware).

You may already know that Binary (or Base 2) is what


computers actually use to carry out
calculations. Octal is Base 8, and Decimal, of course,
is Base10. And just as we have ten digits, 0 through 9, in the
Decimal system, there are sixteen digits we could use
for Hexadecimal (0-9 and six more).

The Basics of Hex


The following tables show how the first six letters of
the Latin alphabet (which are the same for
most European languages; including English) are used
assymbols in Hex so we can have a total
of 16 Hexadecimal digits. Though it's now standard practice to
use the capitals A through F (or lower-case forms if their
meaning is unambiguous) to symbolize
the Tenth through Sixteenth digits of the Hexadecimal Number
System, remember, this is only a convention; any other set of
6 symbols (such as letters from Arabic, Korean or Japanese)
could function in the same way; as well as any other symbols
could for the Decimals 0-9.
Hexadecimal Decimal | Hexadecimal Decimal
------------- ----------- | ----------- -------
0 through 9 0 through 9 |
| 1D (1 x 16) + 13 = 29
A ( 9 + 1 = ) 10 | 1E " + 14 = 30
B ( 9 + 2 = ) 11 | 1F " + 15 = 31
C ( 9 + 3 = ) 12 | 20 (2 x 16) + 0 = 32
D ( 9 + 4 = ) 13 | 21 " + 1 = 33
E ( 9 + 5 = ) 14 | 22 " + 2 = 34
F ( 9 + 6 = ) 15 | 23 " + 3 = 35
10 (1 x 16) + 0 = 16 | 24 " + 4 = 36
11 (1 x 16) + 1 = 17 | 25 " + 5 = 37
12 " + 2 = 18 | 26 " + 6 = 38
13 " + 3 = 19 | 27 " + 7 = 39
14 " + 4 = 20 | 28 " + 8 = 40
15 " + 5 = 21 | 29 " + 9 = 41
16 " + 6 = 22 | 2A " + 10 = 42
17 " + 7 = 23 | 2B " + 11 = 43
18 " + 8 = 24 | 2C " + 12 = 44
19 " + 9 = 25 | 2D " + 13 = 45
1A " + 10 = 26 | 2E " + 14 = 46
1B " + 11 = 27 | 2F " + 15 = 47
1C " + 12 = 28 | 30 (3 x 16) + 0 = 48

Just as the location of the digits in a Decimal number


represent the amount of ones, tens, hundreds, thousands, etc.
in that number; which are thepowers of 10. In a similar way,
the digits in a Hex number stand for theones, sixteens (16 to
the power of 1), how many 256s (16 to the power of2), the
amount of 4096s (16 to the power of 3), etc. in its numbers.

The following table includes some important(*) Hex numbers


in the PCindustry; such as 200h (a small h, or capital H, at
the end of a number means it's a Hexadecimal number; to
prevent it from being mistaken as a Decimal number).

Hexadecimal Decimal Hexadecimal Decimal


----------- ------- ----------- -------
30 (3x16) + 0 = 48 | 100 (1x256) = 256
40 (4x16) + 0 = 64 |(*) 200 (2x256) = 512
50 (5x16) + 0 = 80 | 400 (4x256) = 1024
64 (6x16) + 4 = 100 | 500 (5x256) = 1280
(*) 7F (7x16) +15 = 127 | 800 (8x256) = 2048
80 (8x16) + 0 = 128 | A00 (10x256) = 2560
90 (9x16) + 0 = 144 | FFF 4095
9F (9x16) +15 = 159 | 1000 (1x4096) = 4096
A0 (10x16) + 0 = 160 | 4000 (4x4096) = 16,384
B0 (11x16) + 0 = 176 | 5000 (5x4096) = 20,480
F0 (15x16) + 0 = 240 | 8000 (8x4096) = 32,768
(*) FF (15x16) +15 = 255 |(*) FFFF 65,535

FFFFh = (15x4096) + (15x256) + (15x16) + 15 = 65,535 ;


which is the largest value that can be represented within
sixteen Binary digits.

Potrebbero piacerti anche