De Unit-2
De Unit-2
De Unit-2
Boolean Algebra
Boolean algebra is a type of algebra that is created by operating the binary system. In the year
1854, George Boole, an English mathematician, proposed this algebra. This is a variant of
Aristotle’s propositional logic that uses the symbols 0 and 1, or True and False. Boolean algebra
is concerned with binary variables and logic operations.
Boolean Algebra is fundamental in the development of digital electronics systems as they all use
the concept of Boolean Algebra to execute commands. Apart from digital electronics this
algebra also finds its application in Set Theory, Statistics, and other branches of mathematics.
These operations have their own symbols and precedence and the table added below shows the
symbol and the precedence of these operators.
Operator Symbol Precedence
⇁
‘ (or)
NOT First
∨
+ (or)
OR Third
A A’
TRUE FALSE
FALSE TRUE
A B A.B
TRUE TRUE TRUE
TRUE FALSE FALSE
FALSE TRUE FALSE
FALSE FALSE FALSE
A B A+B
TRUE TRUE TRUE
TRUE FALSE TRUE
FALSE TRUE TRUE
FALSE FALSE FALSE
EX-OR Operation:
XOR is a bitwise operator, and it stands for "exclusive or." It performs logical operation. If input
bits are the same, then the output will be false(0) else true(1).
XOR table:
X Y X^Y
0 0 0
0 1 1
1 0 1
1 1 0
Example: 4^3 = 7
In binary:
0100
^ 0011
------
Result: 0111 => (7)
XOR with negative numbers
Let's understand with an example -4^-2 = 2 In the above example, we can see -4^-2output will
be 2 but the question arises how? Because if we represent both inputs in the binary form, then we
do XOR of bits, then the output will be 0000 0110 and in decimal, it will be 6 but as we know
output should be 2.
1000 0100 (-4)
^ 1000 0010 (-2)
------------------
0000 0110 => (6) // incorrect output
Note: Here, the leftmost bit position is reserved for the sign of the value (positive or negative)
and doesn't contribute towards the value of the number.
Let's understand how the XOR operation works with negative numbers.
2. The complement of the negative number is reversed for each bit and then incremented by
1 (the highest is kept at 1)
3. // Lets take -4
4. In binary: 1000 0100
5. Reverse: 1111 1011
complement (Increment by 1): 1111 1100
// Now -2 In binary: 1000 0010 Reverse: 1111 1101 complement (Increment by 1): 1111 1110
Final result:
complement of -4 : 1111 1100
complement of -2 : 1111 1110
-----------
Result: 0000 0010 => 2
EX-NOR operation:
The XNOR, or Exclusive NOR, is a logical operation that is the complement of the Exclusive
OR (XOR) operation.
he XNOR operation takes two input values, which can be either 0 (false) or 1 (true), and
compares them. The result of the XNOR operation is true if both inputs are the same, and false if
the inputs are different. In other words, the XNOR outputs a true value when both inputs match
(both true or both false) and outputs a false value when the inputs do not match (one is true and
the other is false).
0 0 1
0 1 0
1 0 0
1 1 1
As seen in the truth table, the XNOR operation only yields a true output when both inputs are
equal.
All Test Series
Prev. Year Paper
Practice
Demorgan’s Theorems:
\
Generating Boolean Expressions from truth table:
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
The process of converting SOP form to shorthand notation is the same as the process of finding
shorthand notation for minterms. There are the following steps to find the shorthand notation of
the given SOP expression.
Example: F = X'Y+XY'+XY
1. Firstly, we write the SOP expression:
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
The process of converting shorthand notation to SOP is the reverse process of converting SOP
expression to shorthand notation. Let's see an example to understand this conversion.
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:
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
A canonical product of sum is a boolean expression that entirely consists of maxterms. 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 only 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 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.
F=(X'+Y').(X+Y)
Converting Product of Sum (POS) to shorthand notation
The process of converting POS form to shorthand notation is the same as the process of finding
shorthand notation for maxterms. There are the following steps used to find the shorthand
notation of the given POS 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
The process of converting shorthand notation to POS is the reverse process of converting POS
expression to shorthand notation. Let's see an example to understand this conversion.
Example:
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')
There are following two methods of minimizing or reducing the boolean expressions-
Karnaugh Map-
For a boolean expression consisting of n-variables, number of cells required in K Map = 2n cells.
Here, A and B are the two variables of the given boolean function.
Three Variable K Map-
Three variable K Map is drawn for a boolean expression consisting of three variables.
The number of cells present in three variable K Map = 23 = 8 cells.
So, for a boolean function consisting of three variables, we draw a 2 x 4 K Map.
Three variable K Map may be represented as-
Here, A, B and C are the three variables of the given boolean function.
Here, A, B, C and D are the four variables of the given boolean function.
Rule-01:
We can either group 0’s with 0’s or 1’s with 1’s but we can not group 0’s and 1’s
together.
X representing don’t care can be grouped with 0’s as well as 1’s.
NOTE
There is no need of separately grouping X’s i.e. they can be ignored if all 0’s and 1’s
are already grouped.
Rule-02:
Rule-03:
We can only create a group whose number of cells can be represented in the power of 2.
In other words, a group can only contain 2n i.e. 1, 2, 4, 8, 16 and so on number of cells.
Example-
Rule-04:
Example-
Rule-06:
Example-
Rule-07:
Problem-01:
Solution-
Then, we have-
Now,
F(A, B, C, D)
= (A’B + AB)(C’D + CD) + (A’B’ + A’B + AB + AB’)C’D + (A’B’ + AB’)(C’D’ + CD’)
= BD + C’D + B’D’
Solution-
Then, we have-
Now,
F(A, B, C, D)
= (A’B’ + A’B + AB + AB’)(C’D + CD) + (A’B’ + AB’)(C’D’ + C’D)
= D + B’C’
Solution-
Then, we have-
Now,
F(A, B, C, D)
= (AB + AB’)(C’D + CD) + (A’B’ + AB’)(C’D + CD) + (A’B’ + AB’)(C’D’ + C’D) + (A’B’ +
A’B)(C’D’ + CD’)
= AD + B’D + B’C’ + A’D’
Solution-
Then, we have-
Now,
F(A, B, C)
= A'(B’C’ + B’C) + A(BC + BC’)
= A’B’ + AB
Solution-
Then, we have-
Now,
F(A, B, C)
= (A + A’)(B’C’ + B’C) + A(B’C’ + B’C + BC + BC’) + (A + A’)(B’C’ + BC’)
= B’ + A + C’
Solution-
Then, we have-
Now,
F(A, B, C)
= (A + A’)(B’C’ + B’C) + A(B’C’ + B’C + BC + BC’)
= B’ + A
Solution-
Then, we have-
Now,
F(A, B, C, D)
= (AB + AB’)CD’ + (A’B’ + AB’)(C’D’ + CD’)
= ACD’ + B’D’
Solution-
Then, we have-
Now,
F(A, B, C, D)
= A’B(C’D’ + C’D) + (A’B’ + A’B)(CD) + (AB + AB’)(C’D) + AB(CD + CD’)
= A’BC’ + A’CD + AC’D + ABC
It is important to note that we are not considering the quad group because we have to consider
the duets anyhow.
Problem-09:
Solution-
Then, we have-
Now,
F(W, X, Y, Z)
= (W’X + WX)(Y’Z’ + YZ’) + (W’X’ + WX’)(Y’Z + YZ)
= XZ’ + X’Z
=X⊕Z
Clearly, the given boolean function depends on only two variables X and Z.
Hence, it is independent of other two variables W and Y.
Logic Gate:
Logic gates are the fundamental components of all digital circuits and systems. In digital
electronics, there are seven main types of logic gates used to perform various logical
operations. A logic gate is basically an electronic circuit designed by using components like
diodes, transistors, resistors, capacitors, etc., and capable of performing logical operations.
OR Gate
In digital electronics, there is a type of basic logic gate which produces a low or logic 0 output
only when its all inputs are low or logic 0. For all other input combinations, the output of the
OR gate is high or logic 1. This logic gate is termed as OR gate. An OR gate can be designed
to have two or more inputs but only one output. The primary function of the OR gate is to
perform the logical sum operation.
Properties of OR Gate:
An OR gate have the following two properties:
It can have two or more input lines at a time.
When all of the inputs to the OR gate are low or logic 0, the output of it is low or logic 0.
The operation of an OR gate can be mathematically described through a mathematical
expression called Boolean expression of the OR gate.
The boolean expression for a two input OR gate is given by,
Z=A+B
The boolean expression for a three-input OR gate is,
Z=A+B+C
Here, A, B, and C are inputs and Z is the output variables. We can extend this boolean
expression to any number of input variables.
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
Symbol of OR Gate:
The logic symbol of a two-input OR gate is shown in the following figure.
AND Gate
In digital electronics, the AND gate is one of the basic logic gate that performs the logical
multiplication of inputs applied to it. It generates a high or logic 1 output, only when all the
inputs applied to it are high or logic 1. Otherwise, the output of the AND gate is low or logic 0.
A B A AND B
Input Output
0 0 0
0 1 0
1 0 0
1 1 1
NOT Gate
In digital electronics, the NOT gate is another basic logic gate used to perform complement of
an input signal applied to it. It takes only one input and one output. The output of the NOT
gate is complement of the input applied to it. Therefore, if we apply a low or logic 0 output to
the NOT gate is gives a high or logic 1 output and vice-versa. The NOT gate is also known as
inverter, as it performs the inversion operation.
Input Output
A NOT A
Input Output
0 1
1 0
Universal Gates
The universal gates are the logic gates that are versatile in that they can be programmed to
execute any Boolean function. The most popular types among them are NAND and NOR gates.
To explain it further, the input of the universal gates can be interconnected in one way or the
other while the inputs can also be inverted in one way or the other to get the AND, OR, NOT,
XOR and XNOR basic Boolean functions.
There are two universal gates.
1) NAND Gate
2) NOR Gate
NOR Gate
The NOR gate is a type of universal logic gate that can take two or more inputs but one output.
It is basically a combination of two basic logic gates i.e., OR gate and NOT gate. Thus, it can
be expressed as,
NOR Gate = OR Gate + NOT Gate
In other words, a NOR gate is an OR gate followed by a NOT gate.
Input Output
A B A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
NAND Gate
In digital electronics, the NAND gate is another type of universal logic gate used to perform
logical operations. The NAND gate performs the inverted operation of the AND gate. Similar
to NOR gate, the NAND gate can also have two or more input lines but only one output line.
The NAND gate is also represented as a combination of two basic logic gates namely, AND
gate and NOT gate. Hence, it can be expressed as
NAND Gate = AND Gate + NOT Gate
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
XOR Gate
In digital electronics, there is a specially designed logic gate named, XOR gate, which is used
in digital circuits to perform modulo sum. It is also referred to as Exclusive OR gate or Ex-
OR gate. The XOR gate can take only two inputs at a time and give an output. The output of
the XOR gate is high or logic 1 only when its two inputs are dissimilar.
Z=A⊕B
boolean expression. The following is the boolean expression for the output of the XOR gate.
Here, Z is the output variable, and A and B are the input variables.
This expression can also be written as follows:
Z=AB+AB
Truth Table of XOR Gate:
The truth table is a table of inputs and output that describe the relationship between them and
the operation of the XOR gate for different input combinations. The truth table of the XOR
gate is given below:
Input Output
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
XNOR Gate
The XNOR gate is another type of special purpose logic gate used to implement exclusive
operation in digital circuits. It is used to implement the Exclusive NOR operation in digital
circuits. It is also called the Ex-NOR or Exclusive NOR gate. It is a combination of two logic
gates namely, XOR gate and NOT gate. Thus, it can be expressed as,
XNOR Gate = XOR Gate + NOT Gate
The output of an XNOR gate is high or logic 1 when its both inputs are similar. Otherwise the
output is low or logic 0. Hence, the XNOR gate is used as a similarity detector circuit.
Y=A⊙B
boolean expression of XNOR gate. Here is the boolean expression of the XNOR gate.
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
= AB (Involution Law)
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
In the block diagram, we have seen that it contains two inputs and two outputs.
The augent and addent bits are the input states, and carry and sum are the output states of the
half adder. The half adder is designed with the help of the following two logic gates:
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.
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
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.
Implementation of Half Adder using NOR gates : Total 5 NOR gates are required to
implement Half Adder
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.
4. The eight rows under the input variable designate all possible combinations of 0 and 1
that can occur in these variables.
The SOP form can be obtained with the help of K-map as:
Sum = x' y' z+x' yz+xy' z'+xyz
Carry = xy+xz+yz
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 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:
o Perform the XOR operation of input A and B.
o 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:
1. Perform the 'AND' operation of input A and B.
2. Perform the 'XOR' operation of input A and B.
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)
Binary Addition
Binary addition works sane as a to regular addition, but it only uses two digits: 0 and 1.
Example:
We are working on 13 = 1 1 0 1 and 11 = 1 0 1 1
1 1 0 1 + 1 0 1 1 ──────────── 1 1 0 0 0
So, the final answer is 11000, If we convert in a decimal so answer is 24.
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 Full Adder is used to sum two single-bit binary numbers with carry input. In digital
calculation, we need to add two n-bit binary numbers rather than only single-bit binary numbers.
For this purpose, we need to use n-bit parallel Adder. In order to get N-bit parallel adder, we
cascade the n number of Full Adders. The carry output of the first Adder is treated as the carry
input of the second Adder.
4-bit Binary Adder
o 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'.
o 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.
o The Cout of the first Adder is connected as the Cin of the next Full-Adder.
o The S0, S1, S2, and S3 are the sum outputs that produce the sum of augend and addend
bits.
o 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'.
o The outcome produced by adding both input variables is stored into either third register
or to one of the source registers.
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
When the value of K is set to true or 1, the Y 0⨁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 Y 0⨁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 2 nd, 3rd, and 4th Full-Adder as an input. The
outputs after performing the XOR operation of Y 1, 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. C out is
the output carry of the sum/difference. To form the final result, the S 1, 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
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,
S2 = X2+Y2'+C1
S2 = 1+1+0
S2=0 and C2=0
Thus,
X = 010 = 4
Y = 011 = 3
Difference = 001 = 1
Shift Registers :
Shift Register is a group of flip flops used to store multiple bits of data. There are two shift
registers used in the serial binary adder. In one shift register augend is stored and in other shift
register addend is stored.
Full Adder :
Full adder is the combinational circuit which takes three inputs and gives two outputs as sum and
carry. The circuit adds one pair at a time with the help of it.
D Flip-flop :
the carry output from the full adder is applied on the D flip-flop. Further, the output of D flip-
flop is used as a carry input for the next pair of significant bits.
Working Process:
Following is the procedure of addition using serial binary adder:
Step-1:
The two shift registers A and B are used to store the numbers to be added.
Step-2:
A single full adder is used too add one pair of bits at a time along with the carry.
Step-3:
The contents of the shift registers shift from left to right and their output starting from a and b
are fed into a single full adder along with the output of the carry flip-flop upon application of
each clock pulse.
Step-4:
The sum output of the full adder is fed to the most significant bit of the sum register.
Step-5:
The content of sum register is also shifted to right when clock pulse is applied.
Step-6:
After applying four clock pulse the addition of two registers (A & B) contents are stored in
sum register.
ADVANTAGES:
1.It uses only one full adder to add two n-bit numbers.
2.It uses less hardware resulting in cost saving and less power comsumption.
DISADVANTAGES:
ADVANTAGES:
DISADVANTAGES:
The circuit works by comparing the bits of the two numbers starting from the most significant
bit (MSB) and moving toward the least significant bit (LSB) . At each bit position, the two
corresponding bits of the numbers are compared. If the bit in the first number is greater than
the corresponding bit in the second number, the A>B output is set to 1, and the circuit
immediately determines that the first number is greater than the second. Similarly, if the bit in
the second number is greater than the corresponding bit in the first number, the A<B output is
set to 1, and the circuit immediately determines that the first number is less than the second.
If the two corresponding bits are equal, the circuit moves to the next bit position and compares
the next pair of bits. This process continues until all the bits have been compared. If at any
point in the comparison, the circuit determines that the first number is greater or less than the
second number, the comparison is terminated, and the appropriate output is generated.
If all the bits are equal, the circuit generates an A=B output, indicating that the two numbers
are equal.
From the above truth table logical expressions for each output can be expressed as follows.
A>B: AB’
A<B: A’B
A=B: A’B’ + AB
By using these Boolean expressions, we can implement a logic circuit for this comparator as
given below.
0 0 0 0 0 1 0
0 0 0 1 1 0 0
0 0 1 0 1 0 0
0 0 1 1 1 0 0
INPUT OUTPUT
0 1 0 0 0 0 1
0 1 0 1 0 1 0
0 1 1 0 1 0 0
0 1 1 1 1 0 0
1 0 0 0 0 0 1
1 0 0 1 0 0 1
1 0 1 0 0 1 0
1 0 1 1 1 0 0
1 1 0 0 0 0 1
1 1 0 1 0 0 1
1 1 1 0 0 0 1
1 1 1 1 0 1 0
From the above truth table, K-map for each output can be drawn as follows.
From the above K-maps logical expressions for each output can be expressed as
follows.
A=B
(A3 Ex-Nor B3) (A2 Ex-Nor 82) (A1 Ex-Nor B1) (A0 Ex-Nor B0)
A>B
A<B
By using these Boolean expressions, we can implement a logic circuit for this
comparator as given below.