Left Border Content - RF Cafe   About RF Cafe Copyright: 1996 - 2024Webmaster:    Kirt Blattenberger,     BSEE - KB3UON RF Cafe began life in 1996 as "RF Tools" in an AOL screen name web space totaling 2 MB. Its primary purpose was to provide me with ready access to commonly needed formulas and reference material while performing my work as an RF system and circuit design engineer. The World Wide Web (Internet) was largely an unknown entity at the time and bandwidth was a scarce commodity. Dial-up modems blazed along at 14.4 kbps while typing up your telephone line, and a nice lady's voice announced "You've Got Mail" when a new message arrived... All trademarks, copyrights, patents, and other rights of ownership to images and text used on the RF Cafe website are hereby acknowledged. My Hobby Website: AirplanesAndRockets.com
Header Region - RF Cafe Sub-Header - RF Cafe # Module 13 - Introduction to Number Systems and LogicNavy Electricity and Electronics Training Series (NEETS)Chapter 1:  Pages 1-11 through 1-20

Module 13 - Introduction to Number Systems and Logic

Table 1-2. - Decimal and Binary Comparison MSD and LSD

When you're determining the MSD and LSD for binary numbers, use the same guidelines you used with the decimal system. As you read from left to right, the first nonzero digit you encounter is the MSD, and the last nonzero digit is the LSD. If the number is a whole number, then the first digit to the left of the radix point is the LSD. 1-11

Here, as in the decimal system, the MSD is the digit that will have the most effect on the number; the LSD is the digit that will have the least effect on the number.

The two numerals of the binary system (1 and 0) can easily be represented by many electrical or electronic devices. For example, 12  may be indicated when a device is active (on), and 02 may be indicated when a device is nonactive (off). Figure 1-1. - Binary Example

Look at the preceding figure. It illustrates a very simple binary counting device. Notice that 12 is indicated by a lighted lamp and 02 is indicated by an unlighted lamp. The reverse will work equally well. The unlighted state of the lamp can be used to represent a binary 1 condition, and the lighted state can represent the binary 0 condition. Both methods are used in digital computer applications. Many other devices are used to represent binary conditions. They include switches, relays, diodes, transistors, and integrated circuits (ICs).

Addition of Binary Numbers

Addition of binary numbers is basically the same as addition of decimal numbers. Each system has an augend, an addend, a sum, and carries. The following example will refresh your memory: Since only two symbols, 0 and 1, are used with the binary system, only four combinations of addition are possible.

0 + 0

1 + 0

0 + 1

1 + 1

1-12

The sum of each of the first three combinations is obvious:

0 + 0 = 02

0 + 1 = 12

1 + 0 = 12

The fourth combination presents a different situation. The sum of 1 and 1 in any other number system is 2, but the numeral 2 does not exist in the binary system. Therefore, the sum of 12  and 12 is 102 (spoken as one zero base two), which is equal to 210. Study the following examples using the four combinations mentioned above:  When a carry is produced, it is noted in the column of the next higher value or in the column immediately to the left of the one that produced the carry.

Example: Add 10112  and 11012.

Solution: Write out the problem as shown: As we noted previously, the sum of 1 and 1 is 2, which cannot be expressed as a single digit in the binary system. Therefore, the sum of 1 and 1 produces a carry: 1-13

The following steps, with the carry indicated, show the completion of the addition: When the carry is added, it is marked through to prevent adding it twice.  In the final step the remaining carry is brought down to the sum.

In the following example you will see that more than one carry may be produced by a single column. This is something that does not occur in the decimal system.

Example: Add 12, 12, 12, and 12 The sum of the augend and the first addend is 0 with a carry. The sum of the second and third addends is also 0 with a carry. At this point the solution resembles the following example: The sum of the carries is 0 with a carry, so the sum of the problem is as follows:

1-14 The same situation occurs in the following example: Add 1002, 1012, and 1112 As in the previous example, the sum of the four 1s is 0 with two carries, and the sum of the two carries is 0 with one carry. The final solution will look like this: In the addition of binary numbers, you should remember the following binary addition rules:

1-15 Now practice what you've learned by solving the following problems:

Q9. Q10. Q11. Q12. Q13. 1-16

Q14. Subtraction of Binary Numbers

Now that you are familiar with the addition of binary numbers, subtraction will be easy. The following are the four rules that you must observe when subtracting:

Rule 1:  02  – 02  = 02

Rule 2:  12  – 02  = 12

Rule 3:  02  – 12  = 12

....................................        Rule 4:  12  – 12  = 12..................   with a borrow

The following example (101102  - 11002) demonstrates the four rules of binary subtraction: Rule 4 presents a different situation because you cannot subtract 1 from 0. Since you cannot subtract 1 from 0 and have a positive difference, you must borrow the 1 from the next higher order column of the minuend. The borrow may be indicated as shown below:

1-17 Now observe the following method of borrowing across more than one column in the example, 10002  - 12: Let's practice some subtraction by solving the following problems:

Q15.   Subtract: Q16.   Subtract: Q17.   Subtract: 1-18

Q18.   Subtract: Q19.           Subtract: Q20.           Subtract: Complementary Subtraction

If you do any work with computers, you will soon find out that most digital systems cannot subtract¾they can only add. You are going to need a method of adding that gives the results of subtraction. Does that sound confusing? Really, it is quite simple. A COMPLEMENT is used for our subtractions. A complement is something used to complete something else.

In most number systems you will find two types of complements. The first is the amount necessary to complete a number up to the highest number in the number system. In the decimal system, this would be the difference between a given number and all 9s. This is called the nines complement or the radix-1 or R's-1 complement. As an example, the nines complement of 254 is 999 minus 254, or 745.

The second type of complement is the difference between a number and the next higher power of the number base. As an example, the next higher power of 10 above 999 is 1,000. The difference between 1,000 and 254 is 746. This is called the tens complement in the decimal number system. It is also called the radix or R's complement. We will use complements to subtract. Let's look at the magic of this process. There are three important points we should mention before we start: (1) Never complement the minuend in a problem, (2) always disregard any carry beyond the number of positions of the largest of the original numbers, and (3) add the R's complement of the original subtrahend to the original minuend. This will have the same effect as subtracting the original number. Let's look at a base ten example in which we subtract 38 from 59:

1-19 Now let's look at the number system that most computers use, the binary system. Just as the decimal system, had the nines (R's-1) and tens (R's) complement, the binary system has two types of complement methods. These two types are the ones (R's-1) complement and the twos (R's) complement. The binary system R's-1 complement is the difference between the binary number and all 1s. The R's complement is the difference between the binary number and the next higher power of 2.

Let's look at a quick and easy way to form the R's-1 complement. To do this, change each 1 in the original number to 0 and each 0 in the original number to 1 as has been done in the example below.

10110112

..................           1001002  R's-1 complement

There are two methods of achieving the R's complement. In the first method we perform the R's-1 complement and then add 1. This is much easier than subtracting the original number from the next higher power of 2. If you had subtracted, you would have had to borrow.

Saying it another way, to reach the R's complement of any binary number, change all 1s to 0s and all 0s to 1s, and then add 1.

As an example let's determine the R's complement of 101011012: The second method of obtaining the R's complement will be demonstrated on the binary number 001011011002.

Step 1 - Start with the LSD, working to the MSD, writing the digits as they are up to and including the first one. 1-20

NEETS Table of Contents

Footer - RF Cafe Right Border Content - RF Cafe   Please Support RF Cafe by purchasing my  ridiculously low−priced products, all of which I created. These Are Available for Free