A NUMBER SYSTEM USED WITH COMPUTERS The Binary

advertisement
A NUMBER SYSTEM USED WITH COMPUTERS
The Binary Number System
Modern computers convert information in the form of numbers, letters, and special
characters into electrical impulses, which can have two possible values. This situation
makes the binary number system, a system that includes only two digits, (0 and 1), very
important to an understanding of how computers work.
A number system is a code that uses symbols to refer to a number of items. The
decimal number system uses the symbols, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The decimal
number system contains 10 symbols and is sometimes called the base 10 system. The
binary number system uses only two symbols, 0 and 1, and is sometimes called the base
2 system.
Both number systems use the idea of place value to represent numbers larger than the
number of symbols in the system. Consider the decimal number 359. The digit 3
represents 300 because of its placement three positions to the left of the decimal point.
The digit 5 represent 50 because of its placement two positions to the left. The digit 9
represents nine because of its placement one position to the left of the decimal point.
The total number 359 then, represent three hundred and fifth-nine units. This is an
example of place value in the decimal number system.
359
=
Hundreds
300
+
Tens
50
+
Ones
9
. decimal point
The binary number system also uses the idea of place value. Place values in the binary
number system are shown below.
512s
256s
128s
64s
32s
16s
8s
4s
2s
1s
. binary point
Notice that each place value is determined by multiplying the one to the right by 2. The
term Òbase 2Ó for binary comes from this idea.
Using place values the value of the binary number 1010 (say Òone zero one zeroÓ) can
be determined.
1010
=
Eights
8
+
Fours
0
+
Twos
2
+
Ones
0
The binary number 1010, then represent 10 units.
The value of the binary number 11001 can be determined the same way.
11001 =
Sixteens Eights
16
+
8
+
Fours
0
+
The binary number 11001, then represents 25 units.
Twos
Ones
0
+
1
Below is a list of the binary equivalent of the first 16 decimal numbers.
Binary
Decimal
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Binary to Decimal Conversion
While working with computers it is sometimes necessary to convert from the binary
code to decimal numbers. If you are given a binary number the decimal equivalence
can be determined by the following method. Start at the binary point and work to the
left. For each binary 1, place the decimal value of the position below the binary digit.
Add the decimal numbers to find the decimal equivalent.
The example below is worked out for the binary number 101110.
Binary
1
0
Decimal
32 + 0 +
1
8
1
+
4 +
1
2 +
0
0
. binary point
=
46
Decimal to Binary Conversion
Many times while working with computers you must be able to convert a decimal
number to a binary number. One method of doing this is to divide the decimal number
by two, write down the remainder (which will always be 1 or 0), divide the quotient of
the first division by two and write down its remainder and continue until you end up
with a final quotient of 0 or 1. This final quotient becomes the last remainder, and
when all the remainders are lined up in reverse order you have the binary equivalent of
the decimal number. Below is an example of this method for determining the binary
equivalent of the decimal number 34.
2
Quotients
Remainders
34 / 2
17 / 2
8 /2
4/2
2/2
17
8
4
2
1
=
=
=
=
=
0
1
0
0
0
1
1s
2s
4s
8s
16s
32s
This would give 100010 as the binary equivalence of the decimal number 34.
One more example, determining the binary equivalent of the decimal number 22.
Quotients
Remainders
22 / 2
11 / 2
5/2
2/2
11
5
2
1
=
=
=
=
0
1
1
0
1
1s
2s
4s
8s
16s
This would give 10110 as the binary equivalence of the decimal number 22.
PRACTICE PROBLEMS WITH NUMBER SYSTEMS
Convert the following binary numbers to decimals
a.
b.
c.
d.
1001
11111111
10000000
01010101
Convert the following decimal numbers to binary
a.
b.
c.
d.
68
128
100
111
3
Download