BIT102 SLM Library - SLM - Unit 02
BIT102 SLM Library - SLM - Unit 02
Structure:
2.1 Introduction
Objectives
2.2 Number Systems
2.3 Types of Number Systems
Decimal number system
Binary number system
Octal number system
Hexadecimal number system
2.4 Conversion from One Number System to Other
Conversion from Binary, Octal, Hexadecimal to Decimal number,
and vice versa
Octal to binary conversion and Vice versa
Hexadecimal to binary conversion and Vice versa
Hexadecimal to Octal conversion and Vice versa
2.5 Binary Arithmetic Operations
2.6 Representation of Negative Numbers
2.7 Complement Arithmetic
2.8 Summary
2.9 Terminal Questions
2.10 Answers
2.1 Introduction
In the previous unit we studied a few of the basic concepts of digital
electronics like digital and analog signals, logic levels and digital waveforms,
logic systems, and logic operations. We also studied the concepts of
combinational and sequential logic functions. The study of number systems
is another important topic from the viewpoint of understanding how data are
represented before they are processed by any digital system including a
digital computer. In this unit we will discuss different types of number
systems commonly used to represent data. We start our discussion with the
decimal number system, then we will discuss different types of number
systems such as the binary, octal and hexadecimal, conversion of numbers
from one number system to other, binary arithmetic operations. We will also
We know that the computer can understand only binary; there is a need for
the conversion of alphabets and other special characters into the binary. In
this unit, we will discuss the different numbering system and their
conversion across the different numbering system.
Self-Assessment Questions
1. The number system is a collection of number to represent the
quantifiable information. (State true or false)
2. In decimal number system we have ten different digits 1, 2, 3, 4, 5, 6, 7,
8, 9 and 10. (State true or false)
3. A transistor acts as a _________ and, is able to represent the binary
number.
Decimal number system has the characteristic of place value. Number value
changes depending on the position or place. For example, consider the
number 345. The place value of 3 is hundred, and it means three hundreds
which is equal to 300. The place value of 4 is ten and four tens means 40
and the place value of 5 is one (or unit) which is equal to 5. Adding
300+40+5 gives decimal number 345. Some of the examples of writing
decimal numbers in different ways are:
345, [345]10, 345.67, 568.1010, (1010.1010)10 etc.
A number may consist of either integer part or fractional part or both. So, a
decimal number may contain two parts like the value before dot and the
value after dot. The value before dot is an integer part and the value after
dot is a fractional value. Consider 367.867. The number 367 is integer value
or integer part and the number 867 is called fractional value or fractional
part. The Dot is called decimal point. This is represented as:
The number position always starts from Zero. Here if you observe
7 is in 0thposition it give value 7
6 is in 1st position it gives value 60
5 is in 2nd position it gives value 500
4 is in 3rd position it gives value 4000
Summing all together we get the value is 456710.
From the above example 2.1, it is clear that the power is given to the base
10 starting from Zero and power assignment is from left to right as shown by
an arrow mark. But the assignment of power for fractional part of decimal
number starts from left to right with staring power value -1. The example 2.2
shown below illustrates this.
Example 2.2: How do you represent decimal number 4567.890110 ?
This number can be represented as
4 x 103 + 5 x 102 + 6 x 101 + 7 x 100 + 8 x 10-1 + 9 x 10-2 + 0 x 10-3 + 1 x 10-4
The number in position is given as:
The value before dot
7 is in 0th position it gives value 7
6 is in 1st position it gives value 60
5 is in 2nd position it gives value 500
4 is in 3rd position it gives value 4000
The value after dot
8 is in -1st position it give value 0.8
9 is in -2nd position it gives value 0.09
0 is in -3rd position it gives value 0.000
1 is in -4th position it gives value 0.0001
Summing all together we get the value 4567.890110
2.3.2 Binary number system
The word bi means two. So binary number system has only two digits or
symbols 0 and 1. The base of this number system is 2 because there are
only two digits. Numbers represented in this system are commonly called
binary numbers. The each digit 0 or 1 is called binary digit or bit. The digital
computer understands binary numbers. So this number system became
popular in computer world. The transistor can also represent the value ‘0’ by
off state and the value “1” by its on state.
Examples of binary numbers are: 1010, 10.1011, 1000.100, and
(1010.100)2 etc.
Note: If we do not write binary number in words before the numbers, or if
the base is not specified in the given number, then it will be considered as
decimal number by default. So we have to mention the given number as
binary number in words or we have to write the binary number with its base
2 to mean the given number is a binary number.
Now let us see the method of representing binary number in decimal format.
Example 2.3: How to represent the binary value “1010” in decimal format?
(1010)2 = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20
=1x8 + 0x4 +1x2 +0x1
= 8 + 0 + 2 + 0
= (10)10
This means the binary number 1010 is equal to the decimal number 10.
Example 2.4: How do you represent the binary value 1010.101 in decimal
format?
(1010.101)2 = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 + 1 x 2-1 + 0 x 2-2 + 1 x 2-3
= 8 + 0 + 2 + 0 + 0.5 + 0.0 + 0.125
= 10.62510
∴ (1010.101)2 = 10.62510
Most Significant Bit (MSB) is one which has got the highest value in given
binary number and Least Significant Bit (LSB) is one which has the least
value. For example, consider the binary number 10101, the MSB and LSB
are labelled as:
Note that weights are assigned to base of binary number system starting
with zero from left to right.
Since 24 = 16, 23=8, 22=4 and 20=1, we can also represent the above
notations as:
Therefore, (10101)2 = 1 x 24 + 0 x 23 + 1x 22 + 0 x 21 + 1 x 20
= 1 x16+ 0 x 8 + 1x 4 + 0 x 2 + 1 x 1
= 16+0+4+0+1
= ( 21)10
2.3.3 Octal Number System
In octal number system, there are eight different digits or symbols. They are
0,1,2,3,4,5,6 and 7. Since there are eight digits, the base (or radix) of the
octal number system is 8.
Some of the examples of octal number system are: (125)8, [647.76]8,
(101.101)8, 1016.108 etc.
Example 2.5: How do to represent the octal value “1760” in decimal format?
1760 = 1 x 83 + 7 x 82 + 6 x 81 + 0 x 80
= 512 + 448 + 48 + 0
∴ (1760)8 = (1008)10
Example 2.6: How do you represent the octal value 1760.154 in decimal
format?
1760.154 = 1 x 83 + 7 x 82 + 6 x 81 + 0 x 80 + 1 x 8-1 + 5 x 8-2 + 4 x 8-3
= 512 + 448 + 48 +0+0.125 + 0.078125 + 0.0078125
(1760.154)8 = (1008.2109375)10
2.3.4 Hexadecimal Number System
The base of Hexadecimal number system is 16, means there are sixteen
different symbols or digits. They are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E,
F.
Where A= (10)10, B = (11)10, C = (12)10 ,D =(13)10 ,E= (14)10 and F = (15)10
Some of the examples of hexadecimal numbers are: 1234, ABCD, ACD.14B,
BC5.67, (BCD.B6C) 16, (267.46)H etc.
Example 2.9: Covert the binary number 1101.10 into decimal number
Solution: (1101.10)2 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 0 x 2-2
= 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1 + 1 x 0.5 + 0 x 0.25
= 8 + 4 + 0 + 1 + 0.5 + 0
= 13.510
∴ (1101.10)2 = 13.510
Example 2.10: Covert the octal number 237.12 into decimal number
Solution: 237. 12 = 2 x 82 + 3x 81 + 7 x 80 + 1 x 8-1 + 2 x 8-2
= 2 x64 + 3x 8 + 7 x 1 + 1 x 0.125 + 2 x 0.015625
= 128 + 24 + 7 + 0.125 + 0.03125
= (159.15625)10
∴ (237.12)8 = (159.15625)10
Example 2.11: Covert the Hexadecimal number 23B.21 into decimal
number.
Solution: (23B.21)16 = 2 x 162 +3 x 161 +B x160 + 2 x 16-1 +1x 16-2
= 2 x 256 +3 x 16 +11 x1 + 2 x 0.0625 +1x 0.0039
= 512 +48 + 11 + 0.125 + 0.0039
= 571.1289
∴ (23B.21)16 = (571.1289)10
Now let us look at the conversion of a given decimal number to other
number systems. Here we consider two cases.
Decimal Integer Conversion:
Here the given decimal number must be divided by the base of the other
number systems in order to convert decimal number (i.e. Integer part) to
other number system. For example, if we want to convert the decimal
number to binary number system, we must divide the decimal number by 2
repeatedly till our quotient becomes zero as shown in example 2.12. The
reminder moving from the bottom to top will be our binary number. The
process is similar for all other number systems.
Example 2.12: How to convert 10010 into binary, octal and hexadecimal?
Now for the fractional part, we follow the multiplication process as shown
below.
Now considering both integer and fractional part, we put the answers as:
100.26510 = (1100100.0100)2 ; 100.26510 =(144.20753)8 ; and
100.26510 = (64.43D70)16
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
From the table 2.1, it is clear that any octal digit can be represented by a
group of three binary digits (or Bits).
Octal to Binary Conversion:
To convert any given octal number to its equivalent binary number, simply
replace each octal digit by its equivalent three bit binary value.
Example 2.15: Convert 61358 into binary value
In this example, we replace each octal digit by its equivalent 3-bit binary
value as shown below to get our answer.
6 1 3 5 ← Octal Number
110 001 011 1012 ← Binary Number
Thus, (6135)8 = (110001011101)2
Example 2.16: Convert (6135.2478)8 into binary value
We will replace equivalent 3 bit binary value to represent the octal value.
6 1 3 5 . 2 4 7 ← Octal Number
110 001 011 101 . 010 100 111 ← Binary Number
∴ (6135.247)8 = ( 110001011101.010100111)2
From the table 2.2, it is clear that any hexadecimal digit can be represented
by a group of four binary digits (or Bits)
Hexadecimal to Binary Conversion:
To convert any given hexadecimal number to its equivalent binary number,
simply replace each hexadecimal digit by its equivalent four bit binary value.
Example 2.19: Convert 1A2C16 into Binary Value.
In this example, we replace each hexadecimal digit by its equivalent 4-bit
binary group as shown below to get our answer.
1 A 2 C ← Hexadecimal Number
0001 1010 0010 1100 ← Binary Number
∴ (1A2C)16 = (0001101000101100)2
Note that we perform addition in column by column process. Now let us see
some examples for binary addition.
Example 2.27: Add 1010 and 10001.
1010
+ 10001
11011
Note that 10-1=1 (i.e. difference 1 with borrow 0 ). This can also be written
as:
Note that the first number is called Minuend (the number that subtracts the
other number) and the second number (the number to be subtracted from
other number) is called subtrahend
Example 2.30: Perform the binary subtraction of 1011 from 1001.
0 0 0 1 0 1 1 1 = 23 (in decimal )
× 1 1 = 3 (in decimal )
1 1 1 1 1 carries
0 0 0 1 0 1 1 1
0 0 0 1 0 1 1 1
0 0 1 0 0 0 1 0 1 = 69 (in decimal )
You will come to know the decimal equivalent of binary numbers when you
perform number conversion.
Example 2.34: Multiply 1011.01 × 110.1 = 1001001.001
4) Binary Division
Binary division follows the same rule as that of decimal division. Now let us
study direct method of binary division. Consider the following examples.
Since the subtraction is carried out two times, the result is 10.
Thus, 1100 ÷ 110 = 10
Now to get 1’s complement of -14, we first get 1’s complement of +14. Then
we complement this binary number to get -14. This process is as below:
Comparing both the direct and 1’s complement subtraction methods, we get
the same result. This means, we can do the subtraction by addition in 1’s
complement method.
Example 2.51: Subtract (1101)2 from (1001)2 using the 1’s complement
method. Also show the direct subtraction and compare.
Comparing both the direct and 1’s complement subtraction methods, we get
the same result.
Example 2.52: Compute Binary arithmetic operation for 19 – 5 using 1’s
complement.
Example 2.53: Subtract (1001)2 from (1101)2 using the 2’s complement
method. Also show the direct subtraction and compare.
Comparing both the direct and 2’s complement subtraction methods, we get
the same result. This means, we can do the subtraction by addition in 2’s
complement method.
Example 2.54: Subtract (1101)2 from (1001)2 using the 2’s complement
method. Also show the direct subtraction and compare
0 1 0 0 0 = 8 ←Minuend 1 0 0 1 1← Minuend
– 1 0 0 1 1 = - 19 ← Subtrahend +0 1 1 0 1← 2’s complement of
Subtrahend
0 1 0 1 1 =11 ← Final result 1 0 1 0 1 ← End around carry:
The result is positive.
∴ 0 1 1 1 0 ← Final result.
Self-Assessment Questions
15. In 1’s complement subtraction, we take the 1’s complement of the
minuend. (State true or false)
16. In 1’s complement subtraction, if there is a carry after addition, then the
result is ________________.
17. When we subtract (1101)2 from (1001)2 using 2’s complement method,
the result is in ______________ form.
18. 2’s complement subtraction of 10001- 1001= _______________.
2.8 Summary
Let us recapitulate the important concepts discussed in this unit:
The number system is a collection of number to represent different
quantities.
The most important types of number system are: Decimal, binary, octal,
and hexadecimal.
The base (or radix) of a number system is the number of different digits
(or symbols) available within that number system.
Binary number system has only two digits or symbols 0 and 1. So its
base is 2.
Any given octal number can be converted to its equivalent hexadecimal
number by first converting the given octal number to its equivalent
binary number and then converting this resulting binary number to its
equivalent hexadecimal number.
Sikkim Manipal University B2072 Page No.: 54
Digital Electronics Unit 2
Glossary:
Number system: Collection of number to represent different quantities.
Base: Represent the number of different digits (or symbols) available within
that number system.
Binary number: Number that comprise of 0s and 1s.
End around carry: A carry generated in 1’s complement subtraction
method which indicates the result is positive.
2.10 Answers
Self-Assessment Questions
1. True
2. False
3. Switch
4. 10
5. Binary number
6. 16
7. 100.26510
8. 1A2C.3B4D
9. (11)2
10. True
11. (─ 4)10
12. 010101
13. 11011
14. False
15. False
16. Positive
17. 2’s complement
18. 1000
Terminal Questions
1. The number system is a collection of number to represent different
quantities. Refer to section 2.2.
2. The types of number systems are: decimal, binary, octal and
hexadecimal. Refer to section 2.3 for more details.
3. To convert any given octal number to its equivalent binary number,
simply replace each octal digit by its equivalent three bit binary value.
Refer to section 2.4 for more details
4. (a) 100 =(1100100 )2
(b) (6135)8 = (110001011101)2
(c) 1A2C.3B4D16 = 1A2C.3B4D16 = (15054.166464)8
Refer to section 2.4 for more details.
5. 00101001 × 110 = 11110110. Refer to section 2.5.