Digital Electronics: Kwame Oteng Gyasi Lecture 2: Number System
Digital Electronics: Kwame Oteng Gyasi Lecture 2: Number System
Digital Electronics: Kwame Oteng Gyasi Lecture 2: Number System
Related Problem*
• Determine the value of each digit in 939.
Examples cont’d
2. Express the decimal number 568.23 as a sum of the values
of each digit.
Solution
The whole number digit 5 has a weight of 100, which is 10 2,
the digit 6 has a weight of 10, which is 10 1, the digit 8 has a
weight of 1, which is 100, the fractional digit 2 has a weight
of 0.1, which is 10-1, and the fractional digit 3 has a weight
of 0.01, which is 10-2.
568.23 = (5*102) + (6*101) + (8*100) + (2*10-1) +(3*10-2)
= (5*100) + (6*10) + (8*1) + (2*0.1) + (3*0.01)
= 500 + 60 + 8 + 0.2 + 0.03
Related Problem*
• Determine the value of each digit in 67.924.
BINARY NUMBERS
• The binary number system is another way to represent
quantities. It is less complicated than the decimal
system because the binary system has only two digits.
• The decimal system with its ten digits is a base-ten
system; the binary system with its two digits is a base-
two system.
• The two binary digits (bits) are 1 and 0. The position of
a 1 or 0 in a binary number indicates its weight, or
value within the number, just as the position of a
decimal digit determines the value of that digit.
• The weights in a binary number are based on powers
of two.
BINARY NUMBERS
BINARY NUMBERS
• As you MIGHT have seen in the Table, four bits are
required to count from zero to 15. In general, with n
bits you can count up to a number equal to 2n - 1.
• Largest decimal number = 2n - 1
• For example, with five bits (n = 5) you can count
from zero to thirty-one.
• 25 - 1 = 32 - 1 = 31
• With six bits (n = 6) you can count from zero to sixty-
three.
• 26 - 1 = 64 - 1 = 63
BINARY NUMBER APPLICATION
The decimal value of any binary number can be found by adding the weights of all bits that
are 1 and discarding the weights of all bits that are 0.
Example:
1. Convert the binary whole number 1101101 to decimal.
Solution
Determine the weight of each bit that is a 1, and then find the sum of the weights to get
the decimal number.
Weight: 26 25 24 23 22 21 20
Binary number: 1 1 0 1 1 0 1
1101101 = 26 + 25 + 23 + 22 + 20 = 64 + 32 + 8 + 4 + 1 = 109
Related Problem *
1. Convert the binary number 10010001 to decimal.
2. Convert the binary number 10.111 to decimal.
Decimal-to-Binary Conversion
• One way to find the binary number that is equivalent to a given
decimal number is to determine the set of binary weights whose
sum is equal to the decimal number.
• An easy way to remember binary weights is that the lowest is 1,
which is 20, and that by doubling any weight, you get the next
higher weight; thus, a list of seven binary weights would be 64, 32,
16, 8, 4, 2, 1.
• The decimal number 9, for example, can be expressed as the sum
of binary weights as follows:
• 9 = 8 + 1 or 9 = 23 + 20
• Placing 1s in the appropriate weight positions, 23 and 20, and 0s in
the 22 and 21 positions determines the binary number for decimal
9.
• 2 3 2 2 21 20
• 1 0 0 1 Binary number for decimal 9
Decimal-to-Binary Conversion
1. Convert the following decimal numbers to binary:
(a) 12 (b) 25
(c) 58 (d) 82
Solution
(a) 12 = 8 + 4 = 23 + 22 1100
(b) 25 = 16 + 8 + 1 = 24 + 23 + 20 11001
(c) 58 = 32 + 16 + 8 + 2 = 25 + 24 + 23 + 21 111010
(d) 82 = 64 + 16 + 2 = 26 + 24 + 21 1010010
Related Problem*
Convert the decimal number 125 to binary.
Decimal-to-Binary Conversion
Example:
ADDITION DIVISION
Division in binary
follows the same
procedure as division
in decimal
SUBTRACTION MULTIPLICATION
EXAMPLES
1. Add the following binary numbers:
(a) 11 + 11 [110] (b) 100 + 10 [110]
(c) 111 + 11 [1010] (d) 110 + 100 [1010]