You are on page 1of 6

Pedagogical and Technological University Of Colombia

Electronics Engineering School


Digital Electronics 1 Course
Laboratory Exercises
Laboratory Exercise 1
The Binary Number System
The purpose of this exercise is to identify the numerical systems: binary, hexadecimal, decimal and BCD, and perform
conversions between the different numerical systems.

Positional Notation
The binary number system is based on the number 2. This means that we can write any number using only two
binary digits (or bits), 0 and 1. Compare this to the decimal system, which is based on the number 10, where we can
write any number with only ten decimal digits, 0 to 9.

The binary and decimal systems are both positional notation systems; the value of a digit in either system depends
on its placement within a number. In the decimal number 845, the digit 4 really means 40, whereas in the number
9426, the digit 4 really means 400 (845= 800 + 40 + 5; 9426= 9000 + 400 + 20 + 6). The value of the digit is
determined by what the digit is as well as where it is. In the decimal system, a digit in the position immediately to the
left of the decimal point is multiplied by 1 (10 ). A digit two positions to the left of the decimal point is multiplied by
0

10 (10 ). A digit in the next position left is multiplied by 100 (102). The positional multipliers, as you move left from
1

the decimal point, are ascending powers of 10.

The same idea applies in the binary system, except that the positional multipliers are powers of 2 (20=1, 21=2, 22 =4,
23=8, 24 =16, 25 =32, . . .). For example, the binary number 101 has the decimal equivalent:

(1x22) + (0x21) + (1x20)


=(1x4) + (0x 2)+(1x1)
= 4+0+1
=5

Key terms
 Most significant bit (MSB): The leftmost bit in a binary number. This bit has the number’s largest positional
multiplier.
 Least significant bit (LSB): The rightmost bit of a binary number. This bit has the number’s smallest positional
multiplier.

Decimal-to-Binary Conversion
There are two methods commonly used to convert decimal numbers to binary: sum of powers of 2 and repeated
division by 2.

Sum of Powers of 2
You can convert a decimal number to binary by adding up powers of 2 by inspection, adding bits as you need them to
fill up the total value of the number. For example, convert 5710 to binary.\

6410 >5710 > 3210

• We see that 32 ( 25) is the largest power of two that is smaller than 57. Set the 32’s bit to 1 and subtract 32 from the
original number, as shown below.
Pedagogical and Technological University Of Colombia
Electronics Engineering School
Digital Electronics 1 Course
Laboratory Exercises

57-32= 25

• The largest power of two that is less than 25 is 16. Set the 16’s bit to 1 and subtract 16 from the accumulated total.

25-16= 9

• 8 is the largest power of two that is less than 9. Set the 8’s bit to 1 and subtract 8 from the total.

9-8=1

• 4 is greater than the remaining total. Set the 4’s bit to 0.


• 2 is greater than the remaining total. Set the 2’s bit to 0.
• 1is left over. Set the 1’s bit to 1 and subtract 1.

1-1= 0

• Conversion is complete when there is nothing left to subtract. Any remaining bits should be set to 0.

Repeated Division by 2
Any decimal number divided by 2 will leave a remainder of 0 or 1. Repeated division by 2 will leave a string of 0s
and 1s that become the binary equivalent of the decimal number.

Let us use this method to convert 4610 to binary.

1. Divide the decimal number by 2 and note the remainder.

46/2 =23+ remainder 0 (LSB)

The remainder is the least significant bit of the binary equivalent of 46.

2. Divide the quotient from the previous division and note the remainder. The remainder is the second LSB.

23/2 =11+ remainder 1

Continue this process until the quotient is 0. The last remainder is the most significant bit of the binary number.

11/2 =5 + remainder 1
5/2 =2 + remainder 1
2/2 =1 + remainder 0
1/2 =0 + remainder 1 (MSB)
Pedagogical and Technological University Of Colombia
Electronics Engineering School
Digital Electronics 1 Course
Laboratory Exercises
To write the binary equivalent of the decimal number, read the remainders from the bottom up.

4610
1011102
Fractional Binary Numbers
In the decimal system, fractional numbers use the same digits as whole numbers, but the digits are written to the right
of the decimal point. The multipliers for these digits are negative powers of 10—10-1 (1/10), 10-2 (1/100), 10-3 (1/1000),
and so on.

So it is in the binary system. Digits 0 and 1 are used to write fractional binary numbers, but the digits are to the right
of the binary point—the binary equivalent of the decimal point. (The decimal point and binary point are special cases
of the radix point, the general name for any such point in any number system.)

Each digit is multiplied by a positional factor that is a negative power of 2. The first four multipliers on either side of
the binary point are:

binary
point
23 22 21 20 . 2-1 2-2 2-3 2-4
=8 =4 =2 =1 =1/2 =1/4 =1/8 =1/16

Hexadecimal Numbers
After binary numbers, hexadecimal (base 16) numbers are the most important numbers in digital applications.
Hexadecimal, or hex, numbers are primarily used as a shorthand form of binary notation. Since 16 is a power of 2
(24=16), each hexadecimal digit can be converted directly to four binary digits. Hex numbers can pack more digital
information into fewer digits.

Hex numbers have become particularly popular with the advent of small computers, which use binary data having 8,
16, or 32 bits. Such data can be represented by 2, 4, or 8 hexadecimal digits, respectively.

The positional multipliers in the hex system are powers of sixteen: 160=1, 161=16, 162= 256, 163=4096, and so on.

We need 16 digits to write hex numbers; the decimal digits 0 through 9 are not sufficient. The usual convention is to
use the capital letters A through F, each letter representing a number from 1010 through 1510. Table 1.4 shows how
hexadecimal digits relate to their decimal and binary equivalents.
Pedagogical and Technological University Of Colombia
Electronics Engineering School
Digital Electronics 1 Course
Laboratory Exercises

Hexadecimal-to-Decimal Conversion
To convert a number from hex to decimal, multiply each digit by its power-of-16 positional multiplier and add the
products. In the following examples, hexadecimal numbers are indicated by a final “H” (e.g., 1F7H), rather than a
“16” subscript.

Decimal-to-Hexadecimal Conversion
Decimal numbers can be converted to hex by the sum-of-weighted-hex-digits method or by repeated division by 16.
The main difficulty we encounter in either method is remembering to convert decimal numbers 10 through 15 into
the equivalent hex digits, A through F.

Sum of Weighted Hexadecimal Digits


This method is useful for simple conversions (about three digits). For example, the decimal number 35 is easily
converted to the hex value 23.

3510 =3210+ 310 =(2x16)+(3x1)= 23H

Repeated Division by 16
Repeated division by 16 is a systematic decimal-to-hexadecimal conversion method that is not limited by the size of
the number to be converted.
Pedagogical and Technological University Of Colombia
Electronics Engineering School
Digital Electronics 1 Course
Laboratory Exercises
It is similar to the repeated-division-by-2 method used to convert decimal numbers to binary. Divide the decimal
number by 16 and note the remainder, making sure to express it as a hex digit. Repeat the process until the quotient
is zero. The last remainder is the most significant digit of the hex number.

Part I
Calculate the binary equivalents of the following decimal numbers, using the following methods: Sum of powers of 2
and repeated division by 2. You must show the respective calculations.

a) 67.24 d) 463
b) 222 e) 153.42
c) 976 f) 854
Part II
Calculate the decimal equivalents of the following binary numbers. You must show the respective calculations.

a) 11100.1110 d) 101100101011
b) 110111 e) 11100101.101
c) 10010001101 f) 101110011

Part III
Calculate the hexadecimal equivalents of the following decimal numbers, using the following methods: Sum of
Weighted Hexadecimal Digits and Repeated Division by 16.

You must show the respective calculations.

a) 23 d) 186
b) 292 e) 2074
c) 161 f) 652

Part IV
Calculate the decimal equivalents of the following hexadecimal numbers. You must show the respective calculations.

a) 123 d) EC1
b) 1F86 e) DE7

Part V
Consult the rules for the conversion of the different numerical system systems Octal.
Pedagogical and Technological University Of Colombia
Electronics Engineering School
Digital Electronics 1 Course
Laboratory Exercises
Calculate the octal equivalents of the following numbers. You must show the respective calculations.

a) 15410 d) 01010100
b) 318H e) 68710

Part VI
Consult the rules for the conversion of the different numerical system systems BCD.

Calculate the BCD equivalents of the following numbers. You must show the respective calculations.

a) 15410 d) 4FH
b) 32810 e) 125H

Part VII
Using the Documentation available in Google Classroom course. You must do the next numerical conversions and
complete de table.

Radix 2 Radix 3 Radix 4 Radix 5 Radix 7 Radix 8 Radix 12 Radix 16 Radix Maya
Radix 2 10010110
Radix 3 21021,10
Radix 4 3312,33
Radix 5 5134,10
Radix 7 6534,35
Radix 8 7337,733
Radix 12349,9
12
Radix 1000010,98
16
Radix
Maya

Part VIII
Decode the following message which is coded using ASCII: 1001000 1100101 1101100 1101100 1101111 0101110
0100000 1001000 1101111 1110111 0100000 1100001 1110010 1100101 0100000 1111001 1101111 1110101 0111111

Part IX
Correct any errors in the following Hamming codes with odd parity.
(a) 110100011
(b) 100001101

You might also like