Digital Electronics Notes
Digital Electronics Notes
Digital Electronics Notes
performed are called logic circuits or a circuit for performing the logical
operations. A logic circuit consists of a number of a logic gates. In formal language
a Logic circuits are the basic building blocks of real-world computers.
Basically logic circuits are electric circuit whose output depends upon the input in
a way that can be expressed as a function in symbolic logic. A logic circuit has one
or more binary inputs (capable of assuming either of two states, for example “on”
or “off”) and a single binary output. Logic circuits that are used to perform
particular functions are called as GATE. Hence Logic circuits are normally
composed of gates. A combination of gates makes up a circuit. Basic logic circuits
include the basic logic gates like AND gate, OR gate, and the NOT gate, which
perform the logical functions AND, OR, and NOT.
In logic circuit Boolean constants 0 and 1 do not represent actual number but
instead represent the state of a voltage variable. This state of voltage variable
called the logic level. Some digital circuits can be extremely complex those type
of Logic circuits can be built from any binary electric or electronic devices,
including switches, relays, electron tubes, solid-state diodes, and transistors. The
selection of these electronic devices is depends upon the application and logic
circuit design requirements. They are connected in such a way that the circuit
output is the reset of logic output. These types of logic circuits are called logic
gates. The operation of and logic circuit is summarized in the form of binary
numbers by a truth table. A truth table describes how a logic circuit output on the
logic level present at the circuit inputs.
Logic Representation:
As we know that logic circuits are normally composed of ‘gates’. It is that the logic
gates produce pulses of electrical current (1s and 0s). Below we are explaining
about the logic representation techniques that help you to express the working of a
logic circuit. There are three common ways in which to represent the working of a
logic circuit.
1. Truth Tables
2. Logic Circuit Diagram
3. Boolean Expression
We will discuss each herein and demonstrate ways to convert between them.
Truth Tables:
A truth table is a chart of Boolean values (1s and 0s) arranged to indicate the
results (or outputs) of all possible inputs combinations. The lists of all possible
inputs combination are arranged in columns on the left and the resultant outputs are
listed in columns on the right side of the table. If there are n inputs then there are
maximum 2n (2 to the power n) possible states or unique combination of inputs.
For example with three inputs there are 23=8 possible combination of inputs.
Inputs Outputs
A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
Logic circuit
diagram
Boolean Expression:
Boolean algebra can be used to write a logic expression in the form of an equation.
There are a few symbols and operators that are uses to express the output of a logic
circuit.
In real world technology are highly uses various types of logic circuits to solve the
complex real time problems. There are different types of advantages those are
provides an positive edge for using logic gates. Various advantages of logic
circuits are as follows;
Logic circuits have the ability to rectify noise on the input that results in the signal
not correctly switching from 0V to 5V for 0 and 1 respectively. This is an ability
that desired in Logic circuits, and why they are commonly used throughout the
industry.
Since basic logics gates like AND, OR, NOT, TTL etc. are no more expensive so
the use of logic gates is less expensive in design and use.
Logic circuits are more precise representation of a signal can be obtained by using
more binary digits to represent it.
Modern technology uses logic circuits to be control the operation. The operations
of logic circuits are controlled by software, so new functions to be added without
changing hardware.
Logic circuits uses more energy than other circuits like analog circuits to
accomplish the same tasks resultant circuit produces more heat. This can be limit
use of logic circuits.
For activation, logic circuits require power system i.e. portable or battery power
systems which are limited in power.
NUMBER SYSTEM
If base or radix of a number system is ‘r’, then the numbers present in that number
system are ranging from zero to r-1. The total numbers present in that number system
is ‘r’. So, we will get various number systems, by choosing the values of radix as
greater than or equal to two.
In this chapter, let us discuss about the popular number systems and how to
represent a number in the respective number system. The following number systems
are the most commonly used.
Example
Consider the decimal number 1358.246. Integer part of this number is 1358 and
fractional part of this number is 0.246. The digits 8, 5, 3 and 1 have weights of 100,
101, 102 and 103 respectively. Similarly, the digits 2, 4 and 6 have weights of 10 -1, 10-
2 and 10-3 respectively.
Example
Consider the binary number 1101.011. Integer part of this number is 1101 and
fractional part of this number is 0.011. The digits 1, 0, 1 and 1 of integer part have
weights of 20, 21, 22, 23 respectively. Similarly, the digits 0, 1 and 1 of fractional part
have weights of 2-1, 2-2, 2-3 respectively.
Mathematically, we can write it as
1101.011 = (1 × 23) + (1 × 22) + (0 × 21) + (1 × 20) + (0 × 2-1) +
(1 × 2-2) + (1 × 2-3)
After simplifying the right hand side terms, we will get a decimal number, which is an
equivalent of binary number on left hand side.
Example
Consider the Hexa-decimal number 1A05.2C4. Integer part of this number is 1A05
and fractional part of this number is 0.2C4. The digits 5, 0, A and 1 have weights of
160, 161, 162 and 163 respectively. Similarly, the digits 2, C and 4 have weights of 16 -1,
16-2 and 16-3 respectively.
Mathematically, we can write it as
1A05.2C4 = (1 × 163) + (10 × 162) + (0 × 161) + (5 × 160) + (2 × 16-1) +
(12 × 16-2) + (4 × 16-3)
After simplifying the right hand side terms, we will get a decimal number, which is an
equivalent of Hexa-decimal number on left hand side.
In previous chapter, we have seen the four prominent number systems. In this chapter,
let us convert the numbers from one number system to the other in order to find the
equivalent value.
Decimal Number to other Bases Conversion
If the decimal number contains both integer part and fractional part, then convert both
the parts of decimal number into other base individually. Follow these steps for
converting the decimal number into its equivalent number of any base ‘r’.
Do division of integer part of decimal number and successive quotients with base ‘r’
and note down the remainders till the quotient is zero. Consider the remainders in
reverse order to get the integer part of equivalent number of base ‘r’. That means, first
and last remainders denote the least significant digit and most significant digit
respectively.
Do multiplication of fractional part of decimal number and successive fractions with
base ‘r’ and note down the carry till the result is zero or the desired number of
equivalent digits is obtained. Consider the normal sequence of carry in order to get the
fractional part of equivalent number of base ‘r’.
58/2 29 0 (LSB)
29/2 14 1
14/2 7 0
7/2 3 1
3/2 1 1
1/2 0 1(MSB)
⇒(58)10 = (111010)2
Therefore, the integer part of equivalent binary number is 111010.
Step 2 − Multiplication of 0.25 and successive fractions with base 2.
0.25 x 2 0.5 0
0.5 x 2 1.0 1
- 0.0 -
⇒ (.25)10 = (.01)2
Therefore, the fractional part of equivalent binary number is .01
⇒ (58.25) = (111010.01)
10 2
58/8 7 2
7/8 0 7
⇒(58)10 = (72)8
Therefore, the integer part of equivalent octal number is 72.
Step 2 − Multiplication of 0.25 and successive fractions with base 8.
0.25 x 8 2.00 2
- 0.00 -
⇒ (.25)10 = (.2)8
Therefore, the fractional part of equivalent octal number is .2
⇒ (58.25) = (72.2)
10 8
58/16 3 10=A
3/16 0 3
⇒ (58)10 = (3A) 16
Therefore, the integer part of equivalent Hexa-decimal number is 3A.
Step 2 − Multiplication of 0.25 and successive fractions with base 16.
Operation Result Carry
0.25 x 16 4.00 4
- 0.00 -
⇒(.25)10 = (.4)16
Therefore, the fractional part of equivalent Hexa-decimal number is .4.
⇒(58.25) = (3A.4)
10 16
(1 × 2 )
-2
⇒ (1101.11) = (13.75)
2 10
Follow these two steps for converting a binary number into its equivalent octal number.
Start from the binary point and make the groups of 3 bits on both sides of binary point. If
one or two bits are less while making the group of 3 bits, then include required number
of zeros on extreme sides.
Write the octal digits corresponding to each group of 3 bits.
Example
Consider the binary number 101110.01101.
Step 1 − Make the groups of 3 bits on both sides of binary point.
101 110.011 01
Here, on right side of binary point, the last group is having only 2 bits. So, include one
zero on extreme side in order to make it as group of 3 bits.
⇒ 101 110.011 010
Step 2 − Write the octal digits corresponding to each group of 3 bits.
⇒ (101 110.011 010) = (56.32)
2 8
Follow these two steps for converting a binary number into its equivalent Hexa-decimal
number.
Start from the binary point and make the groups of 4 bits on both sides of binary point. If
some bits are less while making the group of 4 bits, then include required number of
zeros on extreme sides.
Write the Hexa-decimal digits corresponding to each group of 4 bits.
Example
Consider the binary number 101110.01101
Step 1 − Make the groups of 4 bits on both sides of binary point.
10 1110.0110 1
Here, the first group is having only 2 bits. So, include two zeros on extreme side in
order to make it as group of 4 bits. Similarly, include three zeros on extreme side in
order to make the last group also as group of 4 bits.
⇒ 0010 1110.0110 1000
Step 2 − Write the Hexa-decimal digits corresponding to each group of 4 bits.
⇒ (0010 1110.0110 1000) = (2E.68)
2 16
Therefore, the Hexa-decimal equivalent of binary number 101110.01101 is (2E.68).
⇒ (145.23) = (101.3)
8 10
The value doesn’t change by removing the zeros, which are on the extreme side.
⇒ (145.23) = (1100101.010011)
8 2
⇒(145.23) = (65.4C)
8 16
⇒ (1A5.2) = (421.125)
16 10
The value doesn’t change by removing the zeros, which are at two extreme sides.
⇒ (65.4C) = (1100101.010011)
16 2
⇒(65.4C) = (145.23)
16 𝟖
Unsigned Numbers
Unsigned numbers contain only magnitude of the number. They don’t have any sign.
That means all unsigned binary numbers are positive. As in decimal number system,
the placing of positive sign in front of the number is optional for representing positive
numbers. Therefore, all positive numbers including zero can be treated as unsigned
numbers if positive sign is not assigned in front of the number.
Signed Numbers
Signed numbers contain both sign and magnitude of the number. Generally, the sign is
placed in front of number. So, we have to consider the positive sign for positive
numbers and negative sign for negative numbers. Therefore, all numbers can be
treated as signed numbers if the corresponding sign is assigned in front of the number.
If sign bit is zero, which indicates the binary number is positive. Similarly, if sign bit is
one, which indicates the binary number is negative.
It is having 7 bits. These 7 bits represent the magnitude of the number 108.
Sign-Magnitude form
1’s complement form
2’s complement form
Representation of a positive number in all these 3 forms is same. But, only the
representation of negative number will differ in each form.
Example
Consider the positive decimal number +108. The binary equivalent of magnitude of
this number is 1101100. These 7 bits represent the magnitude of the number 108.
Since it is positive number, consider the sign bit as zero, which is placed on left most
side of magnitude.
(+108) = (01101100)
10 2
Sign-Magnitude form
In sign-magnitude form, the MSB is used for representing sign of the number and the
remaining bits represent the magnitude of the number. So, just include sign bit at the
left most side of unsigned binary number. This representation is similar to the signed
decimal numbers representation.
Example
Consider the negative decimal number -108. The magnitude of this number is 108.
We know the unsigned binary representation of 108 is 1101100. It is having 7 bits. All
these bits represent the magnitude.
Since the given number is negative, consider the sign bit as one, which is placed on
left most side of magnitude.
(−108) = (11101100)
10 2
= 10010011 + 1
= 10010100
Therefore, the 2’s complement of (108) is (10010100) .
10 2
In this chapter, let us discuss about the basic arithmetic operations, which can be
performed on any two signed binary numbers using 2’s complement method.
The basic arithmetic operations are addition and subtraction.
Example 1
Let us perform the addition of two decimal numbers +7 and +4 using 2’s complement
method.
The 2’s complement representations of +7 and +4 with 5 bits each are shown below.
(+7) = (00111) 10 2
(+4) = (00100) 10 2
The resultant sum contains 5 bits. So, there is no carry out from sign bit. The sign bit ‘0’
indicates that the resultant sum is positive. So, the magnitude of sum is 11 in decimal
number system. Therefore, addition of two positive numbers will give another positive
number.
Example 2
Let us perform the addition of two decimal numbers -7 and -4 using 2’s complement
method.
The 2’s complement representation of -7 and -4 with 5 bits each are shown below.
(−7) = (11001) 10 2
(−4) = (11100) 10 2
The resultant sum contains 6 bits. In this case, carry is obtained from sign bit. So, we
can remove it
Resultant sum after removing carry is (−7) + (−4) = (10101) .
10 10 2
The sign bit ‘1’ indicates that the resultant sum is negative. So, by taking 2’s
complement of it we will get the magnitude of resultant sum as 11 in decimal number
system. Therefore, addition of two negative numbers will give another negative
number.
Example 3
Let us perform the subtraction of two decimal numbers +7 and +4 using 2’s
complement method.
The subtraction of these two numbers is
(+7) − (+4) = (+7) + (−4) .
10 10 10 10
The 2’s complement representation of +7 and -4 with 5 bits each are shown below.
(+7) = (00111)
10 2
(+4) = (11100)
10 2
Here, the carry obtained from sign bit. So, we can remove it. The resultant sum after
removing carry is
(+7) + (+4) = (00011)
10 10 2
The sign bit ‘0’ indicates that the resultant sum is positive. So, the magnitude of it is 3
in decimal number system. Therefore, subtraction of two decimal numbers +7 and +4 is
+3.
Example 4
Let us perform the subtraction of two decimal numbers +4 and +7 using 2’s
complement method.
The subtraction of these two numbers is
(+4) − (+7) = (+4) + (−7) .
10 10 10 10
The 2’s complement representation of +4 and -7 with 5 bits each are shown below.
(+4) = (00100)
10 2
(-7) = (11001)
10 2
Here, carry is not obtained from sign bit. The sign bit ‘1’ indicates that the resultant sum
is negative. So, by taking 2’s complement of it we will get the magnitude of resultant
sum as 3 in decimal number system. Therefore, subtraction of two decimal numbers +4
and +7 is -3.
In the coding, when numbers or letters are represented by a specific group of symbols,
it is said to be that number or letter is being encoded. The group of symbols is called
as code. The digital data is represented, stored and transmitted as group of bits. This
group of bits is also called as binary code.
Binary codes can be classified into two types.
Weighted codes
Unweighted codes
If the code has positional weights, then it is said to be weighted code. Otherwise, it is
an unweighted code. Weighted codes can be further classified as positively weighted
codes and negatively weighted codes.
8 4 2 1 code
The weights of this code are 8, 4, 2 and 1.
This code has all positive weights. So, it is a positively weighted code.
This code is also called as natural BCD (Binary Coded Decimal) code.
Example
Let us find the BCD equivalent of the decimal number 786. This number has 3 decimal
digits 7, 8 and 6. From the table, we can write the BCD (8421) codes of 7, 8 and 6 are
0111, 1000 and 0110 respectively.
∴ (786) = (011110000110)
10 BCD
There are 12 bits in BCD representation, since each BCD code of decimal digit has 4
bits.
2 4 2 1 code
The weights of this code are 2, 4, 2 and 1.
This code has all positive weights. So, it is a positively weighted code.
It is a self-complementing code. Self-complementing codes provide the 9’s complement of a decimal number, just by
interchanging 1’s and 0’s in its equivalent 2421 representation.
Example
Let us find the 2421 equivalent of the decimal number 786. This number has 3 decimal
digits 7, 8 and 6. From the table, we can write the 2421 codes of 7, 8 and 6 are 1101,
1110 and 1100 respectively.
Therefore, the 2421 equivalent of the decimal number 786 is 110111101100.
8 4 -2 -1 code
The weights of this code are 8, 4, -2 and -1.
This code has negative weights along with positive weights. So, it is a negatively weighted code.
It is a self-complementing code.
Example
Let us find the 8 4-2-1 equivalent of the decimal number 786. This number has 3
decimal digits 7, 8 and 6. From the table, we can write the 8 4 -2 -1 codes of 7, 8 and 6
are 1001, 1000 and 1010 respectively.
Therefore, the 8 4 -2 -1 equivalent of the decimal number 786 is 100110001010.
Excess 3 code
This code doesn’t have any weights. So, it is an un-weighted code.
We will get the Excess 3 code of a decimal number by adding three (0011) to the binary equivalent of that decimal
number. Hence, it is called as Excess 3 code.
It is a self-complementing code.
Example
Let us find the Excess 3 equivalent of the decimal number 786. This number has 3
decimal digits 7, 8 and 6. From the table, we can write the Excess 3 codes of 7, 8 and
6 are 1010, 1011 and 1001 respectively.
Therefore, the Excess 3 equivalent of the decimal number 786 is 101010111001
Gray Code
The following table shows the 4-bit Gray codes corresponding to each 4-bit binary
code.
Decimal Number Binary Code Gray Code
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
In the above table, the successive Gray codes are differed in one bit position only. Hence, this code is called as unit
distance code.
Compare the successive two bits starting from zero. If the 2 bits are same, then the output is zero. Otherwise, output is
one.
Repeat the above step till the LSB of Gray code is obtained.
Example
From the table, we know that the Gray code corresponding to binary code 1000 is
1100. Now, let us verify it by using the above procedure.
Given, binary code is 1000.
Step 1 − By placing zero to the left of MSB, the binary code will be 01000.
Step 2 − By comparing successive two bits of new binary code, we will get the gray
code as 1100.
We know that the bits 0 and 1 corresponding to two different range of analog voltages.
So, during transmission of binary data from one system to the other, the noise may
also be added. Due to this, there may be errors in the received data at other system.
That means a bit 0 may change to 1 or a bit 1 may change to 0. We can’t avoid the
interference of noise. But, we can get back the original data first by detecting whether
any error(s) present and then correcting those errors. For this purpose, we can use the
following codes.
Error detection codes − are used to detect the error(s) present in the received data
(bit stream). These codes contain some bit(s), which are included (appended) to the
original bit stream. These codes detect the error, if it is occurred during transmission of
the original data (bit stream).Example − Parity code, Hamming code.
Error correction codes − are used to correct the error(s) present in the received data
(bit stream) so that, we will get the original data. Error correction codes also use the
similar strategy of error detection codes.Example − Hamming code.
Therefore, to detect and correct the errors, additional bit(s) are appended to the data
bits at the time of transmission.
Parity Code
It is easy to include (append) one parity bit either to the left of MSB or to the right of
LSB of original bit stream. There are two types of parity codes, namely even parity
code and odd parity code based on the type of parity being chosen.
000 0 0000
001 1 0011
010 1 0101
011 0 0110
100 1 1001
101 0 1010
110 0 1100
111 1 1111
Here, the number of bits present in the even parity codes is 4. So, the possible even
number of ones in these even parity codes are 0, 2 & 4.
If the other system receives one of these even parity codes, then there is no error in the received data. The bits other
than even parity bit are same as that of binary code.
If the other system receives other than even parity codes, then there will be an error(s) in the received data. In this case,
we can’t predict the original binary code because we don’t know the bit position(s) of error.
Therefore, even parity bit is useful only for detection of error in the received parity
code. But, it is not sufficient to correct the error.
000 1 0001
001 0 0010
010 0 0100
011 1 0111
100 0 1000
101 1 1011
110 1 1101
111 0 1110
Here, the number of bits present in the odd parity codes is 4. So, the possible odd
number of ones in these odd parity codes are 1 & 3.
If the other system receives one of these odd parity codes, then there is no error in the received data. The bits other than
odd parity bit are same as that of binary code.
If the other system receives other than odd parity codes, then there is an error(s) in the received data. In this case, we
can’t predict the original binary code because we don’t know the bit position(s) of error.
Therefore, odd parity bit is useful only for detection of error in the received parity code.
But, it is not sufficient to correct the error.
Hamming Code
Hamming code is useful for both detection and correction of error present in the
received data. This code uses multiple parity bits and we have to place these parity bits
in the positions of powers of 2.
The minimum value of 'k' for which the following relation is correct (valid) is nothing
but the required number of parity bits.
$$2^k\geq n+k+1$$
Where,
‘n’ is the number of bits in the binary code (information)
‘k’ is the number of parity bits
Therefore, the number of bits in the Hamming code is equal to n + k.
Let the Hamming code is $b_{n+k}b_{n+k-1}.....b_{3}b_{2}b_{1}$ & parity bits $p_{k},
p_{k-1}, ....p_{1}$. We can place the ‘k’ parity bits in powers of 2 positions only. In
remaining bit positions, we can place the ‘n’ bits of binary code.
Based on requirement, we can use either even parity or odd parity while forming a
Hamming code. But, the same parity technique should be used in order to find whether
any error present in the received data.
Follow this procedure for finding parity bits.
Find the value of p1, based on the number of ones present in bit positions b3, b5, b7 and so on. All these bit positions
(suffixes) in their equivalent binary have ‘1’ in the place value of 20.
Find the value of p2, based on the number of ones present in bit positions b3, b6, b7 and so on. All these bit positions
(suffixes) in their equivalent binary have ‘1’ in the place value of 21.
Find the value of p3, based on the number of ones present in bit positions b5, b6, b7 and so on. All these bit positions
(suffixes) in their equivalent binary have ‘1’ in the place value of 22.
Example 1
Let us find the Hamming code for binary code, d d d d = 1000. Consider even parity
4 3 2 1
bits.
The number of bits in the given binary code is n=4.
We can find the required number of parity bits by using the following mathematical
relation.
$$2^k\geq n+k+1$$
Substitute, n=4 in the above mathematical relation.
$$\Rightarrow 2^k\geq 4+k+1$$
$$\Rightarrow 2^k\geq 5+k$$
The minimum value of k that satisfied the above relation is 3. Hence, we require 3
parity bits p , p , and p . Therefore, the number of bits in Hamming code will be 7, since
1 2 3
there are 4 bits in binary code and 3 parity bits. We have to place the parity bits and
bits of binary code in the Hamming code as shown below.
The 7-bit Hamming code is
$b_{7}b_{6}b_{5}b_{4}b_{3}b_{2}b_{1}=d_{4}d_{3}d_{2}p_{3}d_{1}p_{2}bp_{1}$
By substituting the bits of binary code, the Hamming code will be
$b_{7}b_{6}b_{5}b_{4}b_{3}b_{2}b_{1} = 100p_{3}Op_{2}p_{1}$. Now, let us find the
parity bits.
$$p_{1}=b_{7}\oplus b_{5}\oplus b_{3}=1 \oplus 0 \oplus 0=1$$
$$p_{2}=b_{7}\oplus b_{6}\oplus b_{3}=1 \oplus 0 \oplus 0=1$$
$$p_{3}=b_{7}\oplus b_{6}\oplus b_{5}=1 \oplus 0 \oplus 0=1$$
By substituting these parity bits, the Hamming code will be
$b_{7}b_{6}b_{5}b_{4}b_{3}b_{2}b_{1}= 1001011$.
Example 2
In the above example, we got the Hamming code as
$b_{7}b_{6}b_{5}b_{4}b_{3}b_{2}b_{1}= 1001011$. Now, let us find the error position
when the code received is $b_{7}b_{6}b_{5}b_{4}b_{3}b_{2}b_{1}= 1001111$.
Now, let us find the check bits.
$$c_{1}=b_{7}\oplus b_{5}\oplus b_{3}\oplus b_{1}=1 \oplus 0 \oplus 1 \oplus1 =1$$
$$c_{2}=b_{7}\oplus b_{6}\oplus b_{3}\oplus b_{2}=1 \oplus 0 \oplus 1 \oplus1 =1$$
$$c_{3}=b_{7}\oplus b_{6}\oplus b_{5}\oplus b_{4}=1 \oplus 0 \oplus 0 \oplus1 =0$$
The decimal value of check bits gives the position of error in received Hamming code.
$$c_{3}c_{2}c_{1} = \left ( 011 \right )_{2}=\left ( 3 \right )_{10}$$
Therefore, the error present in third bit (b ) of Hamming code. Just complement the
3
value present in that bit and remove parity bits in order to get the original binary code
Boolean Algebra is an algebra, which deals with binary numbers & binary variables.
Hence, it is also called as Binary Algebra or logical Algebra. A mathematician, named
George Boole had developed this algebra in 1854. The variables used in this algebra
are also called as Boolean variables.
The range of voltages corresponding to Logic ‘High’ is represented with ‘1’ and the
range of voltages corresponding to logic ‘Low’ is represented with ‘0’.
Boolean Postulates
Consider the binary numbers 0 and 1, Boolean variable (x) and its complement (x’).
Either the Boolean variable or complement of it is known as literal. The four
possible logical OR operations among these literals and binary numbers are shown
below.
x+0=x
x+1=1
x+x=x
x + x’ = 1
Similarly, the four possible logical AND operations among those literals and binary
numbers are shown below.
x.1 = x
x.0 = 0
x.x = x
x.x’ = 0
These are the simple Boolean postulates. We can verify these postulates easily, by
substituting the Boolean variable with ‘0’ or ‘1’.
Note− The complement of complement of any Boolean variable is equal to the variable
itself. i.e., (x’)’=x.
Commutative law
Associative law
Distributive law
Commutative Law
If any logical operation of two Boolean variables give the same result irrespective of the
order of those two variables, then that logical operation is said to be Commutative.
The logical OR & logical AND operations of two Boolean variables x & y are shown
below
x+y=y+x
x.y = y.x
The symbol ‘+’ indicates logical OR operation. Similarly, the symbol ‘.’ indicates logical
AND operation and it is optional to represent. Commutative law obeys for logical OR &
logical AND operations.
Associative Law
If a logical operation of any two Boolean variables is performed first and then the same
operation is performed with the remaining variable gives the same result, then that
logical operation is said to be Associative. The logical OR & logical AND operations of
three Boolean variables x, y & z are shown below.
x + (y + z) = (x + y) + z
x.(y.z) = (x.y).z
Associative law obeys for logical OR & logical AND operations.
Distributive Law
If any logical operation can be distributed to all the terms present in the Boolean
function, then that logical operation is said to be Distributive. The distribution of logical
OR & logical AND operations of three Boolean variables x, y & z are shown below.
x.(y + z) = x.y + x.z
x + (y.z) = (x + y).(x + z)
Distributive law obeys for logical OR and logical AND operations.
These are the Basic laws of Boolean algebra. We can verify these laws easily, by
substituting the Boolean variables with ‘0’ or ‘1’.
Duality theorem
DeMorgan’s theorem
Duality Theorem
This theorem states that the dual of the Boolean function is obtained by interchanging
the logical AND operator with logical OR operator and zeros with ones. For every
Boolean function, there will be a corresponding Dual function.
Let us make the Boolean equations (relations) that we discussed in the section of
Boolean postulates and basic laws into two groups. The following table shows these
two groups.
Group1 Group2
x+0=x x.1 = x
x+1=1 x.0 = 0
x+x=x x.x = x
x + x’ = 1 x.x’ = 0
x + (y + z) = (x + y) + z x.(y.z) = (x.y).z
In each row, there are two Boolean equations and they are dual to each other. We can
verify all these Boolean equations of Group1 and Group2 by using duality theorem.
DeMorgan’s Theorem
This theorem is useful in finding the complement of Boolean function. It states that
the complement of logical OR of at least two Boolean variables is equal to the logical
AND of each complemented variable.
DeMorgan’s theorem with 2 Boolean variables x and y can be represented as
(x + y)’ = x’.y’
The dual of the above Boolean function is
(x.y)’ = x’ + y’
Therefore, the complement of logical AND of two Boolean variables is equal to the
logical OR of each complemented variable. Similarly, we can apply DeMorgan’s
theorem for more than 2 Boolean variables also.
Example 1
Let us simplify the Boolean function, f = p’qr + pq’r + pqr’ + pqr
We can simplify this function in two methods.
Method 1
Given Boolean function, f = p’qr + pq’r + pqr’ +pqr.
Step 1 − In first and second terms r is common and in third and fourth terms pq is
common. So, take the common terms by using Distributive law.
⇒ f = (p’q + pq’)r + pq(r’ + r)
Step 2 − The terms present in first parenthesis can be simplified to Ex-OR operation.
The terms present in second parenthesis can be simplified to ‘1’ using Boolean
postulate
⇒ f = (p ⊕q)r + pq(1)
Step 3 − The first term can’t be simplified further. But, the second term can be
simplified to pq using Boolean postulate.
⇒ f = (p ⊕q)r + pq
Therefore, the simplified Boolean function is f = (p⊕q)r + pq
Method 2
Given Boolean function, f = p’qr + pq’r + pqr’ + pqr.
Step 1 − Use the Boolean postulate, x + x = x. That means, the Logical OR operation
with any Boolean variable ‘n’ times will be equal to the same variable. So, we can write
the last term pqr two more times.
⇒ f = p’qr + pq’r + pqr’ + pqr + pqr + pqr
Step 2 − Use Distributive law for 1 and 4 terms, 2 and 5 terms, 3 and 6 terms.
st th nd th rd th
Example 2
Let us find the complement of the Boolean function, f = p’q + pq’.
The complement of Boolean function is f’ = (p’q + pq’)’.
Step 1 − Use DeMorgan’s theorem, (x + y)’ = x’.y’.
⇒ f’ = (p’q)’.(pq’)’
Step 2 − Use DeMorgan’s theorem, (x.y)’ = x’ + y’
⇒ f’ = {(p’)’ + q’}.{p’ + (q’)’}
Step3 − Use the Boolean postulate, (x’)’=x.
⇒ f’ = {p + q’}.{p’ + q}
⇒ f’ = pp’ + pq + p’q’ + qq’
Step 4 − Use the Boolean postulate, xx’=0.
⇒ f = 0 + pq + p’q’ + 0
⇒ f = pq + p’q’
Therefore, the complement of Boolean function, p’q + pq’ is pq + p’q