|
|
|
Numbers are abstract concepts that we represent with digits from a numbering system. Our number systems are positional systems where each position of a digit signifies a value based on the number base. The base of a number system is arbitrary, except that some bases are more "natural" for some situations. Our most familiar number base is 10 (decimal), probably used because we have 10 fingers (digits). A computer doesn't have 10 fingers (digits) - it has only two: one and zero, because it uses electronic switches that can either be ON (1) or OFF (0). So it's natural to use the base 2 system with computers. (binary number system) Since binary is cryptic and difficult to understand as the digits increase, we use hexadecimal (base 16) as a shorthand notation. It simply groups 4 binary digits and expresses them as a single hex digit (0-9, a-f). The following table shows how you can express the same abstract concept, a number, in three different bases: base 2, base 10 and base 16.
Powers of 2 are: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, ... Powers of 16 are: 16, 256, 4096, 65536, ... Powers of 10 are: 10, 100, 1000, 10000, ... |