Module 13  Introduction to Number Systems and Logic
Pages i  ix,
11 to 110,
111 to 120,
121 to 133,
131 to 140,
141 to 150,
151 to 160,
161 to 69,
21 to 210, 211 to 220,
221 to 230,
231 to 236,
31 to 310,
311 to 220,
321 to 330,
331 to 340,
341 to 346, Index
Q76. 110111.010101_{2}. OCTAL CONVERSION The conversion of one number system to another, as we explained earlier, is done to simplify computer programming or interpreting of data. Octal to Binary For some computers to accept octal data, the octal digits must be converted to binary. This process is the reverse of binary to octal conversion. To convert a given octal number to binary, write out the octal number in the following format. We will convert octal 567_{8}: Next, below each octal digit write the corresponding threedigit binarycoded octal equivalent: Solution: 567_{8} equals 101 110 111_{2} Remove the conversion from the format: 101110111_{2} As you gain experience, it may not be necessary to use the block format. An octal fraction (.1238) is converted in the same manner, as shown below: Solution: .123_{8} equals .001010011_{2} Apply these principles to convert mixed numbers as well. Convert 32.25_{8} to binary: 151
Solution: 32.25_{8} equals 011010.010101_{2} Convert the following numbers to binary: Octal to Hex You will probably not run into many occasions that call for the conversion of octal numbers to hex. Should the need arise, conversion is a twostep procedure. Convert the octal number to binary; then convert the binary number to hex. The steps to convert 53.7_{8} to hex are shown below: Regroup the binary digits into groups of four and add zeros where needed to complete groups; then convert the binary to hex. Solution: 53.7_{8} equals 2B.E_{16} Convert the following numbers to hex: HEX CONVERSION The procedures for converting hex numbers to binary and octal are the reverse of the binary and octal conversions to hex. 152
Hex to Binary To convert a hex number to binary, set up the number in the block format you used in earlier conversions. Below each hex digit, write the fourdigit binary equivalent. Observe the following example: Convert ABC_{16} to binary: Solution: ABC_{16} = 101010111100_{2} Hex to Octal Just like the conversion of octal to hex, conversion of hex to octal is a twostep procedure. First, convert the hex number to binary; and second, convert the binary number to octal. Let's use the same example we used above in the hex to binary conversion and convert it to octal: Convert these base 16 numbers to their equivalent base 2 and base 8 numbers: Q87. 23_{16} Q88. 1B_{16} Q89. 0.E4_{16} Q90. 45.A_{16} CONVERSION TO DECIMAL Computer data will have little meaning to you if you are not familiar with the various number systems. It is often necessary to convert those binary, octal, or hex numbers to decimal numbers. The need for understanding is better illustrated by showing you a paycheck printed in binary. A check in the amount of $10,010,101.002 looks impressive but in reality only amounts to $149.0010 153
Binary to Decimal The computer that calculates your pay probably operates with binary numbers, so a conversion takes place in the computer before the amount is printed on your check. Some computers, however, don't automatically convert from binary to decimal. There may be times when you must convert mathematically. To convert a base 2 number to base 10, you must know the decimal equivalent of each power of 2. The decimal value of a power of 2 is obtained by multiplying 2 by itself the number of times indicated by the exponent for whole numbers; for example, 2^{4} = 2 x 2 x 2 x 2 or 16_{10}. For fractional numbers, the decimal value is equal to 1 divided by 2 multiplied by itself the number of times indicated by the exponent. Look at this example: The table below shows a portion of the positions and decimal values of the binary system: Remember, earlier in this chapter you learned that any number to the 0 power is equal to 1_{10}. Another method of determining the decimal value of a position is to multiply the preceding value by 2 for whole numbers and to divide the preceding value by 2 for fractional numbers, as shown below: Let's convert a binary number to decimal by using the positional notation method. First, write out the number to be converted; then, write in the decimal equivalent for each position with a 1 indicated. Add these values to determine the decimal equivalent of the binary number. Look at our example: 154
You may want to write the decimal equivalent for each position as we did in the following example. Add only the values indicated by a 1. You should make sure that the decimal values for each position are properly aligned before adding. For practice let's convert these binary numbers to decimal: Octal to Decimal Conversion of octal numbers to decimal is best done by the positional notation method. This process is the one we used to convert binary numbers to decimal. First, determine the decimal equivalent for each position by multiplying 8 by itself the number of times indicated by the exponent. Set up a bar graph of the positions and values as shown below: 155
To convert an octal number to decimal, write out the number to be converted, placing each digit under the proper position. Example: Next, multiply the decimal equivalent by the corresponding digit of the octal number; then, add this column of figures for the final solution: Solution: 743_{8} is equal to 483_{10} Now follow the conversion of 26525_{8} to decimal: Solution: 11,605_{10} is the decimal equivalent of 26,525_{8} To convert a fraction or a mixed number, simply use the same procedure. Example: Change .5_{8} to decimal: 156
Example: Convert 24.36_{8} to decimal: Solution: 24.36_{8} equals 20.46875_{10} If your prefer or find it easier, you may want to convert the octal number to binary and then to decimal. Convert the following numbers to decimal: Hex to Decimal It is difficult to comprehend the magnitude of a base 16 number until it is presented in base 10; for instance, E0_{16} is equal to 224_{10}. You must remember that usually fewer digits are necessary to represent a decimal value in base 16. When you convert from base 16 to decimal, you may use the positional notation system for the powers of 16 (a bar graph). You can also convert the base 16 number to binary and then convert to base 10. Note in the bar graph below that each power of 16 results in a tremendous increase in the decimal equivalent. Only one negative power (16^{1}) is shown for demonstration purposes: 157
Just as you did with octal conversion, write out the hex number, placing each digit under the appropriate decimal value for that position. Multiply the decimal value by the base 16 digit and add the values. (Convert A through F to their decimal equivalent before multiplying). Let's take a look at an example. Convert 2C_{16} to decimal: The decimal equivalent of 2C_{16} is 44_{10}. Use the same procedure we used with binary and octal to convert base 16 fractions to decimal. If you choose to convert the hex number to binary and then to decimal, the solution will look like this: Convert these base 16 numbers to base 10: Q103. 24_{16} Q104. A5_{16} Q105. DB_{16} 158
Q106. 3E6.5_{16} BINARYCODED DECIMAL In today's technology, you hear a great deal about microprocessors. A microprocessor is an integrated circuit designed for two purposes: data processing and control. Computers and microprocessors both operate on a series of electrical pulses called words. A word can be represented by a binary number such as 10110011_{2}. The word length is described by the number of digits or BITS in the series. A series of four digits would be called a 4bit word and so forth. The most common are 4, 8, and 16bit words. Quite often, these words must use binarycoded decimal inputs. Binarycoded decimal, or BCD, is a method of using binary digits to represent the decimal digits 0 through 9. A decimal digit is represented by four binary digits, as shown below: decimal digit. Since many devices use BCD, knowing how to handle this system is important. You must realize that BCD and binary are not the same. For example, 4910 in binary is 110001_{2}, but 49_{10} in BCD is 01001001_{BCD}. Each decimal digit is converted to its binary equivalent. BCD Conversion You can see by the above table, conversion of decimal to BCD or BCD to decimal is similar to the conversion of hexadecimal to binary and vice versa. For example, let's go through the conversion of 264_{10} to BCD. We'll use the block format that you used in earlier conversions. First, write out the decimal number to be converted; then, below each digit write the BCD equivalent of that digit: 159
The BCD equivalent of 264_{10} is 001001100100_{BCD}. To convert from BCD to decimal, simply reverse the process as shown: BCD Addition The procedures followed in adding BCD are the same as those used in binary. There is, however, the possibility that addition of BCD values will result in invalid totals. The following example shows this: Add 9 and 6 in BCD: The sum 1111_{2} is the binary equivalent of 15_{10}; however, 1111 is not a valid BCD number. You cannot exceed 1001 in BCD, so a correction factor must be made. To do this, you add 610 (0110_{BCD}) to the sum of the two numbers. The "add 6" correction factor is added to any BCD group larger than 1001_{2}. Remember, there is no 1010_{2}, 1011_{2}, 1100_{2}, 1101_{2}, 1110_{2}, or 1111_{2} in BCD: The sum plus the add 6 correction factor can then be converted back to decimal to check the answer. Put any carries that were developed in the add 6 process into a new 4bit word: Now observe the addition of 60_{10} and 55_{10} in BCD: 160
NEETS Table of Contents
 Introduction to Matter, Energy,
and Direct Current
 Introduction to Alternating Current and Transformers
 Introduction to Circuit Protection,
Control, and Measurement
 Introduction to Electrical Conductors, Wiring
Techniques, and Schematic Reading
 Introduction to Generators and Motors
 Introduction to Electronic Emission, Tubes,
and Power Supplies
 Introduction to SolidState Devices and
Power Supplies
 Introduction to Amplifiers
 Introduction to WaveGeneration and WaveShaping
Circuits
 Introduction to Wave Propagation, Transmission
Lines, and Antennas
 Microwave Principles
 Modulation Principles
 Introduction to Number Systems and Logic Circuits
 Introduction to Microelectronics
 Principles of Synchros, Servos, and Gyros
 Introduction to Test Equipment
 RadioFrequency Communications Principles
 Radar Principles
 The Technician's Handbook, Master Glossary
 Test Methods and Practices
 Introduction to Digital Computers
 Magnetic Recording
 Introduction to Fiber Optics
