Number Systems
Some say we came up with the decimal number system because we have 10 fingers! Could be! But the decimal system isn't the only number system. Especially since computers came around, other number systems have come into widespread usage. Since a computer finds it easy to have an electronic circuit be either "on" or "off" (like a light switch), computers like a number system that has only 2 numbers: 0 (off) and 1 (on). So, each binary digit ("bit") in a computer is like a digit in the decimal system. Where the decimal system has the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, the binary system has only 0 and 1. Just as the decimal system has place representations for powers of 10 (1,10, 100, . . .) and for numbers less than 1 (1/10, 1/100, 1/1000 . . .) , the binary system has place representations for each power of 2: (1, 2, 4, 8, 16, . . .) and for numbers less than 1: (1/2, 1/4, 1/8, 1/16 . . .) A number in the binary system is rather boring. They look like this: "0 0 1 0 0 1 1". Each "bit", starting at the right, is a power of 2. For our 7-bit example, the powers of 2 are:
Each 1 or 0 tells you whether that power of 2 is in the number. In our above example, the number is 7 'bits' long and tells you which of the powers of 2 up to 26 are in the number. In our example, we have a 1 in the one's place, a 1 in the 21 place and a 1 in the 24 place. Since 24 is 2x2x2x2 = 16, our number 0010011 is the decimal number 16 + 2 + 1 =19. Get it?
So, our hexadecimal number, 2FE, is, in decimals,    512 + 240 + 14 = 766. Think about it. Our 3-digit hexadecimal number, 2FE is, in binary, 1011111110. 2FE is a lot easier to read and to input. If you were inputting numbers like 1011111110 into the computer it would be easy to miss a 1 and mess that up! A computer doesn't actually do arithmetic in hexadecimal. It just uses it to communicate with the outside world! When you're dealing with more than one number system, you indicate the base of your number with a little subscript. Our example would become:     2FE16 = 10111111102 = 76610 You can see that without that little subscript, a number like 286 would be confusing. It is quite different in decimal or hexadecimal. 286 is a valid number in both systems! It isn't valid in binary because it contains digits other than 0 or 1.     28610 is just 286, where 28616 is 64610 or, if you're interested, 10100001102 There are other number systems out there. Octal, based on the number 8, was used early in the computer world but is no longer used. You could even make up a system based on the number 7 where the number 1667 would be        1 x72 + 6 x71 + 6 x70     =  49    + 42     + 6       = 9710, but it wouldn't be very useful! By the way, if you want to be cool, you call hexadecimal numbers "hex"! |