Digital Design
Digital Design
Number System
In a digital system, the system can understand only the optional number system. In these
systems, digits symbols are used to represent different values, depending on the index from
which it settled in the number system.
In simple terms, for representing the information, we use the number system in the digital
system.
1. The digit
3. Finally, the base numbers, the total number of digits available in the number system.
Note: When the number system represents a digit from 0 - 9, the base of the number will be
10.
https://www.javatpoint.com/number-system-in-digital-electronics 2/9
8.11.2023 15:22 Number System in Digital Electronics Tutorial - Javatpoint
Generally, a binary number system is used in the digital computers. In this number system, it
carries only two digits, either 0 or 1. There are two types of electronic pulses present in a binary
number system. The first one is the absence of an electronic pulse representing '0'and second
one is the presence of electronic pulse representing '1'. Each digit is known as a bit. A four-bit
collection (1101) is known as a nibble, and a collection of eight bits (11001010) is known as a
byte. The location of a digit in a binary number represents a specific power of the base (2) of
the number system.
Characteristics:
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
Examples:
https://www.javatpoint.com/number-system-in-digital-electronics 3/9
8.11.2023 15:22 Number System in Digital Electronics Tutorial - Javatpoint
The decimal numbers are used in our day to day life. The decimal number system contains ten
digits from 0 to 9(base 10). Here, the successive place value or position, left to the decimal
point holds units, tens, hundreds, thousands, and so on.
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. For example, the decimal
number 2541 consist of the digit 1 in the unit position, 4 in the tens position, 5 in the hundreds
position, and 2 in the thousand positions and the value will be written as:
The octal number system has base 8(means it has only eight digits from 0 to 7). There are only
eight possible digit values to represent a number. With the help of only three bits, an octal
number is represented. Each set of bits has a distinct value between 0 and 7.
Characteristics:
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
0 000
1 001
https://www.javatpoint.com/number-system-in-digital-electronics 4/9
8.11.2023 15:22 Number System in Digital Electronics Tutorial - Javatpoint
2 010
3 011
4 100
5 101
6 110
7 111
Examples:
It is another technique to represent the number in the digital system called the hexadecimal
number system. The number system has a base of 16 means there are total 16 symbols(0, 1, 2,
3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) used for representing a number. The single-bit representation
of decimal values10, 11, 12, 13, 14, and 15 are represented by A, B, C, D, E, and F. Only 4 bits are
required for representing a number in a hexadecimal number. Each set of bits has a distinct
value between 0 and 15. There are the following characteristics of the octal number system:
Characteristics:
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
0000 0
0001 1
https://www.javatpoint.com/number-system-in-digital-electronics 5/9
8.11.2023 15:22 Number System in Digital Electronics Tutorial - Javatpoint
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Examples:
← Prev Next →
Feedback
https://www.javatpoint.com/number-system-in-digital-electronics 6/9
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
As, we have four types of number systems so each one can be converted into the remaining
three systems. There are the following conversions possible in Number System
The process of converting binary to decimal is quite simple. The process starts from multiplying
the bits of binary number with its corresponding positional weights. And lastly, we add all those
products.
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 2/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
Let's take an example to understand how the conversion is done from binary to decimal.
Example 1: (10110.001)2
We multiplied each bit of (10110.001)2 with its respective positional weight, and last we add the
products of all the bits with its weight.
(10110.001)2=(1×24)+(0×23)+(1×22)+(1×21)+(0×20)+
(0×2-1)+(0×2-2)+(1×2-3)
(10110.001)2=(1×16)+(0×8)+(1×4)+(1×2)+(0×1)+
(0×1⁄2)+(0×1⁄4)+(1×1⁄8)
(10110.001)2=16+0+4+2+0+0+0+0.125
(10110.001)2=(22.125 )10
The base numbers of binary and octal are 2 and 8, respectively. In a binary number, the pair of
three bits is equal to one octal digit. There are only two steps to convert a binary number into
an octal number which are as follows:
1. In the first step, we have to make the pairs of three bits on both sides of the binary
point. If there will be one or two bits left in a pair of three bits pair, we add the required
number of zeros on extreme sides.
2. In the second step, we write the octal digits corresponding to each pair.
Example 1: (111110101011.0011)2
1. Firstly, we make pairs of three bits on both sides of the binary point.
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.
(111110101011.0011)2=(7653.14)8
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 3/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
The base numbers of binary and hexadecimal are 2 and 16, respectively. In a binary number,
the pair of four bits is equal to one hexadecimal digit. There are also only two steps to convert
a binary number into a hexadecimal number which are as follows:
1. In the first step, 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.
2. In the second step, we write the hexadecimal digits corresponding to each pair.
Example 1: (10110101011.0011)2
1. Firstly, we make pairs of four bits on both sides of the binary point.
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.
(011110101011.0011)2=(7AB.3)16
1. In the first step, we perform the division operation on integer and successive part with
base 'r'. We will list down all the remainders till the quotient is zero. Then we find out the
remainders in reverse order for getting the integer part of the equivalent number of base
'r'. In this, the least and most significant digits are denoted by the first and the last
remainders.
2. In the next step, the multiplication operation is done with base 'r' of the fractional and
successive fraction. The carries are noted until the result is zero or when the required
number of the equivalent digit is obtained. For getting the fractional part of the
equivalent number of base 'r', the normal sequence of carrying is considered.
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 4/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
For converting decimal to binary, there are two steps required to perform, which are as follows:
1. In 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
Step 1:
Divide the number 152 and its successive quotients with base 2.
152/2 76 0 (LSB)
76/2 38 0
38/2 19 0
19/2 9 1
9/2 4 1
4/2 2 0
2/2 1 0
1/2 0 1(MSB)
(152)10=(10011000)2
Step 2:
Now, perform the multiplication of 0.27 and successive fraction with base 2.
0.25×2 0.50 0
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 5/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
0.50×2 0 1
(0.25)10=(.01)2
For converting decimal to octal, there are two steps required to perform, which are as follows:
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
Step 1:
Divide the number 152 and its successive quotients with base 8.
152/8 19 0
19/8 2 3
2/8 0 2
(152)10=(230)8
Step 2:
Now perform the multiplication of 0.25 and successive fraction with base 8.
0.25×8 0 2
(0.25)10=(2)8
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 6/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
For converting decimal to hexadecimal, there are two steps required to perform, which are as
follows:
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
Step 1:
Divide the number 152 and its successive quotients with base 8.
152/16 9 8
9/16 0 9
(152)10=(98)16
Step 2:
Now perform the multiplication of 0.25 and successive fraction with base 16.
0.25×16 0 4
(0.25)10=(4)16
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 7/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
The process of converting octal to decimal is the same as binary to decimal. The process starts
from multiplying the digits of octal numbers with its corresponding positional weights. And
lastly, we add all those products.
Let's take an example to understand how the conversion is done from octal to decimal.
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
The process of converting octal to binary is the reverse process of binary to octal. We write the
three bits binary code of each octal number digit.
Example 1: (152.25)8
(152.25)8=(001101010.010101)2
For converting octal to hexadecimal, there are two steps required to perform, which are as
follows:
1. In the first step, we will find the binary equivalent of number 25.
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 8/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
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:
(152.25)8=(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.
The process of converting hexadecimal to decimal is the same as binary to decimal. The
process starts from multiplying the digits of hexadecimal numbers with its corresponding
positional weights. And lastly, we add all those products.
Let's take an example to understand how the conversion is done from hexadecimal to decimal.
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 9/14
8.11.2023 15:21 Conversion of Number System in Digital Electronics Tutorial - Javatpoint
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
Example 1: (152A.25)16
For converting hexadecimal to octal, there are two steps required to perform, which are as
follows:
1. In the first step, we will find the binary equivalent of the hexadecimal number.
2. Next, we have to make the pairs of three bits on both sides of the binary point. If there
will be one or two bits left in a pair of three bits pair, we add the required number of
zeros on extreme sides and write the octal digits corresponding to each pair.
Example 1: (152A.25)16
Step 1:
Step 2:
3. Then, we make pairs of three bits on both sides of the binary point.
(001010100101010.001001010)2=(12452.112)8
← Prev Next →
Feedback
https://www.javatpoint.com/conversion-of-number-system-in-digital-electronics 11/14
8.11.2023 15:23 Gray Code in Digital Electronics Tutorial - Javatpoint
Gray Code
The Gray Code is a sequence of binary number systems, which is also known as reflected
binary code. The reason for calling this code as reflected binary code is the first N/2 values
compared with those of the last N/2 values in reverse order. In this code, two consecutive
values are differed by one bit of binary digits. Gray codes are used in the general sequence of
hardware-generated binary numbers. These numbers cause ambiguities or errors when the
transition from one number to its successive is done. This code simply solves this problem by
changing only one bit when the transition is between numbers is done.
The gray code is a very light weighted code because it doesn't depend on the value of the digit
specified by the position. This code is also called a cyclic variable code as the transition of one
value to its successive value carries a change of one bit only.
The prefix and reflect method are recursively used to generate the Gray code of a number. For
generating gray code:
2. Next, we find the code for 0, i.e., 0000, which is the same as binary.
3. Now, we take the previous code, i.e., 0000, and change the most significant bit of it.
4. We perform this process reclusively until all the codes are not uniquely identified.
5. If by changing the most significant bit, we find the same code obtained previously, then
the second most significant bit will be changed, and so on.
https://www.javatpoint.com/gray-code-in-digital-electronics 2/7
8.11.2023 15:23 Gray Code in Digital Electronics Tutorial - Javatpoint
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
https://www.javatpoint.com/gray-code-in-digital-electronics 3/7
8.11.2023 15:23 Gray Code in Digital Electronics Tutorial - Javatpoint
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
← Prev Next →
Feedback
Excess-3 Code
The excess-3 code is also treated as XS-3 code. The excess-3 code is a non-weighted and self-
complementary BCD code used to represent the decimal numbers. This code has a biased
representation. This code plays an important role in arithmetic operations because it resolves
deficiencies encountered when we use the 8421 BCD code for adding two decimal digits whose
sum is greater than 9. The Excess-3 code uses a special type of algorithm, which differs from
the binary positional number system or normal non-biased BCD.
We can easily get an excess-3 code of a decimal number by simply adding 3 to each decimal
digit. And then we write the 4-bit binary number for each digit of the decimal number. We can
find the excess-3 code of the given binary number by using the following steps:
3. Now, we find the binary code of each digit of the newly generated decimal number.
We can also add 0011 in each 4-bit BCD code of the decimal number for getting excess-3 code.
0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
https://www.javatpoint.com/excess-3-code-in-digital-electronics 2/7
8.11.2023 15:23 Excess-3 Code in Digital Electronics Tutorial - Javatpoint
In excess-3 code, the codes 1111 and 0000 are never used for any decimal digit. Let's take
some examples of Excess-3 code.
Digit BCD
3 0011
1 0001
3 0011+0011 0110
1 0001+0011 0100
Digit BCD
8 1000
1 0001
6 0110
1 0001
https://www.javatpoint.com/excess-3-code-in-digital-electronics 3/7
8.11.2023 15:23 Excess-3 Code in Digital Electronics Tutorial - Javatpoint
8 1000+0011 1011
1 0001+0011 0100
6 0110+0011 1001
3) So, the excess-3 code of the decimal number 81.61 is 1011 0100.1001 0100
Self-complementary property
Note: if we perform the 1's complement of excess-3 of a decimal number, it will be equal to
the excess-3 code of the 9's complement of that decimal number.
For example: If we perform 1's complement of the excess-3 code 1000(decimal 5),
complement value will be 0111, which is the excess-3 code of 9's complement of 5, i.e., 4(0111).
There are the following advantages of excess-3 code which make it required to use:
4. The codes 0000 and 1111 can cause a fault in the transmission line. The excess-3 code
doesn't use these codes and gives an advantage for memory organization.
6. This code has a vital role in arithmetic operations. It is because it resolves deficiencies
which are encountered when we use the 8421 BCD code for adding two decimal digits
whose sum is greater than 9.
https://www.javatpoint.com/excess-3-code-in-digital-electronics 4/7
8.11.2023 15:30 1's Complement in Digital Electronics - Javatpoint
1's complement
In number representation techniques, the binary number system is the most used
representation technique in digital electronics. The complement is used for representing the
negative decimal number in binary form. Different types of complement are possible of the
binary number, but 1's and 2's complements are mostly used for binary numbers. We can find
the 1's complement of the binary number by simply inverting the given number. For example,
1's complement of binary number 1011001 is 0100110. We can find the 2's complement of the
binary number by changing each bit(0 to 1 and 1 to 0) and adding 1 to the least significant bit.
For example, 2's complement of binary number 1011001 is (0100110)+1=0100111.
For finding 1's complement of the binary number, we can implement the logic circuit also by
using NOT gate. We use NOT gate for each bit of the binary number. So, if we want to
implement the logic circuit for 5-bit 1's complement, five NOT gates will be used.
Example 1: 11010.1101
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 11010.1101 comes out 00101.0010.
Example 2: 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.
0000 1111
https://www.javatpoint.com/1s-complement-in-digital-electronics 2/7
8.11.2023 15:30 1's Complement in Digital Electronics - Javatpoint
0001 1110
0010 1101
0011 1100
0100 1011
0101 1010
0110 1001
0111 1000
1000 0111
1001 0110
1010 0101
1011 0100
1100 0011
1101 0010
1110 0001
1111 0000
In signed binary number representation, we can represent both positive and negative numbers.
For representing the positive numbers, there is nothing to do. But for representing negative
numbers, we have to use 1's complement technique. For representing the negative number, we
first have to represent it with a positive sign, and then we find the 1's complement of it.
Let's take an example of a positive and negative number and see how these numbers are
represented.
https://www.javatpoint.com/1s-complement-in-digital-electronics 3/7
8.11.2023 15:30 1's Complement in Digital Electronics - Javatpoint
Example 1: +6 and -6
The number +6 is represented as same as the binary number. For representing both numbers,
we will take the 5-bit register.
1. +6=0 0110
2. Find the 1's complement of the number 0 0110, i.e., 1 1001. Here, MSB denotes that a
number is a negative number.
Here, MSB refers to Most Significant Bit, and LSB denotes the Least Significant Bit.
The number +120 is represented as same as the binary number. For representing both
numbers, take the 8-bit register.
1. +120=0 1111000
2. Now, find the 1's complement of the number 0 1111000, i.e., 1 0000111. Here, the MSB
denotes the number is the negative number.
← Prev Next →
https://www.javatpoint.com/1s-complement-in-digital-electronics 4/7
8.11.2023 15:35 2's Complement in Digital Electronics - Javatpoint
2's complement
Just like 1's complement, 2's complement is also used to represent the signed binary numbers.
For finding 2's complement of the binary number, we will first find the 1's complement of the
binary number and then add 1 to the least significant bit of it.
For example, if we want to calculate the 2's complement of the number 1011001, then firstly,
we find the 1's complement of the number that is 0100110 and add 1 to the LSB. So, by adding
1 to the LSB, the number will be (0100110)+1=0100111. We can also create the logic circuit
using OR, AND, and NOT gates. The logic circuit for finding 2's complement of the 5-bit binary
number is as follows:
Example 1: 110100
For finding 2'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 110100 is 001011. Now add 1 to the LSB of this number, i.e.,
(001011)+1=001100.
Example 2: 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.
https://www.javatpoint.com/2s-complement-in-digital-electronics 2/7
8.11.2023 15:35 2's Complement in Digital Electronics - Javatpoint
2's complement is used for representing signed numbers and performing arithmetic operations
such as subtraction, addition, etc. The positive number is simply represented as a magnitude
form. So there is nothing to do for representing positive numbers. But if we represent the
negative number, then we have to choose either 1's complement or 2's complement technique.
The 1's complement is an ambiguous technique, and 2's complement is an unambiguous
technique. Let's see an example to understand how we can calculate the 2's complement in
signed binary number representation.
Example 1: +6 and -6
https://www.javatpoint.com/2s-complement-in-digital-electronics 3/7
8.11.2023 15:35 2's Complement in Digital Electronics - Javatpoint
The number +6 is represented as same as the binary number. For representing both numbers,
take the 5-bit register.
1. +6=0 0110
2. Now, find the 1's complement of the number 0 0110, i.e. 1 1001.
3. Now, add 1 to its LSB. When we add 1 to the LSB of 11001, the newly generated number
comes out 11010. Here, the sign bit is one which means the number is the negative
number.
The number +120 is represented as same as the binary number. For representing both
numbers, take the 8-bit register.
1. +120=0 1111000
2. Now, find the 1's complement of the number 0 1111000, i.e. 1 0000111. Here, the MSB
denotes the number is the negative number.
3. Now, add 1 to its LSB. When we add 1 to the LSB of 1 0000111, the newly generated
number comes out 1 0001000. Here, the sign bit is one, which means the number is the
negative number.
← Prev Next →
https://www.javatpoint.com/2s-complement-in-digital-electronics 4/7
8.11.2023 15:36 9's and 10's Complement in Digital Electronics - Javatpoint
9's Complement
The 9's complement is used to find the subtraction of the decimal numbers. The 9's
complement of a number is calculated by subtracting each digit of the number by 9. For
example, suppose we have a number 1423, and we want to find the 9's complement of the
number. For this, we subtract each digit of the number 1423 by 9. So, the 9's complement of
the number 1423 is 9999-1423= 8576.
With the help of the 9's complement, the process of subtraction is done in a much easier way.
Generally, we subtract the subtrahend from the minuend, but in a case when we perform
subtraction using 9's complement, there is no need to do the same.
For subtracting two numbers using 9's complement, we first have to find the 9's complement of
the subtrahend and then we will add this complement value with the minuend. There are two
possible cases when we subtract the numbers using 9's complement.
For subtracting the smaller number from the larger number using 9's complement, we will find
the 9's complement of the subtrahend, and then we will add this complement value with the
minuend. By adding both these values, the result will come in the formation of carry. At last, we
will add this carry to the result obtained previously.
https://www.javatpoint.com/9s-and-10s-complement-in-digital-electronics 2/8
8.11.2023 15:36 9's and 10's Complement in Digital Electronics - Javatpoint
In this case, when we add the complement value and the minuend, the result will not come in
the formation of carry. This indicates that the number is negative, and for finding the final
result, we need to find the 9's complement of the result.
10's Complement
The 10's complement is also used to find the subtraction of the decimal numbers. The 10's
complement of a number is calculated by subtracting each digit by 9 and then adding 1 to the
result. Simply, by adding 1 to its 9's complement we can get its 10's complement value. For
example, suppose we have a number 1423, and we want to find the 10's complement of the
number. For this, we find the 9's complement of the number 1423 that is 9999-1423= 8576,
and now we will add 1 to the result. So the 10's complement of the number 1423 is
8576+1=8577.
https://www.javatpoint.com/9s-and-10s-complement-in-digital-electronics 3/8
8.11.2023 15:36 9's and 10's Complement in Digital Electronics - Javatpoint
For subtracting two numbers using 10's complement, we first have to find the 10's complement
of the subtrahend, and then we will add this complement value with the minuend. There are
two possible cases when we subtract the numbers using 10's complement.
For subtracting the smaller number from the larger number using 10's complement, we will find
the 10's complement of the subtrahend and then we will add this complement value with the
minuend. By adding both these values, the result will come in the formation of carry. We ignore
this carry and the remaining digits will be the answer.
In this case, when we add the complement value and the minuend, the result will not come in
the formation of carry. This indicates that the number is negative and for finding the final
result, we need to find the 10's complement of the result obtained by adding complement
value of subtrahend and minuend.
https://www.javatpoint.com/9s-and-10s-complement-in-digital-electronics 4/8
8.11.2023 15:36 9's and 10's Complement in Digital Electronics - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/9s-and-10s-complement-in-digital-electronics 5/8
8.11.2023 15:36 Addition and Subtraction using 1's Complement in Digital Electronics - Javatpoint
Case 1: Addition of the positive number with a negative number when the positive
number has a greater magnitude.
Initially, calculate the 1's complement of the given negative number. Sum up with the given
positive number. If we get the end-around carry 1, it gets added to the LSB.
1. First, find the 1's complement of the negative number 1001. So, for finding 1's
complement, change all 0 to 1 and all 1 to 0. The 1's complement of the number 1001 is
0110.
3. By adding both numbers, we get the end-around carry 1. We add this end around carry
to the LSB of 0011.
0011+1=0100
Case 2: Adding a positive value with a negative value in case the negative number has a
higher magnitude.
Initially, calculate the 1's complement of the negative value. Sum it with a positive number. In
this case, we did not get the end-around carry. So, take the 1's complement of the result to get
the final result.
https://www.javatpoint.com/addition-and-subtraction-using-1s-complement-in-digital-electronics 2/7
8.11.2023 15:36 Addition and Subtraction using 1's Complement in Digital Electronics - Javatpoint
1. First find the 1's complement of the negative number 1110. So, for finding 1's
complement, we change all 0 to 1, and all 1 to 0. 1's complement of the number 1110 is
0001.
3. Now, find the 1's complement of the result 1110 that is the final result. So, the 1's
complement of the result 1110 is 0001, and we add a negative sign before the number
so that we can identify that it is a negative number.
In this case, first find the 1's complement of both the negative numbers, and then we add both
these complement numbers. In this case, we always get the end-around carry, which get added
to the LSB, and for getting the final result, we take the 1's complement of the result.
1. Firstly find the 1's complement of the negative numbers 01101 and 01110. So, for finding
1's complement, we change all 0 to 1, and all 1 to 0. 1's complement of the number
01110 is 10001, and 01101 is 10010.
2. Now, we add both the complement numbers, i.e., 10001 and 10010;
10001+10010= 1 00011
3. By adding both numbers, we get the end-around carry 1. We add this end-around carry
to the LSB of 00011.
00011+1=00100
4. Now, find the 1's complement of the result 00100 that is the final answer. So, the 1's
complement of the result 00100 is 110111, and add a negative sign before the number
so that we can identify that it is a negative number.
https://www.javatpoint.com/addition-and-subtraction-using-1s-complement-in-digital-electronics 3/7
8.11.2023 15:36 Addition and Subtraction using 1's Complement in Digital Electronics - Javatpoint
If got a carry, add the carry to its LSB. Else take 1's complement of the result which will
be negative
We take 1's complement of subtrahend 00111, which comes out 11000. Now, sum them. So,
10101+11000 =1 01101.
In the above result, we get the carry bit 1, so add this to the LSB of a given result, i.e.,
01101+1=01110, which is the answer.
We take 1's complement of subtrahend 10111, which comes out 01000. Now, add both of the
numbers. So,
10101+01000 =11101.
In the above result, we didn't get the carry bit. So calculate the 1's complement of the result,
i.e., 00010, which is the negative number and the final answer.
← Prev Next →
Feedback
https://www.javatpoint.com/addition-and-subtraction-using-1s-complement-in-digital-electronics 4/7
8.11.2023 15:36 Addition and Subtraction using 2's Complement in Digital Electronics - Javatpoint
Case 1: Addition of the positive number with a negative number when the positive
number has a greater magnitude.
Initially find the 2's complement of the given negative number. Sum up with the given positive
number. If we get the end-around carry 1 then the number will be a positive number and the
carry bit will be discarded and remaining bits are the final result.
1. First, find the 2's complement of the negative number 1001. So, for finding 2's
complement, change all 0 to 1 and all 1 to 0 or find the 1's complement of the number
1001. The 1's complement of the number 1001 is 0110, and add 1 to the LSB of the
result 0110. So the 2's complement of number 1001 is 0110+1=0111
3. By adding both numbers, we get the end-around carry 1. We discard the end-around
carry. So, the addition of both numbers is 0100.
Case 2: Adding of the positive value with a negative value when the negative number has
a higher magnitude.
Initially, add a positive value with the 2's complement value of the negative number. Here, no
end-around carry is found. So, we take the 2's complement of the result to get the final result.
https://www.javatpoint.com/addition-and-subtraction-using-2s-complement-in-digital-electronics 2/7
8.11.2023 15:36 Addition and Subtraction using 2's Complement in Digital Electronics - Javatpoint
1. First, find the 2's complement of the negative number 1110. So, for finding 2's
complement, add 1 to the LSB of its 1's complement value 0001.
0001+1=0010
3. Find the 2's complement of the result 1110 that is the final result. So, the 2's
complement of the result 1110 is 0001, and add a negative sign before the number so
that we can identify that it is a negative number.
In this case, first, find the 2's complement of both the negative numbers, and then we will add
both these complement numbers. In this case, we will always get the end-around carry, which
will be added to the LSB, and forgetting the final result, we will take the2's complement of the
result.
1. Firstly find the 2's complement of the negative numbers 01101 and 01110. So, for finding
2's complement, we add 1 to the LSB of the 1's complement of these numbers. 2's
complement of the number 01110 is 10010, and 01101 is 10011.
3. By adding both numbers, we get the end-around carry 1. This carry is discarded and the
final result is the 2.s complement of the result 00101. So, the 2's complement of the
result 00101 is 11011, and we add a negative sign before the number so that we can
identify that it is a negative number.
If we get the carry by adding both the numbers, then we discard this carry and the result
is positive else take 2's complement of the result which will be negative.
https://www.javatpoint.com/addition-and-subtraction-using-2s-complement-in-digital-electronics 3/7
8.11.2023 15:36 Addition and Subtraction using 2's Complement in Digital Electronics - Javatpoint
We take 2's complement of subtrahend 00111, which is 11001. Now, sum them. So,
10101+11001 =1 01110.
In the above result, we get the carry bit 1. So we discard this carry bit and remaining is the final
result and a positive number.
We take 2's complement of subtrahend 10111, which comes out 01001. Now, we add both of
the numbers. So,
10101+01001 =11110.
In the above result, we didn't get the carry bit. So calculate the 2's complement of the result,
i.e., 00010. It is the negative number and the final answer.
← Prev Next →
Feedback
https://www.javatpoint.com/addition-and-subtraction-using-2s-complement-in-digital-electronics 4/7
8.11.2023 15:37 Boolean Algebra in Digital Electronics - Javatpoint
Boolean algebra
The logical symbol 0 and 1 are used for representing the digital input or output. The symbols
"1" and "0" can also be used for a permanently open and closed digital circuit. The digital
circuit can be made up of several logic gates. To perform the logical operation with minimum
logic gates, a set of rules were invented, known as the Laws of Boolean Algebra. These rules
are used to reduce the number of logic gates for performing logic operations.
The Boolean algebra is mainly used for simplifying and analyzing the complex Boolean
expression. It is also known as Binary algebra because we only use binary numbers in this.
George Boole developed the binary algebra in 1854.
1. Only two values(1 for high and 0 for low) are possible for the variable used in Boolean
algebra.
2. The overbar(-) is used for representing the complement variable. So, the complement of
variable C is represented as .
Annulment Law
When the variable is AND with 0, it will give the result 0, and when the variable is OR with 1, it
will give the result 1, i.e.,
B.0 = 0
B+1 = 1
Identity Law
When the variable is AND with 1 and OR with 0, the variable remains the same, i.e.,
B.1 = B
https://www.javatpoint.com/boolean-algebra-in-digital-electronics 2/7
8.11.2023 15:37 Boolean Algebra in Digital Electronics - Javatpoint
B+0 = B
Idempotent Law
When the variable is AND and OR with itself, the variable remains same or unchanged, i.e.,
B.B = B
B+B = B
Complement Law
When the variable is AND and OR with its complement, it will give the result 0 and 1
respectively.
B.B' = 0
B+B' = 1
This law states that, when the variable comes with two negations, the symbol gets removed and
the original variable is obtained.
((A)')' = A
Commutative Law
This law states that no matter in which order we use the variables. It means that the order of
variables doesn't matter in this law.
A.B = B.A
A+B = B+A
Associative Law
This law states that the operation can be performed in any order when the variables priority is
of same as '*' and '/'.
(A.B).C = A.(B.C)
(A+B)+C = A+(B+C)
https://www.javatpoint.com/boolean-algebra-in-digital-electronics 3/7
8.11.2023 15:37 Boolean Algebra in Digital Electronics - Javatpoint
Distributive Law
This law allows us to open up of brackets. Simply, we can open the brackets in the Boolean
expressions.
A+(B.C) = (A+B).(A+C
A.(B+C) = (A.B)+(A.C)
Absorption Law
B+(B.A) = B
B.(B+A) = B
De Morgan Law
The operation of an OR and AND logic circuit will remain same if we invert all the inputs,
change operators from AND to OR and OR to AND, and invert the output.
(A.B)' = A'+B'
(A+B)' = A'.B'
← Prev Next →
Feedback
https://www.javatpoint.com/boolean-algebra-in-digital-electronics 4/7
8.11.2023 15:38 Boolean Functions in Digital Electronics - Javatpoint
Boolean Functions
The binary variables and logic operations are used in Boolean algebra. The algebraic expression
is known as Boolean Expression, is used to describe the Boolean Function. The Boolean
expression consists of the constant value 1 and 0, logical operation symbols, and binary
variables.
We defined the Boolean function F=xy' z+p in terms of four binary variables x, y, z, and p. This
function will be equal to 1 when x=1, y=0, z=1 or z=1.
Example 2:
Apart from the algebraic expression, the Boolean function can also be described in terms of the
truth table. We can represent a function using multiple algebraic expressions. They are their
logically equivalents. But for every function, we have only one unique truth table.
In truth table representation, we represent all the possible combinations of inputs and their
result. We can convert the switching equations into truth tables.
Example: F(A,B,C,D)=A+BC'+D
The output will be high when A=1 or BC'=1 or D=1 or all are set to 1. The truth table of the
above example is given below. The 2n is the number of rows in the truth table. The n defines
the number of input variables. So the possible input combinations are 23=8.
https://www.javatpoint.com/boolean-functions-in-digital-electronics 2/7
8.11.2023 15:38 Boolean Functions in Digital Electronics - Javatpoint
Karnaugh-map or K-map
De-Morgan's law is very helpful for manipulating logical expressions. The logic gates can also
realize the logical expression. The k-map method is used to reduce the logic gates for a
minimum possible value required for the realization of a logical expression. The K-map method
will be done in two different ways, which we will discuss later in the Simplification of Boolean
expression section.
Apart from the K-map, we can also use the NAND gate for simplifying the Boolean functions.
Let's see an example:
https://www.javatpoint.com/boolean-functions-in-digital-electronics 3/7
8.11.2023 15:38 Boolean Functions in Digital Electronics - Javatpoint
← Prev Next →
Feedback
Boolean Addition
The addition operation of Boolean algebra is similar to the OR operation. In digital circuits, the
OR operation is used to calculate the sum term, without using AND operation. A + B, A + B', A
+ B + C', and A' + B + + D' are some of the examples of 'sum term'. The value of the sum term
is true when one or more than one literals are true and false when all the literals are false.
Boolean Multiplication
The multiplication operation of Boolean algebra is similar to the AND operation. In digital
circuits, the AND operation calculates the product, without using OR operation. AB, AB, ABC,
and ABCD are some of the examples of the product term. The value of the product term is true
when all the literals are true and false when any one of the literal is false.
Commutative Law
This law states that no matter in which order we use the variables. It means that the order of
variables doesn't matter. In Boolean algebra, the OR and the addition operations are similar. In
the below diagram, the OR gate display that the order of the input variables does not matter at
all.
A+B = B+A
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 2/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
A.B = B.A
Associative Law
This law states that the operation can be performed in any order when the variables priority is
same. As '*' and '/' have same priority. In the below diagram, the associative law is applied to
the 2-input OR gate.
A + (B + C) = (A + B) + C
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 3/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
A(BC) = (AB)C
According to this law, no matter in what order the variables are grouped when ANDing more
than two variables. In the below diagram, the associative law is applied to 2-input AND gate.
Distributive Law:
According to this law, if we perform the OR operation of two or more variables and then
perform the AND operation of the result with a single variable, then the result will be similar to
performing the AND operation of that single variable with each two or more variable and then
perform the OR operation of that product. This law explains the process of factoring.
A(B + C) = AB + AC
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 4/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
1. A+0=A 7. A.A=A
2. A+1=1 8. A.A'=0
3. A.0=0 9. A''=A
Rule 1: A + 0 = A
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform OR
operation with 0, the result will be the same as the input variable. So, if the variable value is 1,
then the result will be 1, and if the variable value is 0, then the result will be 0.
Diagrammatically, this rule can be defined as:
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 5/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
Rule 2: (A + 1) = 1
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform OR
operation with 1, the result will always be 1. So, if the variable value is either 1 or 0, then the
result will always be 1. Diagrammatically, this rule can be defined as:
Rule 3: (A.0) = 0
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with 0, the result will always be 0. This rule states that an input variable ANDed
with 0 is equal to 0 always. Diagrammatically, this rule can be defined as:
Rule 4: (A.1) = A
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with 1, the result will always be equal to the input variable. This rule states that
an input variable ANDed with 1 is equal to the input variable always. Diagrammatically, this rule
can be defined as:
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 6/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
Rule 5: (A + A) = A
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
OR operation with the same variable, the result will always be equal to the input variable. This
rule states an input variable ORed with itself is equal to the input variable always.
Diagrammatically, this rule can be defined as:
Rule 6: (A + A') = 1
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
OR operation with the complement of that variable, the result will always be equal to 1. This
rule states that a variable ORed with its complement is equal to 1 always. Diagrammatically, this
rule can be defined as:
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 7/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
Rule 7: (A.A) = A
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with the same variable, the result will always be equal to that variable only. This
rule states that a variable ANDed with itself is equal to the input variable always.
Diagrammatically, this rule can be defined as:
Rule 8: (A.A') = 0
Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with the complement of that variable, the result will always be equal to 0. This
rule states that a variable ANDed with its complement is equal to 0 always. Diagrammatically,
this rule can be defined as:
Rule 9: A = (A')'
This rule states that if we perform the double complement of the variable, the result will be the
same as the original variable. So, when we perform the complement of variable A, then the
result will be A'. Further if we again perform the complement of A', we will get A, that is the
original variable.
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 8/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
We can prove this rule by using the rule 2, rule 4, and the distributive law as:
Rule 11: A + AB = A + B
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 9/13
8.11.2023 15:38 Laws and Rules of Boolean algebra - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/laws-and-rules-of-boolean-algebra-in-digital-electronics 10/13
8.11.2023 15:39 Logic Gates in Digital Electronics - Javatpoint
Logic Gates
Logic gates play an important role in circuit design and digital systems. It is a building block of
a digital system and an electronic circuit that always have only one output. These gates can
have one input or more than one input, but most of the gates have two inputs. On the basis of
the relationship between the input and the output, these gates are named as AND gate, OR
gate, NOT gate, etc.
AND Gate
This gate works in the same way as the logical operator "and". The AND gate is a circuit that
performs the AND operation of the inputs. This gate has a minimum of 2 input values and an
output value.
Logic Design
Truth Table
https://www.javatpoint.com/logic-gates-in-digital-electronics 2/10
8.11.2023 15:39 Logic Gates in Digital Electronics - Javatpoint
OR Gate
This gate works in the same way as the logical operator "or". The OR gate is a circuit which
performs the OR operation of the inputs. This gate also has a minimum of 2 input values and
an output value.
Y=A OR B OR C OR D……N
Y=A+B+C+D……N
Logic Design
Truth Table
NOT Gate
The NOT gate is also called an inverter. This gate gives the inverse value of the input value as a
result. This gate has only one input and one output value.
Y=NOT A
Y=A'
https://www.javatpoint.com/logic-gates-in-digital-electronics 3/10
8.11.2023 15:39 Logic Gates in Digital Electronics - Javatpoint
Logic Design
Truth Table
NAND Gate
The NAND gate is the combination of AND gate and NOT gate. This gate gives the same result
as a NOT-AND operation. This gate can have two or more than two input values and only one
output value.
Logic Design
https://www.javatpoint.com/logic-gates-in-digital-electronics 4/10
8.11.2023 15:39 Logic Gates in Digital Electronics - Javatpoint
Truth Table
NOR Gate
The NOR gate is the combination of an OR gate and NOT gate. This gate gives the same result
as the NOT-OR operation. This gate can have two or more than two input values and only one
output value.
Logic Design
Truth Table
XOR Gate
The XOR gate is also known as the Ex-OR gate. The XOR gate is used in half and full adder and
subtractor. The exclusive-OR gate is sometimes called as EX-OR and X-OR gate. This gate can
have two or more than two input values and only one output value.
https://www.javatpoint.com/logic-gates-in-digital-electronics 5/10
8.11.2023 15:39 Logic Gates in Digital Electronics - Javatpoint
Logic Design
Truth Table
XNOR Gate
The XNOR gate is also known as the Ex-NOR gate. The XNOR gate is used in half and full adder
and subtractor. The exclusive-NOR gate is sometimes called as EX-NOR and X-NOR gate. This
gate can have two or more than two input values and only one output value.
Logic Design
https://www.javatpoint.com/logic-gates-in-digital-electronics 6/10
8.11.2023 15:39 Logic Gates in Digital Electronics - Javatpoint
Truth Table
← Prev Next →
Feedback
https://www.javatpoint.com/logic-gates-in-digital-electronics 7/10
8.11.2023 15:39 AND Gate in Digital Electronics - Javatpoint
AND Gate
The AND gate plays an important role in the digital logic circuit. The output state of the AND
gate will always be low when any of the inputs states is low. Simply, if any input value in the
AND gate is set to 0, then it will always return low output(0).
The logic or Boolean expression for the AND gate is the logical multiplication of inputs denoted
by a full stop or a single dot as
A.B=Y
The value of Y will be true when both the inputs A and B are set to true.
This is the simple formation of the AND gate. In this type of AND gate, there are only two input
values and an output value. There are 22=4 possible combinations of inputs. The truth table
and logic design are given below:
Logic Design
Truth Table
https://www.javatpoint.com/and-gate-in-digital-electronics 2/7
8.11.2023 15:39 AND Gate in Digital Electronics - Javatpoint
Unlike 2-input AND gate, the 3-input AND gate have three inputs. The Boolean expression of
the logic AND gate is defined as the binary operation dot(.). The AND gate can be cascaded
together to form any number of individual inputs. There are 23=8 possible combinations of
inputs. The truth table and logic design is given below:
Logic Design
Truth Table
In digital electronics, we can form n-input AND gate also. If there are n inputs, then (N/2)+1
AND gates will be used.
For example:
If we have 6 inputs A, B, C. D, E, F, then 4 AND gates are used in the logic design of 6-input
AND gate. There is the following expression of the 6-input AND gate:
Y=(A.B).(C.D).(E.F)
https://www.javatpoint.com/and-gate-in-digital-electronics 3/7
8.11.2023 15:39 AND Gate in Digital Electronics - Javatpoint
Logic Design
Truth Table
← Prev Next →
Feedback
https://www.javatpoint.com/and-gate-in-digital-electronics 4/7
8.11.2023 15:40 OR Gate in Digital Electronics - Javatpoint
OR Gate
The OR gate is a mostly used digital logic circuit. The output state of the OR gate will always be
low when both of the inputs states is low. Simply, if any input value in the OR gate is set to 1,
then it will always return high-level output(1).
The logic or Boolean expression for the OR gate is the logical addition of inputs denoted by
plus sign(+) as
A+B=Y
The value of Y will be true when one of the inputs is set to true.
This is the simple form of the OR gate. In this type of OR gate, there are only two input values
and an output value. There are 22=4 possible combinations of inputs. The truth table and logic
design are given below:
Logic Design
Truth Table
https://www.javatpoint.com/or-gate-in-digital-electronics 2/7
8.11.2023 15:40 OR Gate in Digital Electronics - Javatpoint
Just like AND gate, the OR gate can also have any number of individual inputs. The Boolean
expression of the logical OR gate is defined as the binary operation plus(+). Like AND gate, OR
gate can also be cascaded together to form any number of individual inputs. There are 23=8
possible combinations of inputs. The truth table and logic design are given below:
Logic Design
Truth Table
The n-input OR gate can also be formed. If there are n inputs, then (N/2)+1 OR gates will be
used.
For example:
https://www.javatpoint.com/or-gate-in-digital-electronics 3/7
8.11.2023 15:40 OR Gate in Digital Electronics - Javatpoint
If we have 6 inputs A, B, C. D, E, F, then 4 OR gates are used in the logic design of the 6-input
OR gate. There is the following expression of the 6-input OR gate:
Y=(A+B)+(C+D)+(E+F)
Y=A OR B OR C OR D OR E OR F
Logic Design
Truth Table
← Prev Next →
https://www.javatpoint.com/or-gate-in-digital-electronics 4/7
8.11.2023 15:40 NOT Gate in Digital Electronics - Javatpoint
NOT Gate
The NOT gate is the most basic logic gate of all other logic gates. NOT gate is also known as an
inverter or an inverting Buffer. NOT gate only has one input and one output. When the input
signal is "Low", the output signal is "High" and when the input signal is "High", the output is
"Low". The Boolean expression for the NOT gate is as follows:
A'=Y
The standard NOT gate is given a symbol that is shaped like a triangle with a circle at the end,
pointing to the right. This circle is known as an "invert bubble" and is used to represent the
logical operation of the NOT function in the NOT, NAND and NOR symbols in their output.
Logic Design
Truth Table
The complement value is generated by the NOT gate. The NOT gate is so-called because when
the input signal is 0, the output signal will NOT be 0, Similarly, when the input signal is 1, the
output signal will NOT be 1.
In the NOT gate, the bubble denotes the single inversion of the output signal. But this bubble
can also exist on the gate's input to indicate an active-less input. This reversal of the input
signal is not limited only to the NOT gate, but can also be used on any digital circuit or gate, as
https://www.javatpoint.com/not-gate-in-digital-electronics 2/6
8.11.2023 15:40 NOT Gate in Digital Electronics - Javatpoint
shown with the operation of inversion, whether it is at the input or output terminals. The
easiest way is to think of the bubble as an inverter.
Equivalent Gates
The NOT gate can also be formed with the help of the universal gates, i.e., NAND and NOR. For
this, we have to connect both the inputs together to a common input signal. The NOT gate
representation of NAND and NOR gate is as follows:
← Prev Next →
Feedback
https://www.javatpoint.com/not-gate-in-digital-electronics 3/6
8.11.2023 15:40 NAND Gate in Digital Electronics - Javatpoint
NAND Gate
The NAND gate is a special type of logic gate in the digital logic circuit. The NAND gate is the
universal gate. It means all the basic gates such as AND, OR, and NOT gate can be constructed
using a NAND gate. The NAND gate is the combination of the NOT-AND gate. The output state
of the NAND gate will be low only when all the inputs are high. Simply, this gate returns the
complement result of the AND gate.
The logic or Boolean expression for the NAND gate is the complement of logical multiplication
of inputs denoted by a full stop or a single dot as
(A.B)'=Y
The value of Y will be true when any one of the input is set to 0.
This is the simple formation of the NAND gate. In this type of NAND gate, there are only two
input values and an output value. There are 22=4 possible combinations of inputs. The truth
table and logic design are given below:
Logic Design
Truth Table
https://www.javatpoint.com/nand-gate-in-digital-electronics 2/9
8.11.2023 15:40 NAND Gate in Digital Electronics - Javatpoint
Unlike the 2-input NAND gate, the 3-input NAND gate has three inputs. The Boolean
expression of the logic NAND gate is defined as the binary operation dot(.). The NAND gate
can be cascaded together to form any number of individual inputs. There are 23=8 possible
combinations of inputs. The truth table and logic design are given below:
Logic Design
Truth Table
Just like AND, NOT, and OR gate, we can also form n-input NAND gate. If the number of inputs
required is odd, any "unused" input can be held high by directly connecting it to the power
supply using high "suitable" pull-up resistors. There is the following expression of the 4-input
NAND gate:
https://www.javatpoint.com/nand-gate-in-digital-electronics 3/9
8.11.2023 15:40 NAND Gate in Digital Electronics - Javatpoint
Y=((A.B).(C.D))'
Logic Design
Truth Table
https://www.javatpoint.com/nand-gate-in-digital-electronics 4/9
8.11.2023 15:40 NAND Gate in Digital Electronics - Javatpoint
https://www.javatpoint.com/nand-gate-in-digital-electronics 5/9
8.11.2023 15:40 NAND Gate in Digital Electronics - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/nand-gate-in-digital-electronics 6/9
8.11.2023 15:40 NOR Gate in Digital Electronics - Javatpoint
NOR Gate
The NOR gate is also a universal gate. So, we can also form all the basic gates using the NOR
gate. The NOR gate is the combination of the NOT-OR gate. The output state of the NOR gate
will be high only when all of the inputs are low. Simply, this gate returns the complement result
of the OR gate.
The logical or Boolean expression for the NOR gate is the complement of logical multiplication
of inputs denoted by the plus sign as
(A+B)'=Y
The value of Y will be true when all of its inputs are set to 0.
Just like other gates, it is also a simple form of the NOR gate. In this type of NOR gate, there
are only two input values and an output value. There are 22=4 possible combinations of inputs.
The truth table and logic design are given below:
Logic Design
Truth Table
https://www.javatpoint.com/nor-gate-in-digital-electronics 2/9
8.11.2023 15:40 NOR Gate in Digital Electronics - Javatpoint
Unlike the 2-input N gate, the 3-input NOR gate has three inputs. The Boolean expression of
the logic NOR gate is defined as the binary operation addition (+). The NOR gate can be
cascaded together to form any number of individual inputs. There are 23=8 possible
combinations of inputs. The truth table and logic design are given below:
Logic Design
Truth Table
Just like the NAND gate, we can also form the n-input NOR gate. If the number of inputs
required is odd, any "unused" input can be held low by directly connecting it to the power
supply using low "suitable" pull-up resistors. There is the following expression of the 4-input
NOR gate:
https://www.javatpoint.com/nor-gate-in-digital-electronics 3/9
8.11.2023 15:40 NOR Gate in Digital Electronics - Javatpoint
Y=((A+B)+(C+D))'
Logic Design
Truth Table
https://www.javatpoint.com/nor-gate-in-digital-electronics 4/9
8.11.2023 15:40 NOR Gate in Digital Electronics - Javatpoint
https://www.javatpoint.com/nor-gate-in-digital-electronics 5/9
8.11.2023 15:40 NOR Gate in Digital Electronics - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/nor-gate-in-digital-electronics 6/9
8.11.2023 15:41 XOR gate - Javatpoint
XOR gate
The XOR gate stands for the Exclusive-OR gate. This gate is a special type of gate used in
different types of computational circuits. Apart from the AND, OR, NOT, NAND, and NOR gate,
there are two special gates, i.e., Ex-OR and Ex-NOR. These gates are not basic gates in their
own and are constructed by combining with other logic gates. Their Boolean output function is
significant enough to be considered as a complete logic gate. The XOR and XNOR gates are the
hybrids gates.
The 2-input OR gate is also known as the Inclusive-OR gate because when both inputs A and B
are set to 1, the output comes out 1(high). In the Ex-OR function, the logic output "1" is
obtained only when either A="1" or B="1" but not both together at the same time. Simply, the
output of the XOR gate is high(1) only when both the inputs are different from each other.
The plus(+) sign within the circle is used as the Boolean expression of the XOR gate. So, the
symbol of the XOR gate is ⨁. This Ex-OR symbol also defines the "direct sum of sub-objects"
expression. These are the following types of Exclusive-OR gate:
Y=(A⨁B)
Y=(A' B+AB')
Logic Design
https://www.javatpoint.com/xor-gate-in-digital-electronics 2/8
8.11.2023 15:41 XOR gate - Javatpoint
Truth Table
Input Output
A B Y
0 0 0
0 1 1
1 0 1
1 1 0
Unlike the 2-input XOR gate, the 3-input XOR gate has three inputs. There are 23=8 possible
combinations of inputs. The Boolean expression of the logical Ex-OR gate is as follows:
Y=A⨁B⨁C
Y=A(BC)'+A' BC'+(AB)' C+ABC
Logic Design
Truth Table
Input Output
A B C Y
0 0 0 0
0 0 1 1
https://www.javatpoint.com/xor-gate-in-digital-electronics 3/8
8.11.2023 15:41 XOR gate - Javatpoint
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
https://www.javatpoint.com/xor-gate-in-digital-electronics 4/8
8.11.2023 15:41 XOR gate - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/xor-gate-in-digital-electronics 5/8
8.11.2023 15:41 XNOR Gate - Javatpoint
XNOR Gate
The XNOR gate is the complement of the XOR gate. It is a hybrid gate. Simply, it is the
combination of the XOR gate and NOT gate. The output level of the XNOR gate is high only
when both of its inputs are the same, either 0 or 1. The symbol of the XNOR gate is the same as
XOR, only complement sign is added. Sometimes, the XNOR gate is also called the Equivalence
gate.
Y=(A⨁B)'
Y=((AB)'+AB)
Logic Design
Truth Table
Input Output
https://www.javatpoint.com/xnor-gate-in-digital-electronics 2/8
8.11.2023 15:41 XNOR Gate - Javatpoint
A B Y
0 0 1
0 1 0
1 0 0
1 1 1
Unlike the 2-input XNOR gate, the 3-input XNOR gate has three inputs. There are 23=8
possible combinations of inputs. The Boolean expression of the logical Ex-OR gate is as follows:
Y=(A⨁B⨁C)'
Y=(ABC)'+ABC'+AB'C+A'BC
Logic Design
Truth Table
Input Output
A B C Y
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
https://www.javatpoint.com/xnor-gate-in-digital-electronics 3/8
8.11.2023 15:41 XNOR Gate - Javatpoint
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
https://www.javatpoint.com/xnor-gate-in-digital-electronics 4/8
8.11.2023 15:41 XNOR Gate - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/xnor-gate-in-digital-electronics 5/8
8.11.2023 15:42 Minterm and Maxterm - Javatpoint
Literal
A Literal signifies the Boolean variables including their complements. Such as B is a boolean
variable and its complements are ~B or B', which are the literals.
Minterm
The product of all literals, either with complement or without complement, is known as
minterm.
Example
A.B
A.~B
~A.B
The complement variables ~A and ~B can also be written as A' and B' respectively. Thus, we
can write the minterm as:
A.B'
A'.B
1. If the variable value is 1, we will take the variable without its complement.
Example
https://www.javatpoint.com/minterm-and-maxterm-in-digital-electronics 2/9
8.11.2023 15:42 Minterm and Maxterm - Javatpoint
Let's assume that we have three Boolean variables A, B, and C having values
A=1
B=0
C=0
Now, we will take the complement of the variables B and C because these values are 0 and will
take A without complement. So, the minterm will be:
Minterm=A.B'C'
Let's take another example in which we have two variables B and C having the value
B=0
C=1
Minterm=B'C
In the first step, we will write the term consisting of all the variables
Next, we will write 0 in place of all the complement variables such as ~A or A'.
Now, we will find the decimal number of the binary formed from the above steps.
In the end, we will write the decimal number as a subscript of letter m(minterm). Let's
take some example to understand the theory of shorthand notation
https://www.javatpoint.com/minterm-and-maxterm-in-digital-electronics 3/9
8.11.2023 15:42 Minterm and Maxterm - Javatpoint
The binary number of the minterm AB' is 10. The decimal point number of (10)2 is 2. So,
the shorthand notation of AB' is
Minterm = m2
The binary number of the minterm AB'C' is 100. The decimal point number of (100)2 is 4.
So, the shorthand notation of AB'C' is
Minterm = m4
Maxterm
The sum of all literals, either with complement or without complement, is known as maxterm.
Example:
A+B
A+~B
~A+B
We know that the complement variables ~A and ~B can be written as A' and B' respectively. So,
the above maxterm can be written as
A+B'
A'+B
https://www.javatpoint.com/minterm-and-maxterm-in-digital-electronics 4/9
8.11.2023 15:42 Minterm and Maxterm - Javatpoint
1. If the variable value is 1, then we will take the variable without a complement.
Example
Let's assume that we have three Boolean variables A, B., and C having values
A=1
B=0
C=0
Now, we will take the complement of the variables B and C because these values are 0 and will
take A without complement. So, the maxterm will be:
Maxterm=A+B'+C'
Let's take another example in which we have two variables B and C having the value
B=0
C=1
Maxterm=B'+C
In the first step, we will write the term consisting of all the variables
Next, we will write 0 in place of all the complement variables such as ~A or A'.
https://www.javatpoint.com/minterm-and-maxterm-in-digital-electronics 5/9
8.11.2023 15:42 Minterm and Maxterm - Javatpoint
Now, we will find the decimal number of the binary formed from the above steps.
In the end, we will write the decimal number as a subscript of letter Here, M denotes
maxterm.
The binary number of the maxterm A+B' is 10. The decimal point number of (10)2 is 2.
So, the shorthand notation of A+B' is
Maxterm = M2
The binary number of the maxterm A+B'+C' is 100. The decimal point number of (100)2
is 4. So, the maxterm of A+B'+C' is m4.
← Prev Next →
Feedback
https://www.javatpoint.com/minterm-and-maxterm-in-digital-electronics 6/9
8.11.2023 15:42 Sum of product(SOP) - Javatpoint
Sum of product(SOP)
A canonical sum of products is a boolean expression that entirely consists of minterms. The
Boolean function F is defined on two variables X and Y. The X and Y are the inputs of the
boolean function F whose output is true when any one of the inputs is set to true. The truth
table for Boolean expression F is as follows:
Inputs Output
X Y F
0 0 0
0 1 1
1 0 1
1 1 1
In our previous section, we learned about how we can form the minterm from the variable's
value. Now, a column will be added for the minterm in the above table. The complement of the
variables is taken whose value is 0, and the variables whose value is 1 will remain the same.
X Y F M
0 0 0 X'Y'
0 1 1 X'Y
1 0 1 XY'
1 1 1 XY
Now, we will add all the minterms for which the output is true to find the desired canonical
SOP(Sum of Product) expression.
F=X' Y+XY'+XY
https://www.javatpoint.com/sum-of-product-form-in-boolean-algebra 2/7
8.11.2023 15:42 Sum of product(SOP) - Javatpoint
Replace the minterms with their shorthand notations in the given expression.
Example: F = X'Y+XY'+XY
F = X'Y+XY'+XY
2. Now, we find the shorthand notations of the minterms X'Y, XY', and XY.
X'Y = (01)2 = m1
XY' = (10)2 = m2
XY = (11)2 = m3
3. In the end, we replace all the minterms with their shorthand notations:
F=m1+m2+m3
Example:
Let us assume that we have a boolean function F, which defined on two variables X and Y. The
minterms for the function F are expressed as shorthand notation is as follows:
https://www.javatpoint.com/sum-of-product-form-in-boolean-algebra 3/7
8.11.2023 15:42 Sum of product(SOP) - Javatpoint
F=∑(1,2,3)
Now, from this expression, we will find the SOP expression. The Boolean function F has two
input variables X and y and the output of F=1 for m1, m2, and m3, i.e., 1st, 2nd, and 3rd
combinations. So,
F=∑(1,2,3)
F= m1 + m2 + m3
F= 01 + 10 + 11
Now, we replace zeros with either X' or Y' and ones with either X or Y. Simply, the complement
variable is used when the variable value is 1 otherwise the non-complement variable is used.
F = ∑(1,2,3)
F=01+10+11
F= A'B + AB' + AB
← Prev Next →
Feedback
https://www.javatpoint.com/sum-of-product-form-in-boolean-algebra 4/7
8.11.2023 15:42 Product of Sum (POS) - Javatpoint
Inputs Output
X Y F
0 0 0
0 1 1
1 0 1
1 1 0
In our minterm and maxterm section, we learned about how we can form the maxterm from
the variable's value. A column will be added for the maxterm in the above table. The
complement of the variables is taken whose value is 0, and the variables whose value is 1 will
remain the same.
X Y F M
0 0 0 X'+Y'
0 1 1 X'+Y
1 0 1 X+Y'
1 1 1 X+Y
Now, we will multiply all the minterms for which the output is false to find the desired canonical
POS(Product of sum) expression.
https://www.javatpoint.com/product-of-sum-form-in-boolean-algebra 2/7
8.11.2023 15:42 Product of Sum (POS) - Javatpoint
F=(X'+Y').(X+Y)
Replace the minterms with their shorthand notations in the given expression.
Example: F = (X'+Y').(X+Y)
F = (X'+Y').(X+Y)
2. Now, we will find the shorthand notations of the maxterms X'+Y' and X+Y.
X'+Y' = (00)2 = M0
X+Y = (11)2 = M3
3. In the end, we will replace all the minterms with their shorthand notations:
F=M0.M3
Example:
https://www.javatpoint.com/product-of-sum-form-in-boolean-algebra 3/7
8.11.2023 15:42 Product of Sum (POS) - Javatpoint
Let us assume that we have a boolean function F, defined on two variables X and Y. The
maxterms for the function F are expressed as shorthand notation is as follows:
F=∏(1,2,3)
Now, from this expression, we find the POS expression. The Boolean function F has two input
variables X and Y and the output of F=0 for M1, M2, and M3, i.e., 1st, 2nd, and 3rd
combinations. So,
F=∏(1,2,3)
F= M1.M2.M3
F= 01.10.11
Next, we replace zeros with either X or Y and ones with either X' or Y'. Simply, if the value of the
variable is 1, then we take the complement of that variable, and if the value of the variable is 0,
then we take the variable "as is".
F = ∑(1,2,3)
F=01.10.11
F=(A+B').( A'+B).( A'+B')
← Prev Next →
Feedback
https://www.javatpoint.com/product-of-sum-form-in-boolean-algebra 4/7
8.11.2023 15:43 Conversion between Canonical Forms - Javatpoint
For converting the canonical expressions, we have to change the symbols ∏, ∑. These symbols
are changed when we list out the index numbers of the equations. From the original form of
the equation, these indices numbers are excluded. The SOP and POS forms of the boolean
function are duals to each other.
There are the following steps using which we can easily convert the canonical forms of the
equations:
2. Use the Duality's De-Morgan's principal to write the indexes of the terms that are not
presented in the given form of an equation or the index numbers of the Boolean
function.
There are the following steps to convert the POS function F = Π x, y, z (2, 3, 5) = x y' z' + x y' z +
x y z' into SOP form:
2. Next, we find the missing indexes of the terms, 000, 110, 001, 100, and 111.
110 = x * y* z'
https://www.javatpoint.com/conversion-between-canonical-forms-in-digital-electronics 2/8
8.11.2023 15:43 Conversion between Canonical Forms - Javatpoint
111 = x * y * z
There are the following steps used to convert the SOP function F = ∑ x, y, z (0, 2, 3, 5, 7) = x' y'
z' + z y' z' + x y' z + xyz' + xyz into POS:
We find the missing indexes of the terms, 001, 110, and 100.
001 = (x + y + z)
https://www.javatpoint.com/conversion-between-canonical-forms-in-digital-electronics 3/8
8.11.2023 15:43 Conversion between Canonical Forms - Javatpoint
Multiply each non-standard product term by the sum of its missing variable and its
complement.
Repeat step 1, until all resulting product terms contain all variables
For each missing variable in the function, the number of product terms doubles.
Example:
Sol:
F=AB+AC+BC
= A B (C + C') + A (B + B') C + (A + A') B C
= A B C + A B C' + A B C + A B' C + A B C + A' B C
= A B C + A B C' + A B' C + A' B C
So, the standard SOP form of non-standard form is F = A B C + A B C' + A B' C + A' B C
By adding each non-standard sum term to the product of its missing variable and its
complement, which results in 2 sum terms
https://www.javatpoint.com/conversion-between-canonical-forms-in-digital-electronics 4/8
8.11.2023 15:43 Conversion between Canonical Forms - Javatpoint
By repeating step 1, until all resulting sum terms contain all variables
By these three steps, we can convert the POS function into a standard POS function.
Example:
1. Term (p' + q + r)
As we can see that the variable s or s' is missing in this term. So we add s*s' = 1 in this term.
Similarly, we add p*p' = 1 in this term for getting the term containing all the variables.
Now, there is no need to add anything because all the variables are contained in this term.
F = (p' + q + r + s)* (p' + q + r + s')* (p + q' + r + s')* (p' + q' + r + s') * (p + q' + r' + s)
← Prev Next →
https://www.javatpoint.com/conversion-between-canonical-forms-in-digital-electronics 5/8
8.11.2023 15:43 Karnaugh Map(K-Map) method - Javatpoint
Just like the truth table, a K-map contains all the possible values of input variables and their
corresponding output values. However, in K-map, the values are stored in cells of the array. In
each cell, a binary value of each input variable is stored.
The K-map method is used for expressions containing 2, 3, 4, and 5 variables. For a higher
number of variables, there is another method used for simplification called the Quine-McClusky
method. In K-map, the number of cells is similar to the total number of variable input
combinations. For example, if the number of variables is three, the number of cells is 23=8, and
if the number of variables is four, the number of cells is 24. The K-map takes the SOP and POS
forms. The K-map grid is filled using 0's and 1's. The K-map is solved by making groups. There
are the following steps used to solve the expressions using K-map:
4. Fill cells of the block for POS with 0 respective to the maxterm.
5. Next, we create rectangular groups that contain total terms in the power of two like 2, 4,
8, … and try to cover as many elements as we can in one group.
6. With the help of these groups, we find the product terms and sum them up for the SOP
form.
2 Variable K-map
There is a total of 4 variables in a 2-variable K-map. There are two variables in the 2-variable K-
map. The following figure shows the structure of the 2-variable K-map:
https://www.javatpoint.com/karnaugh-map-in-digital-electronics 2/8
8.11.2023 15:43 Karnaugh Map(K-Map) method - Javatpoint
In the above figure, there is only one possibility of grouping four adjacent minterms.
The possible combinations of grouping 2 adjacent minterms are {(m0, m1), (m2, m3), (m0,
m2) and (m1, m3)}.
3-variable K-map
The 3-variable K-map is represented as an array of eight cells. In this case, we used A, B, and C
for the variable. We can use any letter for the names of the variables. The binary values of
variables A and B are along the left side, and the values of C are across the top. The value of the
given cell is the binary values of A and B at left side in the same row combined with the value
of C at the top in the same column. For example, the cell in the upper left corner has a binary
value of 000, and the cell in the lower right corner has a binary value of 101.
https://www.javatpoint.com/karnaugh-map-in-digital-electronics 3/8
8.11.2023 15:43 Karnaugh Map(K-Map) method - Javatpoint
5-variable K-map
With the help of the 32- cell K-map, the boolean expression with 5 variables can be simplified.
For constructing a 5-variable K-map, we use two 4-variable K-maps. The cell adjacencies within
each of the 4- variable maps for the 5-variable map are similar to the 4- variable map.
A K-map for five variables (PQRST) can be constructed using two 4-variable maps. Each map
contains 16 cells with all combinations of variables Q, R, S, and T. One map is for P = 0, and the
other is for P = 1).
https://www.javatpoint.com/karnaugh-map-in-digital-electronics 4/8
8.11.2023 15:43 Karnaugh Map(K-Map) method - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/karnaugh-map-in-digital-electronics 5/8
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
Step 1:
Step 2:
Next, we create the K-map by entering 1 to each product-term into the K-map cell and fill the
remaining cells with zeros.
Step 3:
Notice that each group should have the largest number of 'ones'. A group cannot contain an
empty cell or cell that contains 0.
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 2/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
We group the number of ones in the decreasing order. First, we have to try to make the group
of eight, then for four, after that two and lastly for 1.
In horizontally or vertically manner, the groups of ones are formed in shape of rectangle and
square. We cannot perform the diagonal grouping in K-map.
The elements in one group can also be used in different groups only when the size of the
group is increased.
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 3/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
The elements located at the edges of the table are considered to be adjacent. So, we can group
these elements.
We can consider the 'don't care condition' only when they aid in increasing the group-size.
Otherwise, 'don't care' elements are discarded.
Step 4:
In the next step, we find the boolean expression for each group. By looking at the common
variables in cell-labeling, we define the groups in terms of input variables. In the below
example, there is a total of two groups, i.e., group 1 and group 2, with two and one number of
'ones'.
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 4/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
In the first group, the ones are present in the row for which the value of A is 0. Thus, they
contain the complement of variable A. Remaining two 'ones' are present in adjacent columns.
In these columns, only B term in common is the product term corresponding to the group as
A'B. Just like group 1, in group 2, the one's are present in a row for which the value of A is 1. So,
the corresponding variables of this column are B'C'. The overall product term of this group is
AB'C'.
Step 5:
Lastly, we find the boolean expression for the Output. To find the simplified boolean expression
in the SOP form, we combine the product-terms of all individual groups. So the simplified
expression of the above k-map is as follows:
A'+AB'C'
Let's take some examples of 2-variable, 3-variable, 4-variable, and 5-variable K-map examples.
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 5/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 6/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
1. We will populate the K-map by entering the value of 0 to each sum-term into the K-map
cell and fill the remaining cells with one's.
3. Now, we will define the boolean expressions for each group as sum-terms.
4. At last, to find the simplified boolean expression in the POS form, we will combine the
sum-terms of all individual groups.
Let's take some example of 2-variable, 3-variable, 4-variable and 5-variable K-map examples
Example 1: Y=(A'+B')+(A'+B)+(A+B)
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 7/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
Example 2: Y=(A + B + C') + (A + B' + C') + (A' + B' + C) + (A' + B' + C')
Example 3: F(A,B,C,D)=π(3,5,7,8,10,11,12,13)
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 8/12
8.11.2023 15:43 Simplification of boolean expressions using Karnaugh Map - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/simplification-of-boolean-expressions-using-karnaugh-map 9/12
8.11.2023 15:44 De-Morgan's Theorem - Javatpoint
De-Morgan's Theorem
A famous mathematician DeMorgan invented the two most important theorems of boolean
algebra. The DeMorgan's theorems are used for mathematical verification of the equivalency of
the NOR and negative-AND gates and the negative-OR and NAND gates. These theorems play
an important role in solving various boolean algebra expressions. In the below table, the logical
operation for each combination of the input variable is defined.
0 0 0 1 0 1
0 1 0 1 1 0
1 0 0 1 1 0
1 1 1 0 1 0
The rules of De-Morgan's theorem are produced from the Boolean expressions for OR, AND,
and NOT using two input variables x and y. The first theorem of Demorgan's says that if we
perform the AND operation of two input variables and then perform the NOT operation of the
result, the result will be the same as the OR operation of the complement of that variable. The
second theorem of DeMorgan says that if we perform the OR operation of two input variables
and then perform the NOT operation of the result, the result will be the same as the AND
operation of the complement of that variable.
0 0 0 1 1 1 1
https://www.javatpoint.com/de-morgans-theorem-of-boolean-algebra-in-digital-electronics 2/9
8.11.2023 15:44 De-Morgan's Theorem - Javatpoint
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
https://www.javatpoint.com/de-morgans-theorem-of-boolean-algebra-in-digital-electronics 3/9
8.11.2023 15:44 De-Morgan's Theorem - Javatpoint
Let's take some examples in which we take some expressions and apply DeMorgan's theorems.
Example 1: (A.B.C)'
(A.B.C)'=A'+B'+C'
Example 2: (A+B+C)'
(A+B+C)'=A'.B'.C
Example 3: ((A+BC')'+D(E+F')')'
For applying the DeMorgan's theorem on this expression, we have to follow the following
expressions:
1) In complete expression, first, we find those terms on which we can apply the DeMorgan's
theorem and treat each term as a single variable.
So,
https://www.javatpoint.com/de-morgans-theorem-of-boolean-algebra-in-digital-electronics 4/9
8.11.2023 15:44 De-Morgan's Theorem - Javatpoint
3) Next, we use rule number 9, i.e., (A=(A')') for canceling the double bars.
Now, this expression has no term in which we can apply any rule or theorem. So, this is the final
expression.
https://www.javatpoint.com/de-morgans-theorem-of-boolean-algebra-in-digital-electronics 5/9
8.11.2023 15:44 De-Morgan's Theorem - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/de-morgans-theorem-of-boolean-algebra-in-digital-electronics 6/9
8.11.2023 15:44 Don't Care Condition - Javatpoint
The cross(×) symbol is used to represent the "don't care" cell in K-map. This cross symbol
represents an invalid combination. The "don't care" in excess-3 code are 0000, 0001, 0010,
1101, 1110, and 1111 because they are invalid combinations. Apart from this, the 4-bit BCD to
Excess-3 code, the "don't care" are 1010, 1011, 1100, 1101, 1110, and 1111.
We can change the standard SOP function into a POS expression by making the "don't care"
terms the same as they are. The missing minterms of the POS form are written as maxterms of
the POS form. In the same way, we can change the standard POS function into an SOP
expression by making the "don't care" terms the same as they are. The missing maxterms of the
SOP form are written as minterm of the SOP form.
Solution:
https://www.javatpoint.com/dont-care-condition-in-k-map-in-digital-electronics 2/8
8.11.2023 15:44 Don't Care Condition - Javatpoint
Solution:
F = A'(B' + C')
Example-3:
Minimize the following function in SOP minimal form using K-Maps: F(A, B, C, D) = m(1,
2, 6, 7, 8, 13, 14, 15) + d(3, 5, 12)
Explanation:
https://www.javatpoint.com/dont-care-condition-in-k-map-in-digital-electronics 3/8
8.11.2023 15:44 Don't Care Condition - Javatpoint
Therefore,
Don't Care conditions has the following significance with respect to the digital circuit design:
Simplification:
These conditions denote the set of inputs that never occurs for given digital circuits. Therefore,
to simplify the boolean output expressions, the 'don't care' are used.
The switching of the state is reduced when we group the terms long with "don't care". This
reduces the required memory space resulting in lower power consumption.
For reducing the number of gates that are used to implement the given expression,
simplification places an important role. So, the 'don't care' makes the logic design more
economical.
Prevention of Hazards:
In the digital system, the 'don't care' place an important role in hazards prevention.
https://www.javatpoint.com/dont-care-condition-in-k-map-in-digital-electronics 4/8
8.11.2023 15:44 Don't Care Condition - Javatpoint
These also play an important role in code conversion. For example- In the design of a 4-bit
BCD-to-XS-3 code converter, the input combinations 1010, 1011, 1100, 1101, 1110, and 1111
are don't cares.
← Prev Next →
Feedback
https://www.javatpoint.com/dont-care-condition-in-k-map-in-digital-electronics 5/8
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
Let's take an example to understand the process of converting a binary number into BCD
Example 1: (11110)2
3) (11110)2 (30)10
We convert each digit of the decimal number into groups of the four-bit binary number.
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 2/11
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
Result:
(11110)2 = (00110000)BCD
Below is the table that contains the BCD code of the decimal and binary number.
ABCD B4 :B3B2B1B0
0000 0 0:0000
0001 1 0:0001
0010 2 0:0010
0011 3 0:0011
0100 4 0:0100
0101 5 0:0101
0110 6 0:0110
0111 7 0:0111
1000 8 0:1000
1001 9 0:1001
1010 10 1:0000
1011 11 1:0001
1100 12 1:0010
1101 13 1:0011
1110 14 1:0100
1111 15 1:0101
In the above table, the most significant bit of the decimal number is represented by the bit B4,
and the least significant bits are represented by B3, B2, B1, and B0. From the above table, we
can express the SOP function for different bits of BCD code are as follows:
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 3/11
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 4/11
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 5/11
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 6/11
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
In the first step, we will convert the BCD number into a decimal by making the four-bit
groups and finding the equivalent decimal number for each group.
In the last step, we will convert a decimal number into Binary using the process of converting
decimal to binary number.
Example 1: (00101000)BCD
Make the groups of 4 digits and find the equivalent decimal number as:
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 7/11
8.11.2023 15:45 Binary to BCD code conversion - Javatpoint
Use the long division method to convert the decimal number into a binary number as:
1. 28 / 2 14 0
2. 14 / 2 7 0
3. 7/2 3 1
4. 3/2 1 1
5. 1/2 0 1
Arrange the remainders in the reverse order. So, the LSB of the binary number is the first
remainder, and the MSB of the binary number is the last remainder.
Result:
(00101000)BCD = (11100)2
← Prev Next →
Feedback
https://www.javatpoint.com/binary-to-bcd-conversion-in-digital-electronics 8/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
ABCD G1 G2 G3 G4
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 2/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
In 4-bit gray code, the 3-bit code is reflected against the axis drawn after the 24-1-1th =8th row.
In the Gray code, the MSB will always be the same as the 1'st bit of the given binary
number.
In order to perform the 2nd bit of the gray code, we perform the exclusive-or (XOR) of
the 1'st and 2nd bit of the binary number. It means that if both the bits are different, the
result will be one else the result will be 0.
In order to get the 3rd bit of the gray code, we need to perform the exclusive-or (XOR) of
the 2nd and 3rd bit of the binary number. The process remains the same for the 4th bit of
the Gray code. Let's take an example to understand these steps.
Example
Suppose we have a binary number 01101, which we want to convert into Gray code. There are
the following steps which need to perform this conversion:
As we know that the 1st bit of the Gray code is the same as the MSB of the binary
number. In our example, the MSB is 0, so the MSB or 1st bit of the gray code is 0.
Next, we perform the XOR operation of the 1'st and the second binary number. The 1st
bit is 0, and the 2nd bit is 1. Both the bits are different, so the 2nd bit of the Gray code is
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 3/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
1.
Now, we perform the XOR of the 2nd bit and 3rd bit of the binary number. The 2nd bit is
1, and the 3rd bit is also 1. These bits are the same, so the 3rd bit of the Gray code is 0.
Again perform the XOR operation of the 3rd and 4th bit of binary number. The 3rd bit is
1, and the 4th bit is 0. As these are different, the 4th bit of the Gray code is 1.
Lastly, perform the XOR of the 4th bit and 5th bit of the binary number. The 4th bit is 0,
and the 5th bit is 1. Both the bits are different, so that the 5th bit of the Gray code is 1.
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 4/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
Just like Binary to Gray code conversion; it is also a very simple process. There are the following
steps used to convert the Gray code into binary.
Just like binary to gray, in gray to binary, the 1st bit of the binary number is similar to the
MSB of the Gray code.
The 2nd bit of the binary number is the same as the 1st bit of the binary number when
the 2nd bit of the Gray code is 0; otherwise, the 2nd bit is altered bit of the 1st bit of
binary number. It means if the 1st bit of the binary is 1, then the 2nd bit is 0, and if it is 0,
then the 2nd bit be 1.
The 2nd step continues for all the bits of the binary number.
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 5/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
Suppose we have the Gray code 01011, which we want to convert into a binary number. There
are the following steps which we need to perform for the conversion:
The 1'st bit of the binary number is the same as the MSB of the Gray code. The MSB of
the Gray code is 0, so the MSB of the binary number is 0.
Now, for the 2nd bit, we check the 2nd bit of the Gray code. The 2nd bit of the Gray code
is 1, so the 2nd bit of the binary number is one that is altered number of 1st
The next bit of the Gray code is 0; the 3rd bit is the same as the 2nd bit of the Gray code,
i.e., 1.
The 4th bit of the Gray code is 1; the 4th bit of the binary number is 0 that is the altered
number of the 3rd
The 5th bit of the Gray code is 1; the 5th bit of the binary number is 1; that is the altered
number of the 4th bit of the binary number.
The bits of 4-bit Gray code are considered as G4G3G2G1. Now from the conversion table,
The Karnaugh maps (K-maps) for G4, G3, G2, and G1 are as follows:
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 6/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 7/11
8.11.2023 15:46 Binary to Gray code conversion - Javatpoint
← Prev Next →
https://www.javatpoint.com/binary-to-gray-code-cconversion-in-digital-electronics 8/11
8.11.2023 15:46 Binary to Excess-3 code conversion - Javatpoint
3. Find the binary code of each digit of the newly generated decimal number.
We can also add 0011 in each 4-bit BCD code of the decimal number for getting excess-3 code.
Let's take an example to understand the process of converting a binary number into Excess-3
code.
3) (11110)2 (30)10
The decimal number is 30. Now, we will add 3 into the decimal number 30.
= 30+33
= 63
3. Now, we find the binary code of each digit of the decimal number 63.
https://www.javatpoint.com/binary-to-excess-3-and-excess-3-to-binary-code-conversion-in-digital-electronics 2/7
8.11.2023 15:46 Binary to Excess-3 code conversion - Javatpoint
We write the binary code of each decimal digit in order to get Excess-3 code as:
Result:
(11110)2 = (01100011)Excess-3
Below is the table that contains the excess-3 code of the decimal and BCD.
ABCD B 3B 2B 1B 0
0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
In the above table, the most significant bit of the decimal number is represented by the bit B3,
and the least significant bits are represented by B2, B1, and B0.
https://www.javatpoint.com/binary-to-excess-3-and-excess-3-to-binary-code-conversion-in-digital-electronics 3/7
8.11.2023 15:46 Binary to Excess-3 code conversion - Javatpoint
In the first step, we will make the group of 4 bits and write the equivalent decimal
number from the Excess-3 table.
At last, we find the binary number of the decimal number using a decimal to binary
conversion.
Example 1: (01100011)Excess-3
1) Making groups of four bits and write their equivalent decimal number.
(0110)Excess-3 = (3)10
(0011)Excess-3 = (0)10
Now, find the binary number of the decimal number (30)10 using a decimal to binary
conversion as:
30/2 15 0 (LSB)
15/2 7 1
7/2 3 1
3/2 1 1
1/2 0 1(MSB)
https://www.javatpoint.com/binary-to-excess-3-and-excess-3-to-binary-code-conversion-in-digital-electronics 4/7
8.11.2023 15:46 Binary to Excess-3 code conversion - Javatpoint
(30)10=(11110)2
← Prev Next →
Feedback
https://www.javatpoint.com/binary-to-excess-3-and-excess-3-to-binary-code-conversion-in-digital-electronics 5/7
8.11.2023 15:47 BCD to Excess-3 conversion - Javatpoint
The process of converting BCD to Excess-3 is quite simple from other conversions. The Excess-3
code can be calculated by adding 3, i.e., 0011 to each four-digit BCD code. Below is the truth
table for the conversion of BCD to Excess-3 code. In the below table, the variables A, B, C, and
D represent the bits of the binary numbers. The variable 'D' represents the LSB, and the variable
'A' represents the MSB. In the same way, the variables w, x, y, and z represent the bits of the
Excess-3 code. The variable 'z' represents the LSB, and the variable 'w' represents the MSB. The
'don't care conditions' is expressed by the variable 'X'.
A B C D W x y z
0 0 0 0 0 0 0 1 1
1 0 0 0 1 0 1 0 0
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0
https://www.javatpoint.com/conversion-of-bcd-to-excess-3-code-in-digital-electronics 2/10
8.11.2023 15:47 BCD to Excess-3 conversion - Javatpoint
10 1 0 1 0 X X X X
11 1 0 1 1 X X X X
12 1 1 0 0 X X X X
13 1 1 0 1 X X X X
14 1 1 1 0 X X X X
15 1 1 1 1 X X X X
Now, we will use the K-map method to design the logical circuit for the conversion of BCD to
Excess-3 code as:
So,
w=A+BC+BD
x=B' C+B' D+BC' D'
y=CD+C'D'
z=D'
https://www.javatpoint.com/conversion-of-bcd-to-excess-3-code-in-digital-electronics 3/10
8.11.2023 15:47 BCD to Excess-3 conversion - Javatpoint
Example: (100001011001)BCD
To find the Excess-3 code of the given Excess-3 code, first, we will make the group of 4 bits
from right to left. Then, we will add 0011 in each group of 4 bits in order to get the excess-3
code.
https://www.javatpoint.com/conversion-of-bcd-to-excess-3-code-in-digital-electronics 4/10
8.11.2023 15:47 BCD to Excess-3 conversion - Javatpoint
represents the LSB, and the variable 'w' represents the MSB. In the same way, the variables A, B,
C, and D represent the bits of the binary numbers. The variable 'D' represents the LSB, and the
variable 'A' represents the MSB. The 'don't care conditions' is defined by the variable 'X'.
A B C D W x y z
0 0 0 0 0 X X X X
1 0 0 0 1 X X X X
2 0 0 1 0 X X X X
3 0 0 1 1 0 0 0 0
4 0 1 0 0 0 0 0 1
5 0 1 0 1 0 0 1 0
6 0 1 1 0 0 0 1 1
7 0 1 1 1 0 1 0 0
8 1 0 0 0 0 1 0 1
9 1 0 0 1 0 1 1 0
10 1 0 1 0 0 1 1 1
11 1 0 1 1 1 0 0 0
12 1 1 0 0 1 0 0 1
13 1 1 0 1 X X X X
14 1 1 1 0 X X X X
15 1 1 1 1 X X X X
Now, we will use the K-map method to design the logical circuit for the conversion of Excess-3
code to BCD as:
https://www.javatpoint.com/conversion-of-bcd-to-excess-3-code-in-digital-electronics 5/10
8.11.2023 15:47 BCD to Excess-3 conversion - Javatpoint
So,
w=AB+ACD
B=x' y'+x' z'+xyz
C=y' z+yz'
D=z'
Example: (101110001100)Excess-3
To find the BCD code of the given BCD number, first, we make the group of 4 bits from right to
left. Then, we subtract 0011 in each group of 4 bits in order to get the BCD code.
https://www.javatpoint.com/conversion-of-bcd-to-excess-3-code-in-digital-electronics 6/10
8.11.2023 15:47 BCD to Excess-3 conversion - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/conversion-of-bcd-to-excess-3-code-in-digital-electronics 7/10
8.11.2023 15:48 Combinational Logic circuits - Javatpoint
At any instant of time, the output of the combinational circuits depends only on the
present input terminals.
The combinational circuit doesn't have any backup or previous memory. The present
state of the circuit is not affected by the previous state of the input.
The n number of inputs and m number of outputs are possible in combinational logic
circuits.
The 'n' input variable comes from the external source while the 'm' output variable goes to the
external destination. In many applications, the source or destinations are storage registers.
Half Adder
The half adder is a basic building block having two inputs and two outputs. The adder is used
to perform OR operation of two single bit binary numbers. The carry and sum are two output
states of the half adder.
https://www.javatpoint.com/combinational-logic-circuits-in-digital-electronics 2/7
8.11.2023 15:48 Combinational Logic circuits - Javatpoint
Full Adder
The half adder is used to add only two numbers. To overcome this problem, the full adder was
developed. The full adder is used to add three 1-bit binary numbers A, B, and carry C. The full
adder has three input states and two output states i.e., sum and carry.
Half Subtractors
The half subtractor is also a building block of subtracting two binary numbers. It has two inputs
and two outputs. This circuit is used to subtract two single bit binary numbers A and B. The
'diff' and 'borrow' are the two output state of the half adder.
Full Subtractors
The Half Subtractor is used to subtract only two numbers. To overcome this problem, full
subtractor was designed. The full subtractor is used to subtract three 1-bit numbers A, B, and C,
which are minuend, subtrahend, and borrow, respectively. The full subtractor has three input
states and two output states i.e., diff and borrow.
Multiplexers
The multiplexer is a combinational circuit that has n-data inputs and a single output. It is also
known as the data selector which selects one input from the inputs and routes it to the output.
With the help of the selected inputs, one input line from the n-input lines is selected. The
enable input is denoted by E, which is used in cascade.
De-multiplexers
A De-multiplexer performs the reverse operation of a multiplexer. The de-multiplexer has only
one input, which is distributed over several outputs. One output line is selected at a time by
selecting lines. The input is transmitted to the selected output line.
Decoder
A decoder is a combinational circuit having n inputs and to a maximum of m = 2n outputs. The
decoder is the same as the de-multiplexer. The only difference between de-multiplexer and
decoder is that in the decoder, there is no data input. The decoder performs an operation that
is completely opposite of an encoder.
https://www.javatpoint.com/combinational-logic-circuits-in-digital-electronics 3/7
8.11.2023 15:48 Combinational Logic circuits - Javatpoint
Encoder
The encoder is used to perform the reverse operation of the decoder. An encoder having n
number of inputs and m number of outputs is used to produce m-bit binary code which is
related to the digital input number. The encoder takes the digital word and converts it into
another digital word.
← Prev Next →
Feedback
https://www.javatpoint.com/combinational-logic-circuits-in-digital-electronics 4/7
8.11.2023 15:49 Half Adder - Javatpoint
Half Adder
The Half-Adder is a basic building block of adding two numbers as two inputs and produce out
two outputs. The adder is used to perform OR operation of two single bit binary numbers. The
augent and addent bits are two input states, and 'carry' and 'sum 'are two output states of
the half adder.
Block diagram
Truth Table
1. 'A' and' B' are the input states, and 'sum' and 'carry' are the output states.
2. The carry output is 0 in case where both the inputs are not 1.
3. The least significant bit of the sum is defined by the 'sum' bit.
Sum = x'y+xy'
Carry = xy
https://www.javatpoint.com/half-adder-in-digital-electronics 2/8
8.11.2023 15:49 Half Adder - Javatpoint
The Sum bit is generated with the help of the Exclusive-OR or Ex-OR Gate.
The above is the symbol of the EX-OR gate. In the above diagram, 'A' and 'B' are the inputs,
and the 'SUMOUT' is the final outcome after performing the XOR operation of both numbers.
From the above table, it is clear that the XOR gate gives the result 1 when both of the inputs
are different. When both of the inputs are the same, the XOR gives the result 0. To learn more
about the XOR gate, click here.
https://www.javatpoint.com/half-adder-in-digital-electronics 3/8
8.11.2023 15:49 Half Adder - Javatpoint
The XOR gate is unable to generate the carry bit. For this purpose, we use another gate called
AND Gate. The AND gate gives the correct result of the carry.
The above is the symbol of the AND gate. In the above diagram, 'A' and 'B' are the inputs, and
'OUT' is the final outcome after performing AND operation of both numbers.
From the above table, it is clear that the AND gate gives the result 1 when both of the inputs
are 1. When both of the inputs are different and 0, the AND gates gives the result 0. To learn
more about the AND gate, click here.
So, the Half Adder is designed by combining the 'XOR' and 'AND' gates and provide the sum
and carry.
https://www.javatpoint.com/half-adder-in-digital-electronics 4/8
8.11.2023 15:49 Half Adder - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/half-adder-in-digital-electronics 5/8
8.11.2023 15:50 Full Adder - Javatpoint
Full Adder
The half adder is used to add only two numbers. To overcome this problem, the full adder was
developed. The full adder is used to add three 1-bit binary numbers A, B, and carry C. The full
adder has three input states and two output states i.e., sum and carry.
Block diagram
Truth Table
1. 'A' and' B' are the input variables. These variables represent the two significant bits which
are going to be added
2. 'Cin' is the third input which represents the carry. From the previous lower significant
position, the carry bit is fetched.
3. The 'Sum' and 'Carry' are the output variables that define the output values.
https://www.javatpoint.com/full-adder-in-digital-electronics 2/7
8.11.2023 15:50 Full Adder - Javatpoint
4. The eight rows under the input variable designate all possible combinations of 0 and 1
that can occur in these variables.
Note: We can simplify each of the output 'Boolean function' with the help of the unique map
method.
The SOP form can be obtained with the help of K-map as:
The above block diagram describes the construction of the Full adder circuit. In the above
circuit, there are two half adder circuits that are combined using the OR gate. The first half
adder has two single-bit binary inputs A and B. As we know that, the half adder produces two
outputs, i.e., Sum and Carry. The 'Sum' output of the first adder will be the first input of the
second half adder, and the 'Carry' output of the first adder will be the second input of the
second half adder. The second half adder will again provide 'Sum' and 'Carry'. The final
https://www.javatpoint.com/full-adder-in-digital-electronics 3/7
8.11.2023 15:50 Full Adder - Javatpoint
outcome of the Full adder circuit is the 'Sum' bit. In order to find the final output of the 'Carry',
we provide the 'Carry' output of the first and the second adder into the OR gate. The outcome
of the OR gate will be the final carry out of the full adder circuit.
The full adder logic circuit can be constructed using the 'AND' and the 'XOR' gate with an OR
gate.
The actual logic circuit of the full adder is shown in the above diagram. The full adder circuit
construction can also be represented in a Boolean expression.
Sum:
Perform the XOR operation of the outcome with carry. So, the sum is (A XOR B) XOR Cin
which is also represented as:
(A ⊕ B) ⊕ Cin
Carry:
3. Perform the 'OR' operations of both the outputs that come from the previous two steps.
So the 'Carry' can be represented as:
A.B + (A ⊕ B)
https://www.javatpoint.com/full-adder-in-digital-electronics 4/7
8.11.2023 15:50 Half Subtractor - Javatpoint
Half Subtractor
The half subtractor is also a building block for subtracting two binary numbers. It has two
inputs and two outputs. This circuit is used to subtract two single bit binary numbers A and B.
The 'diff' and 'borrow' are two output states of the half subtractor.
Block diagram
Truth Table
Diff= A'B+AB'
Borrow = A'B
'A' and 'B' are the input variables whose values are going to be subtracted.
The 'Diff' and 'Borrow' are the variables whose values define the subtraction result, i.e.,
difference and borrow.
The first two rows and the last row, the difference is 1, but the 'Borrow' variable is 0.
The third row is different from the remaining one. When we subtract the bit 1 from the
bit 0, the borrow bit is produced.
https://www.javatpoint.com/half-subtractor-in-digital-electronics 2/8
8.11.2023 15:50 Half Subtractor - Javatpoint
The Diff bit is generated with the help of the Exclusive-OR or Ex-OR gate.
The above is the symbol of the EX-OR gate. In the above diagram, 'A' and 'B' are the inputs,
and 'Diff' is the final outcome after performing the XOR operation of both numbers.
From the above table, it is clear that the XOR gate gives the result 1 when both of the inputs
are different. When both of the inputs are the same, the XOR gives the result 0. To learn more
about the XOR gate, click here.
https://www.javatpoint.com/half-subtractor-in-digital-electronics 3/8
8.11.2023 15:50 Half Subtractor - Javatpoint
The XOR gate is unable to generate the carry bit. For this purpose, we use another gate called
AND gate. The AND gate is not enough to give the correct result of 'Borrow'. We will use the
NOT gate with the 'AND' gate to get the correct result.
The above is the symbol of the AND gate. In the above diagram, 'A' and 'B' are the inputs, and
'OUT' is the final outcome after performing AND operation of both numbers.
From the above table, it is clear that the AND gate gives the result 1 when both of the inputs
are 1. When both of the inputs are different and 0, the AND gates gives the result 0. To learn
more about the AND gate, click here.
The NOT gate is used to get the inverse output. We can combine the 'AND' and 'NOT' gates in
order to get the combinational gate 'NAND'. By inverting the input 'A' using 'NOT' gate and
then use the output of the 'NOT' gate as the input of the 'AND' gate, we can get the 'Borrow'
bit.
https://www.javatpoint.com/half-subtractor-in-digital-electronics 4/8
8.11.2023 15:50 Half Subtractor - Javatpoint
So, the Half Subtractor is designed by combining the 'XOR', 'AND', and 'NOT' gates and provide
the Diff and Borrow.
← Prev Next →
https://www.javatpoint.com/half-subtractor-in-digital-electronics 5/8
8.11.2023 15:51 Full Subtractor - Javatpoint
Full Subtractor
The Half Subtractor is used to subtract only two numbers. To overcome this problem, a full
subtractor was designed. The full subtractor is used to subtract three 1-bit numbers A, B, and C,
which are minuend, subtrahend, and borrow, respectively. The full subtractor has three input
states and two output states i.e., diff and borrow.
Block diagram
Truth Table
'A' and' B' are the input variables. These variables represent the two significant bits that
are going to be subtracted.
The 'Diff' and 'Borrow' are the output variables that define the output values.
The eight rows under the input variable designate all possible combinations of 0 and 1
that can occur in these variables.
https://www.javatpoint.com/full-subtractor-in-digital-electronics 2/8
8.11.2023 15:51 Full Subtractor - Javatpoint
Note: We can simplify each of the Boolean output functions with the help of the unique map
method.
The SOP form can be obtained with the help of K-map as:
https://www.javatpoint.com/full-subtractor-in-digital-electronics 3/8
8.11.2023 15:51 Full Subtractor - Javatpoint
The above block diagram describes the construction of the Full subtractor circuit. In the
above circuit, there are two half adder circuits that are combined using the OR gate. The first
half subtractor has two single-bit binary inputs A and B. As we know that, the half subtractor
produces two outputs, i.e., 'Diff' and 'Borrow'. The 'Diff' output of the first subtractor will be the
first input of the second half subtractor, and the 'Borrow' output of the first subtractor will be
the second input of the second half subtractor. The second half subtractor will again provide
'Diff' and 'Borrow'. The final outcome of the Full subtractor circuit is the 'Diff' bit. In order to
find the final output of the 'Borrow', we provide the 'Borrow' of the first and the second
subtractor into the OR gate. The outcome of the OR gate will be the final carry 'Borrow' of full
subtractor circuit.
The full subtractor logic circuit can be constructed using the 'AND', 'XOR', and NOT gate with
an OR gate.
The actual logic circuit of the full subtractor is shown in the above diagram. The full subtractor
circuit construction can also be represented in a Boolean expression.
Diff:
Perform the XOR operation of the outcome with 'Borrow'. So, the difference is (A XOR B)
XOR 'Borrowin' which is also represented as:
(A ⊕ B) ⊕ 'Borrowin'
Borrow:
https://www.javatpoint.com/full-subtractor-in-digital-electronics 4/8
8.11.2023 15:51 Full Subtractor - Javatpoint
Perform the 'OR' operations of both the outputs that come from the previous two steps.
So the 'Borrow' can be represented as:
A'.B + (A ⊕ B)'
← Prev Next →
Feedback
https://www.javatpoint.com/full-subtractor-in-digital-electronics 5/8
8.11.2023 15:51 Binary Adder - Javatpoint
Binary Adder
The registers play an important role in performing the micro-operations. The registers hold the
digital component and the data which performs the arithmetic operation. The Binary Adder is a
logical circuit which is used to perform the addition operation of two binary number of any
length.
The Binary Adder is formed with the help of the Full-Adder circuit. The Full-Adders are
connected in series, and the output carry of the first Adder will be treated as the input carry of
the next Full-Adder.
The 'A' and 'B' are the augend, and addend bits are defined by the subscript numbers.
The subscripts start from right to left, and the lower-order bit is defined by subscript '0'.
The C0, C1, C2, and C3 are the carry inputs which are connected together as a chain
using Full Adder. The C4 is the carry output produced by the last Full-Adder.
The Cout of the first Adder is connected as the Cin of the next Full-Adder.
The S0, S1, S2, and S3 are the sum outputs that produce the sum of augend and addend
bits.
https://www.javatpoint.com/binary-adder-in-digital-electronics 2/6
8.11.2023 15:51 Binary Adder - Javatpoint
The inputs for the input variable 'A' and 'B' are fetched from different source registers.
For example, the bit for the input variable 'A' comes from register 'R1', and a bit for the
input variable 'B' comes from register 'R2'.
The outcome produced by adding both input variables is stored into either third register
or to one of the source registers.
← Prev Next →
Feedback
https://www.javatpoint.com/binary-adder-in-digital-electronics 3/6
8.11.2023 15:52 Binary Adder-Subtractor - Javatpoint
Binary Adder-Subtractor
A Binary Adder-Subtractor is a special type of circuit that is used to perform both operations,
i.e., Addition and Subtraction. The operation which is going to be used depends on the values
contained by the control signal. In Arithmetic Logical Unit, it is one of the most important
components.
To work with Binary Adder-Subtractor, it is required that we have knowledge of the XOR gate,
Full-Adder, Binary Addition, and subtraction.
For example, we will take two 4-bit binary numbers 'X' and 'Y' for the operation with digits.
X0 X1 X2 X3 for X
Y0 Y1 Y2 Y3 for Y
https://www.javatpoint.com/binary-adder-subtractor-in-digital-electronics 2/8
8.11.2023 15:52 Binary Adder-Subtractor - Javatpoint
In the above diagram, the control lines of the first Full-Adder is directly coming as its
input(input carry C0). The X0 is the least significant bit of A, which is directly inputted in the
Full-Adder. The result produced by performing the XOR operation of Y0 and K is the third input
of the Binary Adder-Subtractor. The sum/difference(S0) and carry(C0) are the two outputs
produced from the First Full-adder.
When the value of K is set to true or 1, the Y0⨁K produce the complement of Y0 as the output.
So the operation would be X+Y0', which is the 2's complement subtraction of X and Y. It means
when the value of K is 1; the subtraction operation is performed by the binary Adder-
Subtractor.
In the same way, when the value of K is set to 0, the Y0⨁K produce Y0 as the output. So the
operation would be X+Y0, which is the binary addition of X and Y. It means when the value of K
is 0; the addition operation is performed by the binary Adder-Subtractor.
The carry/borrow C0 is treated as the carry/borrow input for the second Full-Adder. The
sum/difference S0 defines the least significant bit of the sum/difference of numbers X and Y.
Just like X0, the X1, X2, and X3 are faded directly to the 2nd, 3rd, and 4th Full-Adder as an input.
The outputs after performing the XOR operation of Y1, Y2, and Y3 inputs with K are the third
inputs for 2nd, 3rd, and 4th Full-Adder. The carry C1, C2 are passed as the input to the Full-
Adder. Cout is the output carry of the sum/difference. To form the final result, the S1, S2, S3 are
recorded with s0. We will use n number of Full-Adder to design the n-bit binary Adder-
Subtractor.
Example:
We assume that we have two 3 bit numbers, i.e., X=100 and Y=011, and feed them in Full-
Adder as an input.
X0 = 0 X1 = 0 X2 = 1
Y0 = 1 Y1 = 1 & Y2 = 0
For K=0:
S0 = X0+Y0+Cin
https://www.javatpoint.com/binary-adder-subtractor-in-digital-electronics 3/8
8.11.2023 15:52 Binary Adder-Subtractor - Javatpoint
S0= 0+1+0
S0=1
C0=0
Similarly,
S1 = X1+Y1+C0
S1 = 0+1+0
S1=1 and C1=0
Similarly,
S2 = X2+Y2+C1
S2 = 1+0+0
S2=1 and C2=0
Thus,
X= 100 =4
Y = 011 = 3
Sum = 0111 = 7
For K=1
So,
S0 = X0+Y0'+Cin
S0 = 0+0+1
S0=1 and C0=0
Similarly,
S1 = X1+Y1'+C0
S1 = 0+0+0
S1=0 and C1=0
Similarly,
https://www.javatpoint.com/binary-adder-subtractor-in-digital-electronics 4/8
8.11.2023 15:52 Binary Adder-Subtractor - Javatpoint
S2 = X2+Y2'+C1
S2 = 1+1+0
S2=0 and C2=0
Thus,
X = 010 = 4
Y = 011 = 3
Difference = 001 = 1
← Prev Next →
Feedback
https://www.javatpoint.com/binary-adder-subtractor-in-digital-electronics 5/8
8.11.2023 15:52 Decimal or BCD Adder - Javatpoint
Note: The decimal number requires 4 bits to represent in the BCD code, and the circuit must
have an input carry and an output carry.
From the above table, it is clear that if the produced sum is between 1 to 9, the Binary and the
BCD code is the same. But for 10 to 19 decimal numbers, both the codes are different. In the
above table, the binary sum combinations from 10 to 19 give invalid BCD. There are the
following points that help the circuit to identify the invalid BCD.
1. It is obvious from the table that a correction is needed when the 'Binary Sum' has an
output carry K=1.
https://www.javatpoint.com/decimal-or-bcd-adder-in-digital-electronics 2/7
8.11.2023 15:52 Decimal or BCD Adder - Javatpoint
2. The other six combinations from 10 to 15 need correction in which the bit on the Z8
position is 1.
3. In the Binary sum of 8 and 9, the bit on the Z8 position is also 1. So, the second step fails,
and we need to modify it.
4. To distinguish these two numbers, we specify that the bit on the Z4 or Z2 position also
needs to be 1 with the bit of Z8
5. The condition for a correction and an output carry can be expressed by the Boolean
function:
C=K+Z8.Z4+Z8.Z2
Once the circuit found the invalid BCD, the circuit adds the binary number of 6 into the invalid
BCD code to make it valid.
1. We take a 4-bit Binary-Adder, which takes addend and augend bits as an input with an
input carry 'Carry in'.
2. The Binary-Adder produces five outputs, i.e., Z8, Z4, Z2, Z1, and an output carry K.
https://www.javatpoint.com/decimal-or-bcd-adder-in-digital-electronics 3/7
8.11.2023 15:52 Decimal or BCD Adder - Javatpoint
3. With the help of the output carry K and Z8, Z4, Z2, Z1 outputs, the logical circuit is
designed to identify the Cout
4. The Z8, Z4, Z2, and Z1 outputs of the binary adder are passed into the 2nd 4-bit binary
adder as an Augend.
5. The addend bit of the 2nd 4-bit binary adder is designed in such a way that the 1st and
the 4th bit of the addend number are 0 and the 2nd and the 3rd bit are the same as Cout.
When the value of Cout is 0, the addend number will be 0000, which produce the same
result as the 1st 4-bit binary number. But when the value of the Cout is 1, the addend bit
will be 0110, i.e., 6, which adds with the augent to get the valid BCD number.
Example: 1001+1000
1. First, add both the numbers using a 4-bit binary adder and pass the input carry to 0.
2. The binary adder produced the result 0001 and carried output 'K' 1.
3. Then, find the Cout value to identify that the produced BCD is invalid or valid using the
expression Cout=K+Z8.Z4+Z8.Z2.
K=1
Z8 = 0
Z4 = 0
Z2 = 0
Cout = 1+0*0+0*0
Cout = 1+0+0
Cout = 1
4. The value of Cout is 1, which expresses that the produced BCD code is invalid. Then, add
← Prev Next →
https://www.javatpoint.com/decimal-or-bcd-adder-in-digital-electronics 4/7
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
Decoder
The combinational circuit that change the binary information into 2N output lines is known as
Decoders. The binary information is passed in the form of N input lines. The output lines define
the 2N-bit code for the binary information. In simple words, the Decoder performs the reverse
operation of the Encoder. At a time, only one input line is activated for simplicity. The
produced 2N-bit output code is equivalent to the binary information.
2 to 4 line decoder:
In the 2 to 4 line decoder, there is a total of three inputs, i.e., A0, and A1 and E and four outputs,
i.e., Y0, Y1, Y2, and Y3. For each combination of inputs, when the enable 'E' is set to 1, one of
these four outputs will be 1. The block diagram and the truth table of the 2 to 4 line decoder
are given below.
Block Diagram:
https://www.javatpoint.com/decoder-digital-electronics 2/11
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
Truth Table:
The logical expression of the term Y0, Y0, Y2, and Y3 is as follows:
Y3=E.A1.A0
Y2=E.A1.A0'
Y1=E.A1'.A0
Y0=E.A1'.A0'
https://www.javatpoint.com/decoder-digital-electronics 3/11
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
3 to 8 line decoder:
The 3 to 8 line decoder is also known as Binary to Octal Decoder. In a 3 to 8 line decoder,
there is a total of eight outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three outputs, i.e., A0,
A1, and A2. This circuit has an enable input 'E'. Just like 2 to 4 line decoder, when enable 'E' is
set to 1, one of these four outputs will be 1. The block diagram and the truth table of the 3 to 8
line encoder are given below.
Block Diagram:
Truth Table:
https://www.javatpoint.com/decoder-digital-electronics 4/11
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
The logical expression of the term Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 is as follows:
Y0=A0'.A1'.A2'
Y1=A0.A1'.A2'
Y2=A0'.A1.A2'
Y3=A0.A1.A2'
Y4=A0'.A1'.A2
Y5=A0.A1'.A2
Y6=A0'.A1.A2
Y7=A0.A1.A2
4 to 16 line Decoder
In the 4 to 16 line decoder, there is a total of 16 outputs, i.e., Y0, Y1, Y2,……, Y16 and four inputs,
i.e., A0, A1, A2, and A3. The 3 to 16 line decoder can be constructed using either 2 to 4 decoder
or 3 to 8 decoder. There is the following formula used to find the required number of lower-
https://www.javatpoint.com/decoder-digital-electronics 5/11
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
order decoders.
m1 = 8
m2 = 16
Block Diagram:
https://www.javatpoint.com/decoder-digital-electronics 6/11
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
Truth Table:
The logical expression of the term A0, A1, A2,…, A15 are as follows:
Y0=A0'.A1'.A2'.A3'
Y1=A0'.A1'.A2'.A3
Y2=A0'.A1'.A2.A3'
Y3=A0'.A1'.A2.A3
Y4=A0'.A1.A2'.A3'
Y5=A0'.A1.A2'.A3
Y6=A0'.A1.A2.A3'
Y7=A0'.A1.A2.A3
Y8=A0.A1'.A2'.A3'
Y9=A0.A1'.A2'.A3
https://www.javatpoint.com/decoder-digital-electronics 7/11
8.11.2023 15:53 Decoder in Digital Electronics - Javatpoint
Y10=A0.A1'.A2.A3'
Y11=A0.A1'.A2.A3
Y12=A0.A1.A2'.A3'
Y13=A0.A1.A2'.A3
Y14=A0.A1.A2.A3'
Y15=A0.A1.A2'.A3
← Prev Next →
https://www.javatpoint.com/decoder-digital-electronics 8/11
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Encoders
The combinational circuits that change the binary information into N output lines are known as
Encoders. The binary information is passed in the form of 2N input lines. The output lines
define the N-bit code for the binary information. In simple words, the Encoder performs the
reverse operation of the Decoder. At a time, only one input line is activated for simplicity. The
produced N-bit output code is equivalent to the binary information.
4 to 2 line Encoder:
In 4 to 2 line encoder, there are total of four inputs, i.e., Y0, Y1, Y2, and Y3, and two outputs, i.e.,
A0 and A1. In 4-input lines, one input-line is set to true at a time to get the respective binary
code in the output side. Below are the block diagram and the truth table of the 4 to 2 line
encoder.
Block Diagram:
https://www.javatpoint.com/encoders-digital-electronics 2/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Truth Table:
A1=Y3+Y2
A0=Y3+Y1
8 to 3 line Encoder:
The 8 to 3 line Encoder is also known as Octal to Binary Encoder. In 8 to 3 line encoder, there
is a total of eight inputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three outputs, i.e., A0, A1, and
A2. In 8-input lines, one input-line is set to true at a time to get the respective binary code in
the output side. Below are the block diagram and the truth table of the 8 to 3 line encoder.
https://www.javatpoint.com/encoders-digital-electronics 3/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Block Diagram:
Truth Table:
The logical expression of the term A0, A1, and A2 are as follows:
A2=Y4+Y5+Y6+Y7
A1=Y2+Y3+Y6+Y7
A0=Y7+Y5+Y3+Y1
https://www.javatpoint.com/encoders-digital-electronics 4/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Block Diagram:
https://www.javatpoint.com/encoders-digital-electronics 5/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Truth Table:
The logical expression of the term A0, A1, A2, and A3 is as follows:
A3 = Y9 + Y8
A2 = Y7 + Y6 + Y5 +Y4
A1 = Y7 + Y6 + Y3 +Y2
A0 = Y9 + Y7 +Y5 +Y3 + Y1
https://www.javatpoint.com/encoders-digital-electronics 6/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Priority Encoder:
4 to 2 line Priority Encoder:
In this priority encoder, there are total of 4 inputs, i.e., Y0, Y1, Y2, and Y3, and two outputs, i.e.,
A0 and A1. The Y3 has high and Y0 has low priority inputs. When more than one input is '1' at
the same time, the output will be the (binary) code corresponding to the higher priority input.
Below is the truth table of the 4 to 2 line priority encoder.
Truth Table:
The logical expression of the term A0 and A1 can be found using K-map as:
https://www.javatpoint.com/encoders-digital-electronics 7/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
A1=Y3+Y2
A0=Y3+Y2'.Y1
https://www.javatpoint.com/encoders-digital-electronics 8/12
8.11.2023 15:54 Encoder in Digital Electronics - Javatpoint
Uses of Encoders:
2. Encoders are used to convert a decimal number into the binary number. The objective is
to perform a binary operation such as addition, subtraction, multiplication, etc.
← Prev Next →
Feedback
https://www.javatpoint.com/encoders-digital-electronics 9/12
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
Multiplexer
A multiplexer is a combinational circuit that has 2n input lines and a single output line. Simply,
the multiplexer is a multi-input and single-output combinational circuit. The binary information
is received from the input lines and directed to the output line. On the basis of the values of
the selection lines, one of these data inputs will be connected to the output.
Unlike encoder and decoder, there are n selection lines and 2n input lines. So, there is a total of
2N possible combinations of inputs. A multiplexer is also treated as Mux.
2×1 Multiplexer:
In 2×1 multiplexer, there are only two inputs, i.e., A0 and A1, 1 selection line, i.e., S0 and single
outputs, i.e., Y. On the basis of the combination of inputs which are present at the selection line
S0, one of these 2 inputs will be connected to the output. The block diagram and the truth
table of the 2×1 multiplexer are given below.
Block Diagram:
Truth Table:
https://www.javatpoint.com/multiplexer-digital-electronics 2/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
Y=S0'.A0+S0.A1
4×1 Multiplexer:
In the 4×1 multiplexer, there is a total of four inputs, i.e., A0, A1, A2, and A3, 2 selection lines,
i.e., S0 and S1 and single output, i.e., Y. On the basis of the combination of inputs that are
present at the selection lines S0 and S1, one of these 4 inputs are connected to the output. The
block diagram and the truth table of the 4×1 multiplexer are given below.
Block Diagram:
https://www.javatpoint.com/multiplexer-digital-electronics 3/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
Truth Table:
8 to 1 Multiplexer
In the 8 to 1 multiplexer, there are total eight inputs, i.e., A0, A1, A2, A3, A4, A5, A6, and A7, 3
selection lines, i.e., S0, S1and S2 and single output, i.e., Y. On the basis of the combination of
inputs that are present at the selection lines S0, S1, and S2, one of these 8 inputs are connected
to the output. The block diagram and the truth table of the 8×1 multiplexer are given below.
https://www.javatpoint.com/multiplexer-digital-electronics 4/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
Block Diagram:
Truth Table:
https://www.javatpoint.com/multiplexer-digital-electronics 5/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
We can implement the 8×1 multiplexer using a lower order multiplexer. To implement the 8×1
multiplexer, we need two 4×1 multiplexers and one 2×1 multiplexer. The 4×1 multiplexer has 2
selection lines, 4 inputs, and 1 output. The 2×1 multiplexer has only 1 selection line.
For getting 8 data inputs, we need two 4×1 multiplexers. The 4×1 multiplexer produces one
output. So, in order to get the final output, we need a 2×1 multiplexer. The block diagram of
8×1 multiplexer using 4×1 and 2×1 multiplexer is given below.
https://www.javatpoint.com/multiplexer-digital-electronics 6/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
16 to 1 Multiplexer
In the 16 to 1 multiplexer, there are total of 16 inputs, i.e., A0, A1, …, A16, 4 selection lines, i.e.,
S0, S1, S2, and S3 and single output, i.e., Y. On the basis of the combination of inputs that are
present at the selection lines S0, S1, and S2, one of these 16 inputs will be connected to the
output. The block diagram and the truth table of the 16×1
https://www.javatpoint.com/multiplexer-digital-electronics 7/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
Block Diagram:
https://www.javatpoint.com/multiplexer-digital-electronics 8/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
Truth Table:
https://www.javatpoint.com/multiplexer-digital-electronics 9/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
We can implement the 16×1 multiplexer using a lower order multiplexer. To implement the 8×1
multiplexer, we need two 8×1 multiplexers and one 2×1 multiplexer. The 8×1 multiplexer has 3
selection lines, 4 inputs, and 1 output. The 2×1 multiplexer has only 1 selection line.
For getting 16 data inputs, we need two 8 ×1 multiplexers. The 8×1 multiplexer produces one
output. So, in order to get the final output, we need a 2×1 multiplexer. The block diagram of
16×1 multiplexer using 8×1 and 2×1 multiplexer is given below.
https://www.javatpoint.com/multiplexer-digital-electronics 10/14
8.11.2023 15:55 Multiplexer in Digital Electronics - Javatpoint
← Prev Next →
Feedback
https://www.javatpoint.com/multiplexer-digital-electronics 11/14
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
De-multiplexer
A De-multiplexer is a combinational circuit that has only 1 input line and 2N output lines.
Simply, the multiplexer is a single-input and multi-output combinational circuit. The
information is received from the single input lines and directed to the output line. On the basis
of the values of the selection lines, the input will be connected to one of these outputs. De-
multiplexer is opposite to the multiplexer.
Unlike encoder and decoder, there are n selection lines and 2n outputs. So, there is a total of 2n
possible combinations of inputs. De-multiplexer is also treated as De-mux.
1×2 De-multiplexer:
In the 1 to 2 De-multiplexer, there are only two outputs, i.e., Y0, and Y1, 1 selection lines, i.e., S0,
and single input, i.e., A. On the basis of the selection value, the input will be connected to one
of the outputs. The block diagram and the truth table of the 1×2 multiplexer are given below.
Block Diagram:
https://www.javatpoint.com/de-multiplexer-digital-electronics 2/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Truth Table:
Y0=S0'.A
Y1=S0.A
1×4 De-multiplexer:
In 1 to 4 De-multiplexer, there are total of four outputs, i.e., Y0, Y1, Y2, and Y3, 2 selection lines,
i.e., S0 and S1 and single input, i.e., A. On the basis of the combination of inputs which are
present at the selection lines S0 and S1, the input be connected to one of the outputs. The
block diagram and the truth table of the 1×4 multiplexer are given below.
https://www.javatpoint.com/de-multiplexer-digital-electronics 3/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Block Diagram:
Truth Table:
Y0=S1' S0' A
y1=S1' S0 A
y2=S1 S0' A
y3=S1 S0 A
https://www.javatpoint.com/de-multiplexer-digital-electronics 4/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
1×8 De-multiplexer
In 1 to 8 De-multiplexer, there are total of eight outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7, 3
selection lines, i.e., S0, S1and S2 and single input, i.e., A. On the basis of the combination of
inputs which are present at the selection lines S0, S1 and S2, the input will be connected to one
of these outputs. The block diagram and the truth table of the 1×8 de-multiplexer are given
below.
https://www.javatpoint.com/de-multiplexer-digital-electronics 5/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Block Diagram:
Truth Table:
Y0=S0'.S1'.S2'.A
Y1=S0.S1'.S2'.A
Y2=S0'.S1.S2'.A
Y3=S0.S1.S2'.A
https://www.javatpoint.com/de-multiplexer-digital-electronics 6/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Y4=S0'.S1'.S2 A
Y5=S0.S1'.S2 A
Y6=S0'.S1.S2 A
Y7=S0.S1.S3.A
We can implement the 1×8 de-multiplexer using a lower order de-multiplexer. To implement
the 1×8 de-multiplexer, we need two 1×4 de-multiplexer and one 1×2 de-multiplexer. The 1×4
multiplexer has 2 selection lines, 4 outputs, and 1 input. The 1×2 de-multiplexer has only 1
selection line.
For getting 8 data outputs, we need two 1×4 de-multiplexer. The 1×2 de-multiplexer produces
two outputs. So, in order to get the final output, we have to pass the outputs of 1×2 de-
multiplexer as an input of both the 1×4 de-multiplexer. The block diagram of 1×8 de-
multiplexer using 1×4 and 1×2 de-multiplexer is given below.
https://www.javatpoint.com/de-multiplexer-digital-electronics 7/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
1 x 16 De-multiplexer
In 1×16 de-multiplexer, there are total of 16 outputs, i.e., Y0, Y1, …, Y16, 4 selection lines, i.e., S0,
S1, S2, and S3 and single input, i.e., A. On the basis of the combination of inputs which are
present at the selection lines S0, S1, and S2, the input will be connected to one of these outputs.
The block diagram and the truth table of the 1×16 de-multiplexer are given below.
https://www.javatpoint.com/de-multiplexer-digital-electronics 8/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Block Diagram:
https://www.javatpoint.com/de-multiplexer-digital-electronics 9/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Truth Table:
Y0=A.S0'.S1'.S2'.S3'
Y1=A.S0'.S1'.S2'.S3
Y2=A.S0'.S1'.S2.S3'
Y3=A.S0'.S1'.S2.S3
Y4=A.S0'.S1.S2'.S3'
Y5=A.S0'.S1.S2'.S3
Y6=A.S0'.S1.S2.S3'
Y7=A.S0'.S1.S2.S3
Y8=A.S0.S1'.S2'.S3'
Y9=A.S0.S1'.S2'.S3
Y10=A.S0.S1'.S2.S3'
https://www.javatpoint.com/de-multiplexer-digital-electronics 10/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
Y11=A.S0.S1'.S2.S3
Y12=A.S0.S1.S2'.S3'
Y13=A.S0.S1.S2'.S3
Y14=A.S0.S1.S2.S3'
Y15=A.S0.S1.S2'.S3
We can implement the 1×16 de-multiplexer using a lower order de-multiplexer. To implement
the 1×16 de-multiplexer, we need two 1×8 de-multiplexer and one 1×2 de-multiplexer. The
1×8 multiplexer has 3 selection lines, 1 input, and 8 outputs. The 1×2 de-multiplexer has only 1
selection line.
https://www.javatpoint.com/de-multiplexer-digital-electronics 11/15
8.11.2023 15:56 De-multiplexer in Digital Electronics - Javatpoint
For getting 16 data outputs, we need two 1×8 de-multiplexer. The 1×8 de-multiplexer
produces eight outputs. So, in order to get the final output, we need a 1×2 de-multiplexer to
produce two outputs from a single input. Then we pass these outputs into both the de-
multiplexer as an input. The block diagram of 1×16 de-multiplexer using 1×8 and 1×2 de-
multiplexer is given below.
← Prev Next →
Feedback
https://www.javatpoint.com/de-multiplexer-digital-electronics 12/15