0% found this document useful (0 votes)
51 views26 pages

Number System in Digital Logic

The document discusses various number systems used in digital logic, including: 1. Binary, decimal, octal, and hexadecimal number systems - how they represent numbers using different bases and symbols. 2. Converting numbers between these number systems by grouping digits and writing the equivalent values. 3. 1's and 2's complement notation used to represent positive and negative numbers in binary. 4. The rules for binary addition by carrying digits to the next column when the sum is greater than the base.

Uploaded by

noxase8709
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views26 pages

Number System in Digital Logic

The document discusses various number systems used in digital logic, including: 1. Binary, decimal, octal, and hexadecimal number systems - how they represent numbers using different bases and symbols. 2. Converting numbers between these number systems by grouping digits and writing the equivalent values. 3. 1's and 2's complement notation used to represent positive and negative numbers in binary. 4. The rules for binary addition by carrying digits to the next column when the sum is greater than the base.

Uploaded by

noxase8709
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Number system in Digital

logic

Anupama Sen
Brainware university
Content :

 Number system
 Representation of Numbers of different Radix
 Conversion of numbers from one Radix to Another Radix
 Complement of number
What is Number System?

 A number system is defined as the representation of numbers by using digits


or other symbols in a consistent manner.
 A number is a mathematical value used for counting and measuring
objects, and for performing arithmetic calculations. Numbers have various
categories like natural numbers, whole numbers, rational and irrational
numbers, and so on.
 Similarly, there are various types of number systems that have different
properties, like the binary number system, the octal number system, the
decimal number system, and the hexadecimal number system.
Common Number System

system Base Symbol Used by Used in


Humans Computers

Decimal 10 0,1,………..9 YES NO

Binary 2 0,1 NO YES

Octal 8 0,1,2,………..7 NO NO

Hexadecimal 16 0,1,………7,..9, NO NO
A,B,…….F
Binary Number System :

1. It holds only two values, i.e., either 0 or 1.


2. It is also known as the base 2 number system.
3. The position of a digit represents the 0 power of the base(2). Example: 20
4. The position of the last digit represents the x power of the base(2). Example: 2x, where x
represents the last position, i.e., 1
Decimal Number System :

 The position in the decimal number system specifies the power of the base (10).
 The 0 is the minimum value of the digit, and 9 is the maximum value of the digit.
Octal Number System :

1. An octal number system carries eight digits starting from 0, 1, 2, 3, 4, 5, 6, and 7.


2. It is also known as the base 8 number system.
3. The position of a digit represents the 0 power of the base(8). Example: 80
4. The position of the last digit represents the x power of the base(8). Example: 8x, where x
represents the last position, i.e., 1
Hexadecimal Number :

1. It has ten digits from 0 to 9 and 6 letters from A to F.


2. The letters from A to F defines numbers from 10 to 15.
3. It is also known as the base 16number system.
4. In hexadecimal number, the position of a digit represents the 0 power of the base(16).
Example: 160
5. In hexadecimal number, the position of the last digit represents the x power of the base(16).
Example: 16x, where x represents the last position, i.e., 1
Conversion base number
Binary to Octal :

 Group into 3’s starting at least significant symbol (if the number of bits is not evenly divisible by
3 , then add 0’s at the most significant end).
 Write 1 octal digit for each group (0 to 7)
 Example 1: (111110101011.0011)2
1. Firstly, we make pairs of three bits on both sides of the binary point.
111 110 101 011.001 1
On the right side of the binary point, the last pair has only one bit. To make it a complete pair of
three bits, we added two zeros on the extreme side.
111 110 101 011.001 100
2. Then, we wrote the octal digits, which correspond to each pair.
(111110101011.0011)2=(7653.14)8
Octal to binary conversion :

 For each of the octal digit write its binary equivalent


 Example 1: (152.25)8
We write the three-bit binary digit for 1, 5, 2, and 5.
(152.25)8=(001101010.010101)2
So, the binary number of the octal number 152.25 is (001101010.010101)2
Binary to hexadecimal conversion :

 Group into 4’s starting at least significant symbol ( if the number of bits is not evenly divisible
by 4 , then add 0’s at the most significant end )
 Write 1 hex digit for each group.
 Example 1: (10110101011.0011)2
1. Firstly, we make pairs of four bits on both sides of the binary point.
111 1010 1011.0011
On the left side of the binary point, the first pair has three bits. To make it a complete pair of four
bits, add one zero on the extreme side.
0111 1010 1011.0011
2. Then, we write the hexadecimal digits, which correspond to each pair.
(011110101011.0011)2=(7AB.3)16
Hexadecimal to binary conversion :

 For each of the hex digit write its binary equivalent(used 4 bits to represent).
Example 1: (152A.25)16
We write the four-bit binary digit for 1, 5, A, 2, and 5.
(152A.25)16=(0001 0101 0010 1010.0010 0101)2
So, the binary number of the hexadecimal number 152.25 is (1010100101010.00100101)2
Octal to hexadecimal conversion
1. In the first step, we will find the binary equivalent of number 25.
2. Next, we have to make the pairs of four bits on both sides of the binary point. If there will
be one, two, or three bits left in a pair of four bits pair, we add the required number of
zeros on extreme sides and write the hexadecimal digits corresponding to each pair.
 Example 1: (152.25)8
Step 1:
We write the three-bit binary digit for 1, 5, 2, and 5.
(152.25)8=(001101010.010101)2
So, the binary number of the octal number 152.25 is (001101010.010101)2
Step 2:
1. Now, we make pairs of four bits on both sides of the binary point.
0 0110 1010.0101 01
On the left side of the binary point, the first pair has only one digit, and on
the right side, the last pair has only two-digit. To make them complete pairs
of four bits, add zeros on extreme sides.
0000 0110 1010.0101 0100
2. Now, we write the hexadecimal digits, which correspond to each pair.
(0000 0110 1010.0101 0100)2=(6A.54)16
Hexadecimal to Octal Conversion

 Step 1:
We write the four-bit binary digit for 1, 5, 2, A, and 5.
(152A.25)16=(0001 0101 0010 1010.0010 0101)2
So, the binary number of hexadecimal number 152A.25 is (0011010101010.010101)2
 Step 2:
3. Then, we make pairs of three bits on both sides of the binary point.
001 010 100 101 010.001 001 010
4. Then, we write the octal digit, which corresponds to each pair.
(001010100101010.001001010)2=(12452.112)8
the octal number of the hexadecimal number 152A.25 is 12452.112
Decimal to binary conversion :

1. n the first step, we perform the division operation on the integer and the successive
quotient with the base of binary(2).
2. Next, we perform the multiplication on the integer and the successive quotient with the
base of binary(2).
Example 1: (152.25)10
Decimal to Octal Conversion :

1. In the first step, we perform the division operation on the integer and the successive
quotient with the base of octal(8).
2. Next, we perform the multiplication on the integer and the successive quotient with the
base of octal(8).
 Example 1: (152.25)10
Decimal to hexadecimal conversion :

1. In the first step, we perform the division operation on the integer and the successive
quotient with the base of hexadecimal (16).
2. Next, we perform the multiplication on the integer and the successive quotient with the
base of hexadecimal (16).
 Example 1: (152.25)10
Octal to Decimal Conversion

 Example 1: (152.25)8
 Step 1:
We multiply each digit of 152.25 with its respective positional weight, and last we add the
products of all the bits with its weight.
 (152.25)8=(1×82)+(5×81)+(2×80)+(2×8-1)+(5×8-2)
(152.25)8=64+40+2+(2×1⁄8)+(5×1⁄64)
(152.25)8=64+40+2+0.25+0.078125
(152.25)8=106.328125
So, the decimal number of the octal number 152.25 is 106.328125
Hexa-decimal to Decimal Conversion

 Example 1: (152A.25)16
Step 1:
We multiply each digit of 152A.25 with its respective positional weight, and last we add the
products of all the bits with its weight.
(152A.25)16=(1×163)+(5×162)+(2×161)+(A×160)+(2×16-1)+(5×16-2)
(152A.25)16=(1×4096)+(5×256)+(2×16)+(10×1)+(2×16-1)+(5×16-2)
(152A.25)16=4096+1280+32+10+(2×1⁄16)+(5×1⁄256)
(152A.25)16=5418+0.125+0.125
(152A.25)16=5418.14453125
So, the decimal number of the hexadecimal number 152A.25 is 5418.14453125
1’s & 2’s complement :

 1’s complement :
Example : 100110.1001
For finding 1's complement of the given number, change all 0's to 1 and all 1's to 0. So, the 1's
complement of the number 100110.1001 comes out 011001.0110.
➢ 2’s complement :
we will first find the 1's complement of the binary number and then add 1 to the least
significant bit of it.
Example : 100110
For finding 1's complement of the given number, change all 0's to 1 and all 1's to 0. So, the 1's
complement of the number 100110 is 011001. Now add one the LSB of this number, i.e.,
(011001)+1=011010.
Binary Addition

 Rules:
Binary Addition(Cont…..)

 First let us add the digits in the one's place, which are 1 + 1 = 0 (1
carryover). Here, 1 + 1 is 10, which is the binary equivalent of (2)10, so we
are regrouping the twos column by taking 1 as a carryover.
 Now, we move to the next place value towards left, which is twos place.
Here, we have 0 + 1 + 1 (carryover) = 10. So, again we will write 0 and take
1 as a carryover to the next place value. In the next column, we have 0 + 1
+ 1 = 10. Similarly, we again take 1 as a carryover to the next column. In the
last column to the left, we have 1 + 1 (carryover) = 10.
Binary Addition(cont….)

Therefore, (1001)2 + (111)2 = (10000)2.


Thank you .

You might also like