Lab 1.5.9: Converting Numbers Overview: Estimated Time: 25 Minutes Objective

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Lab 1.5.

9: Converting Numbers Overview


Estimated Time: 25 Minutes
Objective
Upon completion of this lab, the student will be able to identify the places in binary and
decimal numbers and know the value of each. Also, the student will work with powers of
ten and relate them to decimal places, as well as work with powers of two and relate
them to binary places. Finally, the student will manually convert between simple binary
numbers and decimal numbers and describe the differences between binary and decimal
number systems.
Equipment
This is a written lab exercise. No equipment is necessary.
Scenario
Having sharp skills in number systems will aid in a career as an IT professional. With the
ability to convert numbers without the use of a calculator, the student will be able to solve
problems that may arise quickly and easily.
Procedures
This lab will help the student learn to work with the binary number system. The student
will convert binary numbers (Base 2) to decimal numbers (Base 10) and then from
decimal to binary. Computers and networking equipment, such as routers, use binary
numbers. A binary number is a series of BITS (short for Binary Digits) that are either ON
(a binary 1) or OFF (a binary 0). They are encoded internally in the PC on microchips and
on the computer motherboard bus as electrical voltages. Understanding binary numbers
and how they relate to decimal numbers is critical to understanding how computers work
internally.
Step 1
The decimal number system is based on powers of ten. This exercise will help to develop
and understand how the decimal number system is constructed. With Base 10, the rightmost place has a value of one (as with Base 2). Each place moving to the left is valued

= 1 ), 10 to the first power is 10


( 10 = 10 ), 10 to the second power is 100 ( 10 = 10 10 = 100 ), ten to the third power
3
is 1000 ( 10 = 1000 ), and so on. Just multiply the number in each place with the value
2
of each place (for example, 400 = 4 10 = 4 100 ). Remember that any number
ten times more. Ten to the zero power is one ( 10
1

(other than zero) to the zero power is one.


The following chart shows how the decimal number system represents the number
352,481. This will help in understanding the binary number system.
Exponent

10

10

10

10

10

10

Expanded

100000

10000

1000

100

10

3 x 100,000

5 x 10,000

2 x 1,000

4 x 100

8 x 10

1x1

Numeral

1 - 5 IT Essentials I v2.0 - Lab 1.5.9

Copyright 2002, Cisco Systems, Inc.

The number 352,481, if read from left to right in expanded decimal form, is (3 x 100,000)
+ (5 x 10,000) + (2 x 1,000) + (4 x 100) + (8 x 10) + (1 x 1), for a total of 352,481 (a sixdigit number).
Here is another way to look at it that makes it easier to add up the decimal number
values:
Position of digit
(from right)

Value of bit position


(10^X or ten to the
power of)

st

10 or 1

nd

10 or 10

rd

10 or 100

th

10 or 1,000

th

10 or 10,000

th

10 or 100,000

1 Decimal Digit

2 Decimal Digit

3 Decimal Digit

4 Decimal Digit

5 Decimal Digit

6 Decimal Digit

Number
value from 0
to 9

Calculation

Decimal Value

1x 1

8 x 10

80

4 x 100

400

2 x 1,000

2,000

5 x 10,000

52,000

3 x 100,000

300,000

Decimal Value (Total


of 6 digits)

352,481

Step 2
Binary means two and each digit in a binary number can only have two values (0 or 1).
Understanding Binary numbers is key to understanding how computers work. The value
of each binary digit, or bit, is based on powers of two.
This exercise will help develop an understanding of powers of two, which is what all
computers and data communications use. With Base 2, the right-most place has a value
of 1 (as with Base 10). Each place moving to the left is valued two times more. Two to the

= 1 ), two to the first power is two ( 21 = 2 ), two to the second


3
power is four ( 2 = 4 ), two to the third power is eight ( 2 = 2 ), and so on. Just multiply
zero power is one ( 2

the number in each place (either a 0 or a 1) by the value of each place (for example,

8 = 2 3 = 1 8 ) and add up the total. Remember that any number (except zero) to the
zero power is one.
Binary Number Conversion Example
The following table shows the detailed calculations (starting from the right side) to convert
the binary number 10011100 into a decimal number.
Position of digit
(from right)
st
1 Binary Digit
nd

Value of bit position


(two to the power of)
0
2 =1

Is bit a One (on)


or a Zero (off)
0

1
2
3

Binary Digit

rd

3 Binary Digit
th

4 Binary Digit
th

5 Binary Digit
th

6 Binary Digit

2 - 5 IT Essentials I v2.0 - Lab 1.5.9

2 =2
2 =4
2 =8

Calculation

Decimal Value

0x1

0x2

1x4

1x8

1 x 16

16

0 x 32

2 = 16
2 = 32

Copyright 2002, Cisco Systems, Inc.

th

7 Binary Digit
th

8 Binary Digit
Decimal Value.
(Sum total of 8 bits)

2 = 64
7

2 = 128

0 x 64

1 x 128

128
156

Step 3
Look at the binary number bit status. If there is a 1 in a given position add the value
shown. If there is a 0 in a given position then do not add it.
Solve for the decimal value.
Exponent
Bit Position
Value
Binary Number Bit

8
128
1

7
64
0

6
32
0

5
16
1

4
8
1

3
4
1

2
2
0

1
1
0

Decimal Value: _____________________________________________________

Exponent
Bit Position
Value
Binary number bit status

8
128
1

7
64
1

6
32
1

5
16
0

4
8
0

3
4
0

2
2
1

1
1
1

Decimal Value: _____________________________________________________

Exponent
Bit Position
Value
Binary number bit status

8
128
0

7
64
1

6
32
1

5
16
1

4
8
0

3
4
0

2
2
0

1
1
0

Decimal Value: _____________________________________________________

Exponent
Bit Position
Value
Binary number bit status

8
128
1

7
64
1

6
32
0

5
16
1

4
8
1

3
4
0

2
2
1

1
1
0

Decimal Value: _____________________________________________________

3 - 5 IT Essentials I v2.0 - Lab 1.5.9

Copyright 2002, Cisco Systems, Inc.

Step 4
Convert the decimal values of 209, 114, 58, and 165 to the binary equivalents. To do this,
look at the decimal value and then subtract binary values starting from 128 (the highest
value binary bit for these number). If the number is larger than 128 then put a 1 in the 128
7

(or 2 ) column. Subtract 128 from the number and then see if there is 64 or greater left
over. If there is, put a one there. Otherwise, put a zero and see if there is 32 or greater
left over. Continue until all eight bits are defined as either a zero or a one.

Exponent
Bit Position
Value
Binary number bit status

8
128

7
64

6
32

5
16

4
8

3
4

2
2

1
1

Binary Value of 209: __________________________________________________

Exponent
Bit Position
Value
Binary number bit status

8
128

7
64

6
32

5
16

4
8

3
4

2
2

1
1

Binary Value of 114: __________________________________________________

Exponent
Bit Position
Value
Binary number bit status

8
128

7
64

6
32

5
16

4
8

3
4

2
2

1
1

Binary Value of 58: __________________________________________________

Exponent
Bit Position
Value
Binary number bit status

8
128

7
64

6
32

5
16

4
8

3
4

2
2

1
1

Binary Value of 165: __________________________________________________

4 - 5 IT Essentials I v2.0 - Lab 1.5.9

Copyright 2002, Cisco Systems, Inc.

Step 5
Check the answers by converting the numbers back to decimal.
Troubleshooting
Learning how to calculate binary numbers without the use of a calculator is an important
skill in the IT Industry. The ability to perform number conversions can save time,
especially in the field where calculators are not always available.
Reflection
Using the system learned to solve decimal to binary conversion, convert the decimal
number 255 to binary.

__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

5 - 5 IT Essentials I v2.0 - Lab 1.5.9

Copyright 2002, Cisco Systems, Inc.

You might also like