Number Systems Benchmark Companies Inc PO Box Aurora CO 80047
Decimal Binary Hexadecimal Octal Binary Coded Decimal (BCD) Number Systems:
The Decimal System 10 digits: Counting beyond 9 requires additional place values to begin. This will go on to infinity: i.e. … 8,9,10,11……98,99,100,101…999,1000,... The decimal system is a base 10 (modulo 10) number system:
The Decimal System Counting beyond 9 requires additional place values as powers of 10: ______ ______ ______ ______ ______. _____ (10 4 ) (10 3 ) (10 2 ) (10 1 ) (10 0 ). (10 -1 ) 1 w/4 0’s 1 w/3 0’s 1 w/2 0’s 1 w/1 0’s 1 w/0 0’s.
The Binary System: 2 digits: 0 or 1 (in digital terms, logic 0 or logic 1) Counting beyond 1 requires additional place values. This will go on to infinity: i.e. 0,1,10,11,100,101,110,111,1000,1001,... The Binary System is a base 2 (mod 2) number system:
The Binary System: 2 digits: 0 or 1 (in digital terms, logic 0 or logic 1) Counting beyond 1 requires additional place values as powers of 2: ______ ______ ______ ______ ______. _____ (2 4 ) (2 3 ) (2 2 ) (2 1 ) (2 0 ). (2 -1 ) The Binary System is a base 2 (mod 2) number system:
Example: Convert to binary. It is important to be able to convert binary to decimal and vice-versa. In this example, convert 37 base 10 to it’s binary (base 2) equivalent number. Base 10 >>> Base 2
Example: Convert to binary. METHOD I: Sum-of-weights: ____ ____ ____ METHOD II: Repeated-division-by-base (here, base 2) 37/2 = 18 remainder of 1 This is your LSB 18/2 = 9 remainder of 0 9/2 = 4 remainder of 1 4/2 = 2 remainder of 0 2/2 = 1 remainder of 0 ½ = 0 remainder of 1 This is your MSB This process gives you the same result: is in binary
Example: Convert to decimal: In this example, convert base 2 to it’s decimal (base 10) equivalent number. Base 2 >>> Base 10
Example: Convert to decimal: Sum-of-weights uses total of each place value: 1x x x x x x2 1 +0x2 0 1x64 + 0x32 + 1x16 + 1x8 + 0x4 + 1x2 + 0x = 90 10
The Hexadecimal System “Hexa” = 6“Decimal” = digits: A b C d E F representing decimal 10 through decimal 15 (use of lower case helps differentiate between b and 8 or d and 0 in a digital display) The Hexadecimal system is a base 16 (mod 16) number system:
Convert to hexadecimal: Sum-of-weights: ____ ____ ____ Check: 3x x1 = = = 3A 16 ***Repeated division-by-base is most effective for larger conversions. 03A
THE SHORTCUT FOR CONVERTING BINARY TO HEXADECIMAL HEXADECIMAL TO BINARY Since there is a relationship between 2 and 16 (2 4 = 16), there is a relationship between the place values in binary and the place values in hexadecimal – look for groups of 4 instead of 3. Example: Convert to hexadecimal: = b5 16 Tips for Conversions:
Convert 3F7 16 to binary: *Remember to represent each digit as a 4-bit binary word!* Drop initial 0’s to simplify. 3F7 16 = Tips for Conversions (Continued):
Binary Coded Decimals (BCD) Uses a 4-bit binary representation of each digit in decimal Example: 672 in BCD would be Example: is BCD for 9658 ***In BCD, there will not be values beyond 1001 (decimal 9)