0% found this document useful (0 votes)
104 views

The Binary Number System

The document discusses binary, decimal, and hexadecimal number systems. It explains how to convert numbers between these number bases using place value. Binary uses base-2 place values, with digits of 0 and 1. Hexadecimal uses base-16 place values, with digits of 0-9 and A-F. Conversion between bases involves identifying the place value of each digit based on its position.

Uploaded by

kndnew guade
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

The Binary Number System

The document discusses binary, decimal, and hexadecimal number systems. It explains how to convert numbers between these number bases using place value. Binary uses base-2 place values, with digits of 0 and 1. Hexadecimal uses base-16 place values, with digits of 0-9 and A-F. Conversion between bases involves identifying the place value of each digit based on its position.

Uploaded by

kndnew guade
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

THE BINARY NUMBER SYSTEM

Dr. Robert P. Webber, Longwood University

Our civilization uses the base 10 or decimal place value system. Each digit in a number
represents a power of 10. For example, 365.42 means

3*102  6*101  5*100  4*101  2*102

In general, think of the place values as powers of 10.


... __ __ __ __ . __ __ ...
1
10 3
10 2
10 1
10 0
10 102

There is nothing sacred about base 10. We could just as well use base 2, also called
binary.
... __ __ __ __ . __ __ ...
23 22 21 20 21 22

For example, 1101.1 is a binary number. It means

1*23  1*22  0*22  1*21  1*21 = 8 + 4 + 1 + ½ = 13 ½ (base 10)

That is, 1101.12 = 13.510, where the subscript indicates the base.

In general, to convert binary to decimal, just expand out using place values. Try
converting 10110102 to base 10. Did you get 90?

To convert a base 10 integer to binary, think of filling in blanks in the binary place value
chart, starting as far left as possible. That is, pull out the largest power of 2 possible
from the integer. Subtract it from the original number, and repeat with the remainder.
Continue until the remainder is 0 or 1.

Example: Convert 8510 to binary.

Solution: 64 ( = 26) is the largest power of 2 that is less than or equal to 85. Put 1 in
the 64’s place and subtract it off.

1
85 – 64 = 21
26 25 24 23 22 21 20
Repeat, this time using 21. The largest power of 2 less than or equal to 21 is 16 (=23).
Put 1 in the 16’s position and subtract it off. Note that this also requires us to put 0 in
the 32’s position!

1 0 1
21 – 16 = 5
26 25 24 23 22 21 20

Continuing, 5 – 4 = 1. Put 1 in the 4’s position (and 0 in the 8’s position).

1 0 1 0 1
5–4=1
26 25 24 23 22 21 20

Since the remainder is 1, put 1 in the 1’s position (and 0 in the 2’s position).

1 0 1 0 1 0 1
26 25 24 23 22 21 20

That is, 8510 = 10101012.

Try counting in binary, starting with 0. Do you get 0, 1, 10, 11, 100, 101, 110, 111,
1000, …?

To convert a base 10 fraction to binary, assume that the denominator is a power of 2.


Other fractions are beyond the scope of these notes.

With that assumption, write the integer numerator in binary, write the denominator as a
power of 2, and shift the binary point left the number of places indicated by the
exponent.

5
Example: Convert to binary.
8

Solution: First, 510 = 4 + 1 = 1012. Since 8 = 23, shift the binary point three places to
5 5
the left.  3  .1012
8 2

Convert a mixed base 10 number to base 2 by writing the mixed number as an improper
fraction and proceeding as above.

Example: Convert 17 ¼ to base 2.

Solution: 17 ¼ = 69/4 . Now 69 = 64 + 4 + 1, so 6910 = 10001012 . Next, since 4 = 22 ,


move the binary point two places to the left. Thus 17 ¼ = 10001.012 .
BASE 16 (HEXADECIMAL) NUMBERS

Just as we use base 10 and base 2 place values, we could use other bases. In particular,
base 16, also called hexadecimal, is used frequently in computer science.
... __ __ __ __ . __ __ ...
163 162 161 160 161 162

Since 162 = 256, 163 = 4096, and so on, hexadecimal place values increase rapidly!

Convert between base 10 and base 16 as we did earlier with binary.

Example: Convert 15816 to decimal.

Solution: 15816 = 1*162 + 5*16 + 8

= 256 + 80 + 8

= 34410

Example: Convert 64310 to base 16.

Solution: 64310 = 2*256 + 131

= 2*256 + 8*16 + 3

= 2*162 + 8*161 + 3*160 = 28316

A problem arises when we try to count in hexadecimal. What comes after 9?

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ?

What should be the tenth positive integer? It cannot be written as 10, because

1016 = 1*16 + 0 = 1610

We must have another symbol for the tenth digit. A little thought should convince you
that we need symbols for the eleventh through the fifteenth digit, too. This will give 16
digits in all, including 0. As a general principle, base n requires n digits, including 0.
Each digit must be a single symbol. The common agreement in mathematics is to use the
letters A, B, C, D, E, and F as the new symbols.

Base 2 digits: 0, 1 (A bit is a binary digit)


Base 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Base 8 digits: 0, 1, 2, 3, 4, 5, 6, 7

Base 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Example: Convert 10A316 to base 10.

Solution: 10A316 = 1*163 + 0*162 + A*161 + 3*160

= 1*4096 + 10*16 + 3*1

= 4096 + 160 + 3 = 425910

Use the extended set of digits as needed to convert decimal to base 16.

Example: Convert 44510 to hexadecimal.

Solution: 44510 = 1*256 + 189

= 1*256 + 11*16 + 13

= 1*162 + B*161 + D*160 = 1BD16

Converting between base 16 and base 2 is particularly useful. You can do this by going
through base 10, of course, but it is much quicker to convert directly. Since 16 = 24, one
hexadecimal digit is the equivalent of four binary digits. To convert from base 2 to base
16, just group the base 2 bits by fours, starting on the right. Convert each group of four
bits to its equivalent digit in base 16.

Example: Convert 10110110012 to hexadecimal.

Solution: Group the bits by fours, starting on the right. For emphasis, write two leading
zeros to round out the first group of bits.

1011011001 = 0010 1101 1001

Now 00102 = 216, 11012 = 1310 = D16, and 10012 = 916 , so 10110110012 = 2D916 .

Example: Convert B60516 to base 2.

Solution: Expand each hexadecimal digit to its four-bit binary form.

B16 = 1110 = 10112, 616 = 01102, 016 = 00002, 516 = 01012.

Therefore, B60516 = 10110110000001012


EXERCISES

1. Convert the binary numbers to decimal.

a. 10110
b. 11100111
c. 101.011

2. Convert the decimal numbers to binary.

a. 86
b. 131
5
c. 14
8

3. Convert the base 10 numbers to hexadecimal.

a. 68
b. 543
c. 127

4. Convert the hexadecimal numbers to decimal.

a. 10D
b. 345
c. BABE

5. Convert the base 16 numbers to binary.

a. 53
b. 94B0
c. 3ED

6. Convert the binary numbers to hexadecimal.

a. 1010 0101
b. 0011 0000 1101 1111
c. 1001 0111 0110 1000

7. Convert the base 10 number 36 to

a. binary
b. hexadecimal

8. Convert the binary number 1000 1010 to


a. hexadecimal
b. decimal

9. Convert the base 16 number 3C5 to

a. binary
b. base 10

10. Convert the base 10 number 130.4375 to binary.

11. Convert the binary number 1001101.1001 to decimal.

12. Convert the hexadecimal number A2.4 to base 10.

You might also like