**Home** / **binary numbers to text** / BINARY NUMBER SYSTEM - Ed Thelen

BINARY NUMBER SYSTEM 4

An understanding of the binary number system is necessary before proceeding

with a further examination of LGP-21 programming concepts. Each digit of a

decimal number has a multiplier associated with it. Take, for example, the

number 237.

Multipliers: etc. c- 1000 loo IO

Digits: 2 3 ;

Starting with the least significant digit (first digit to the left of the decimal

m

point) the associated multiplier is 1 (or 10'); moving one place to the left, the

t

a

pl

ultiplier is 10 (or lo'), then 100 (or 102), 1000 (or 103), etc. The multi-

iers, starting with the least significant digit and moving to the left, are con-

secutively higher powers of 10. The number 237, then means:

7 ones plus 7x l= 7

2

3 tens plus 3 x lo= 3 0

one hundreds 2 x 100 = 200

Total 237

The binary number system is similar to the decimal system, with two impor-

d

p

ant differences. First, the multipliers starting with the least significant

2

igit and moving to the left are consecutively higher powers of 2: 1 (or 2'),

p

os

n

(or 21), 4 (or 22), 8 (or 23), etc. The second difference is that any digit

os

ition may contain only a 0 or 1, whereas, in the decimal system, any digit

um

ition may contain 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. An example of a binary

ber, then, is

Multipliers: etc. c- 126 64 32 16 6 4 2

Digits: 1 1 1 0 1 1 0 i

This binary number, 11101101,is constructed just like the decimal number 237,

bove.

By adding the respective multiplier values for each binary digit, starting with

the least significant digit, we find that

1x1 = 1

0x2 = 0

1x4 = 4

0

1x8 = 8

l

lx

l

x16 = 0

x 6

32 = 32

x 12

4 = 64

8 = 128

237

Thus, the decimal number 237 is equivalent to 11101101 in binary. The decimal

u

system is based on 10 digits, and the binary system on 2. The standard notation

co

sed to specify the base of a number is a subscript. Therefore, the equivalence

uld be written:

237 10 = 111011012

To convert a binary number to its decimal equivalent, write the multipliersabove

l

each of the binary digits, then total all the multipliers that have the digit "lft be-

ow them. For example, find the decimal equivalent of 110000110102:

4-1

t

i

n

10214 5112 2 506 1206 604 302 161 61 40 21 b

1024

512

16

8

2

156210 = 110000110102

One way to convert a decimal integer (whole number) to its binary equivalent is

d

p

o divide the number by 2. The remainder becomes the least significant binary

s

igit; the quotient (e.g. , 237 + 2 gives a quotient of 118 and a remainder of 1)

ro

la

again divided by 2 and the remainder becomes the next binary digit. This

um

cess continues until the quotient is zero. The remainders become the binary

st

ber, where the first remainder is the least significant binary digit and the

remainder is the most significant (far left) binary digit.

Example: Convert 23710 to its binary equivalent.

Quotient Remainder

2)

21118 1 least significant

21 0

21 1

21 1

21 0

21 1

21 1

0 1 most significant

Therefore, 23710 q 111011012.

In the decimal system the digits to the right of the decimal point (fractions)also

have multipliers. Take, for example, the number .6875:

h

Multipliers: I/IO l/l00 l/IWO 1/10,000--t etc.

Digits: 6 8 7 5

The most significant fractional digit (first digit to the right of the decimal point)

p

is

se

as a multiplier of l/10 (or 10-l); moving one place to the right, the multiplier

lie

se

l/100 (or lo-2), then l/1000 (or 10Y3), l/10,000 (or 10W4), etc. The multi-

cu

rs, starting with the most significant digit and moving to the right, are con-

rie

tively lower powers of 10. The number .6875, therefore, constitutes a

s of additions, as follows:

6x1/10 = .6

7

8 x l/100 = .08

5 x

x l/1000 = .007

1/10000 = .0005

.6875

Again, the binary system works similarly. The multipliers, starting with the

p

most significant fractional digit and moving to the right, are consecutively lower

A

owers of 2, namely l/2 (or 2-l), l/4 (or 2-2), l/8 (or 2-3), l/16 (or 2-4), etc.

tio

gain, a digit position can only contain a 0 or a 1. An example of a binary frac-

n is

Multipliers: l/2 l/4 l/6 Vl6UetC.

Digits: .l 0 1 1

To convert a binary fraction to its decimal equivalent, the multiplier values

of the binary fraction are added again, just as in the decimal example:

42

1 x 1 / 2 - .50

1

0x1/4 = . o o

1

x1/8 = .125

x l/16 - .0625

.6875

Therefore, . 687510 = . loll2

One way to convert a decimal fraction to its binary equivalent is to multiply

t

successively by 2, ignoring any digit to the left of the decimal point in the mul-

iplicand, when performing the successive multiplications.

Example: Convert .687510 to its binary equivalent.

b

m

.6875

1x37 50

2

X 2 (ignoring the ftlll to the left of the point in the

0.7500

1x5000

multiplicand)

2

X 2 (ignoring the "lY to the left of the point in the

1.0000

multiplicand)

Continue until there are all zeros to the right of the decimal point, as on the last

w

it

of

ultiplication above, or until the number of multiplicands equals the number of

ri

s to the right of the binary point in the number. Going back to the first result,

t

te down the digits to the left of the point in each product; place a point in front

hese to get the binary equivalent of the decimal number.

Therefore, .687510 = ,,10112

In the decimal system this is called a decimal point; in the binary system, a binar:

t

point. The binary point is usually represented as a caret (A). Also in binary

It

erminology, the word "bit" is often used synonymously with "binary digit"-thus,

a 32 bit number" and `Ia 32 digit binary number" are the same thing.

ADDITION IN BINARY Addition is the same as in the decimal system, except, 1 + 1 = 0 with a 1

carried.

Examples: 1 10 11 111

+1 +1 +1 + 11

10 11 100 1010

. SUBTRACTION Subtraction is also the same as in decimal, except, 0 -1 = 1 with a 1 borrowed:

IN BINARY a

i.e. borrow 1 from the left and add 2 to the digit on the right, just as you would

dd 10 if working in decimal.

Examples 1 0 10 1010 100

0 -1 - 00 1 -1 1.-1111 -111

How many binary numbers are there in counting?The first number in counting is 1, of course. Since we can use no digit higher than 1, we must go to two digits and write 10 for the second binary number. Then comes 11, and after that we must go to three digits and write 100. • Binary numbers as written in the table form the natural binary numbering system.

Creator: Acrobat Capture Server 2.01

Producer:

CreationDate: Sat May 27 00:38:21 2000

ModDate: Sat May 27 00:38:51 2000

Tagged: no

Form: none

Pages: 14

Encrypted: no

Page size: 611 x 843 pts (rotated 0 degrees)

File size: 213608 bytes

Optimized: yes

PDF version: 1.2