1 Digital Logic Circuit: Hapter
1 Digital Logic Circuit: Hapter
1 Digital Logic Circuit: Hapter
L
A B
Voltage
~
Source
A B C Y
0 0 0 0
A 0 0 1 0
B Y
C 0 1 0 0
0 1 1 0
Three input AND gate
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Truth Table
2) OR Gate :
The OR gate is an electronic circuit that
gives a high output (1) if one or more of
its inputs are high.
A plus (+) sign is used to show the OR
operation.
2 input OR gate
A B A+B
A
A+B 0 0 0
B 0 1 1
1 0 1
1 1 1
Truth Table
2) OR Gate :
It means only one time output remain
low rest of time output remain high.
2n-1 times result is high where n is
number of input.
Suppose three input OR gate than 23-
1=7 times result is true (high).
OR gate can be easily explained with
following circuit diagram.
As shown in this circuit if switches A and
B both are open then lamp L not glows,
otherwise in other state lamp will glow.
2) OR Gate :
A L
Voltage
~
Source
A B C Y
0 0 0 0
A 0 0 1 1
B Y
C 0 1 0 1
0 1 1 1
Three input OR gate
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Truth Table
3) NOT Gate :
The NOT gate is an electronic circuit
that produces an inverted version of the
input at its output.
It is also known as an inverter. If the
input variable is A, the inverted output is
known as NOT A. There is also shown as
A’ or A with a bar over the top as shown
as the outputs.
NOT gate
A A’
A A’ 0 1
1 0
3) NOT Gate :
When input at logic 0, output is 1 and
when input at logic 1 then output is 0.
Universal Gates :
1) NAND Gate :
NAND gate means NOT-AND gate which is
equal to an AND gate followed by a NOT gate.
The output of all NAND gates are high if any
of inputs are low. The symbol is an AND gate
with a small circle on the output.
2 input NAND gate
A A B A.B
AB 0 0 1
B
0 1 1
1 0 1
Truth Table 1 1 0
NAND Gate : (Three input NAND gate)
1) NAND Gate :
When all input are high, output remain LOW.
A B C Y
A 0 0 0 1
B y
0 0 1 1
C
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
Truth Table
Universal Gates :
2) NOR Gate :
NOR gate means NOT-OR gate which is equal
to an OR gate followed by a NOT gate.
The outputs of all NOR gates are low if any of
the inputs are high.
The symbol is an OR gate with a small circle
on the output. The small circle represent
inversion. 2 input NOR gate
A B A+ B
A
y 0 0 1
B 0 1 0
1 0 0
Truth Table 1 1 0
NOR Gate : (Three input NOR gate)
2) NOR Gate :
Truth Table
A B C Y
A 0 0 0 1
B y
0 0 1 0
C
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 0
Exclusive Gates :
1) Ex-OR Gate :
The ‘Exclusive-OR’ gate is a circuit which
will give a high output if either, but not both,
of its two inputs are high.
An encircle plus sign + is used to show the
Ex-OR operation.
2 input Ex-OR gate
A B A+ B
A 0 0 0
B A+B 0 1 1
1 0 1
EOR
1 1 0
Truth Table
1) Ex-OR Gate :
A A
A.B
B
y
AB + AB
A.B
B
1) Ex-OR Gate : (Three input Ex-OR gate)
Truth Table
A B C Y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
1) Ex-OR Gate : (Three input Ex-OR gate)
A+B
A 1
B 2 y
C A+ B + C
A
B
A+B
EOR
Exclusive Gates :
2) Ex-NOR Gate :
A A
A.B
B
y/F
(A+B).(A+B)
B A.B
Ex-NOR
Exclusive Gates :
2) Ex-NOR Gate :
A B C Y
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
Truth Table
Exclusive Gates :
2) Ex-NOR Gate :
A+B
A 1
B 2 y
C
A+ B +C
Summary of Logic gates :
No Name Logic Diagram Truth Table
of
gate
2 OR 2 input OR gate
A
A+B A B A+B / F
B
0 0 0
0 1 1
1 0 1
1 1 1
Summary of Logic gates :
No Name Logic Diagram Truth Table
of
gate
3 NOT
NOT gate
A A’
A A’/A
0 1
1 0
Summary of Logic gates :
No Name Logic Diagram Truth Table
of
gate
- A B A+ B
A
OR
B A+B 0 0 0
0 1 1
1 0 1
1 1 0
Summary of Logic gates :
No Name Logic Diagram Truth Table
of
gate
7 EX 2 input Ex NOR
- A
B A B A+ B
NOR A+B
0 0 1
0 1 0
1 0 0
1 1 1
Implementation Of Boolean Equation Using
Logic Gates :
1) F=A+A’B
A’ A+AB
B AB
Implementation Of Boolean Equation Using
Logic Gates :
2) F= ABC+A’BC+B’C’
ABC
A’
B
C
C’ ABC+A’BC+B’C’
B’
Implementation Of Boolean Equation Using
Logic Gates :
3) F= (A’+B’+C)(A’+B+C)(A+B’)
ABC
(A’+B’+C)(A’+B+C)(A+B’)
A’
B
C
B’
Implementation Of Boolean Equation Using
Logic Gates :
4) F=A’B+AB’
AB
A’
A’B+AB’
B’
Implementation Of Boolean Equation Using
Logic Gates :
5) F=(A’B+AB’)’
AB
A’
A’B
(A’B+AB’)’
AB’
B’
Boolean Logic :
Boolean Logic is a complete system for
logical operations, used in many systems.
It was named after George Boole, who
first defined an algebraic system of logic
in the mid 19th century.
Boolean logic has many applications in
electronics, computer hardware and
software, and is the base of all modern
digital electronics.
Postulates of Boolean Algebra :
Postulates of Boolean Algebra means it
require no proof.
1) Commutative Postulates
A+B=B+A
A.B=B.A
2) Identity Postulates
A+0=A
A.1=A
A+A’=1
A.A’=0
Postulates of Boolean Algebra :
Postulates of Boolean Algebra means it
require no proof.
3) Distributive Postulates
A+B.C=(A+B).(A+C)
A.(B+C)=A.B+A.C
Properties of Boolean Algebra :
1) Commutative Property :
Boolean addition is commutative where
order of variable can be interchange.
A+B=B+A
This is a OR property, where sequence
of A and B can be interchange.
Properties of Boolean Algebra :
2) Associative Property :
In OR property grouped of variable can
be order any way.
A+(B+C)=(A+B)+C
Here in this example left hand side
group of variables B and C is made and
A is added to it. If group of A and B is
made and C is added to it there is no
change in the result.
Associative property is applicable to
AND operation :
A.(B.C)=(A.B).C
Properties of Boolean Algebra :
3) Distributive Property :
A+BC=(A+B).(A+C)
A.(B+C)=A.B+A.C
A.(B+C)=A.B+A.C
A+BC=A.1+B.C
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
A+0=A
A.1=A
A+A=A
A.A=A
A+1=1
A.0=0
A+A=1
A-A=0
A=A
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
1) A.(A+B)=A
L.H.S =A.A+A.B
=A+AB || A=A.A
=A(1+B)
=A.1 ||1=1+B
=A
L.H.S=R.H.S
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
2) A+AB=A
L.H.S=A+AB
=A(1+B) ||1+B=1
=A.1
=A
L.H.S=R.H.S
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
3) A+AB=A+B
L.H.S=A+B
=(A+A).(A+B)
=1.(A+B)
=A+B
L.H.S=R.H.S
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
4) A.(A+B)=AB
L.H.S=A.A+AB
=0+AB || A.A=0
=AB
L.H.S=R.H.S
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
5) X+X.Y=X
=X+X.Y
=X(1+Y) || X.X=1
=X.1
=X
L.H.S=R.H.S
Properties of Boolean Algebra :
Absorption Property / Absorption
Theorems:
6) X.(X+Y)=X
L.H.S=X.(X+Y)
=X.X+X.Y || remove bracket
=X+X.Y
=X(1.Y) ||(1+Y)=1
=X.1
=X
L.H.S=R.H.S
CANONICAL OR STANDARD FORMS:
There are two ways to represent Boolean
function, one is standard (canonical) Sum
Of Product form, and another is the
standard Product Of Sum.
0 1 1 0 1 0 0
1 0 0 1 1 0 0
1 1 0 0 1 0 0
DE-MORGAN’S THEOREMS :
Proof of De-Morgan’s theorem - 1
Theorem-2 :
X.Y=X+Y
X Y X Y X.Y XY X+Y
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0
KARNAUGH MAP (K-MAP) :
The boolean function may be simplified
using algebra method, but this method
is sometimes difficult because it lacks
specific rules.
This method is also known as a
KARNAUG MAP or Veitch Diagram.
The map is a diagram made of squares
and each square represent one
minterm.
How To plot a KARNAUGH MAP?
K- MAP for 2 variables :
Y
X 0 1
0 X’Y’ X’Y
1 XY’ XY
K- MAP for 2 variables :
For any square see the variable in the both
the row and the column.
For first square of the 1st row, variables are X’
and Y’, and hence it will represent the product
term X’Y’.
For the 2nd square of the 1st row, the variables
are X’ and Y, so it represents X’Y.
• 0 and 1 are written at the top of the map
shown in the above figure. They indicate
0 and 1 for variable.
• It means 0 represents variable in
complemented from (Y’) and 1 represents
variable in uncomplemented from (Y).
• Similarly on the extreme left side of the
map 0 and 1 are written and they
represents X’ and X respectively.
K- MAP for 2 variables :
(1) F=X’Y+XY’
Y
X 0 1
0 1
1 1
K- MAP for 3 variables :
A three variable K-Map has eight square or
cells and each square represent different
product terms.
For example: X’Y’Z’, X’Y’Z, X’YZ, X’YZ’,
XY’Z’, XY’Z, XYZ, XYZ’.
YZ
X 00 01 11 10
0 X’Y’Z’ X’Y’Z X’YZ X’YZ’
YZ
WX 00 01 11 10
0 X’Y’Z’ X’Y’Z X’YZ X’YZ’
YZ
X 00 01 11 10
0 1 1
1 1 1
Simplification using K-MAP :
Simplified the equation
F(W,X,Y,Z)= ∑(0,2,4,6,9,11,13,15)
YZ
WX 00 01 11 10
00 0 1 3 2
01 4 5 7 6
11 12 13 15 14
10 8 9 11 10
Simplification using K-MAP :
Simplified the equation
F(W,X,Y,Z)= ∑(0,2,4,6,9,11,13,15)
YZ
WX 00 01 11 10
00 1 1
01 1 1
11 1 1
10 1 1
Simplification using K-MAP :
Simplified the equation
F(W,X,Y,Z)= ∑(0,1,2,5,8,9,10)
YZ
WX 00 01 11 10
00 1 1 1
01 1
11
10 1 1 1
Don’t care condition :
In K-MAP every cell represent a minterm or
maxterm.
Sometime may be possible that any 1s or 0s
does not matter.
We say that don’t care what the function
output is to be for this minterm.
Minterms that may produce either 0 or 1 for
the function are said to be do not care and
are marked with × in the map.
The don’t care condition can be used to
provide further simplification of the algebraic
expression.
Simplification using Don’t Care
condition :
Simplified the equation
F(W,X,Y,Z)=∑(4,5,6,8,9,12,13)+d(3,7,10,11,15)
YZ
WX 00 01 11 10
00 ×
0 1 3 2
01 1 1 × 1
4 5 7 6
11 1 1 ×
12 13 15 14
10 1 1 × ×
8 9 11 10
What is Combinational Circuits? :
It is logical circuits, the output at any
time depends on the logic levels at the
input at that instant only.
It does not depend on the past
condition.
A combinational circuit transforms
binary information from the given
output data to the required output data.
Combinational Circuits:
Inputs Outputs
Combinational
Circuit
Memory Element
A sum S
Inputs
H/A carry
B C
Input Output
A B SUM Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
S=A’B+AB’
C=AB
K-MAP for Half Adder:
B B
A 0 1 A 0 1
0 1 0
1 1 1 1
S=AB+AB
Carry C=AB
Full Adder :
A full adder is a combinational circuit
that performs the arithmetic sum of
three input bits.
It consists three inputs and two outputs.
When we want to add two binary
numbers each having two or more bits
the LSB (Least Significant Bit) can be
added by using a half adder.
Block diagram of full adder is as given
below:
Full Adder Diagram :
sum S
Ci
A
Inputs F/A carry
B C
C=ABC+ABC+ABC+ABC
Full Adder circuit using two half
adders:
Sum
Cin S
H/A2
A2 C
B2 H/A1 Carry
K-MAP for Full Adder:
K-Map for Sum
AB
Ci 00 01 11 10
0 1 1
1 1 1
K-Map for Carry
AB
Ci 00 01 11 10
0 1
1 1 1 1
K-MAP for Full Adder:
AB C
C
Comparison between Half Adder and
Full Adder
Half Adder Full Adder
1. It is used for 2 bit 1. It is used for Multi
addition. bit addition.
2. One Ex-OR/OR gate 2. Two Ex-OR/OR
and one AND gate are gates and Multiple
used. AND gates are used.
3. Output is the sum 3. Output is the sum
of two signals. of three signals.
4. Circuit is simple. 4. Circuit is
complicated.
Comparison between Half Adder and
Full Adder
Half Adder Full Adder
5. There are two input 5. There are three
and two output input and two output
terminal. terminal.
6. Two half adder 6. Two full adder does
makes one full adder. not make one half
adder.
BCD Adder :
BCD stands for Binary Coded Decimal.
A BCD adder is a circuit which adds two
BCD digits in parallel and produces the
sum in BCD, means from 0 to 9 Decimal
numbers are represent in BCD form with
4 Binary digit.
BCD Adder :
Decimal BCD number
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
BCD Adder :
In BCD addition when two BCD numbers
get addition, after addition if value more
than 9 then it will selected by adding 6
to answer.
Example: If we make sum of decimal
digit 7 and 7 in binary form, it will be
1 1
0 1 1 1
+ 0 1 1 1
1 1 1 0
BCD Adder :
The result is 1110 equivalent 14 of decimal
which is not valid BCD form.
In order to get the answer in the BCD form
we have to skip six forbidden group.
To be this we have to add 0110 to the
answer, so in example let us add 0110 to the
answer.
1 1 Which is again
1 1 1 0 group line 0001=1
+ 0 1 1 0 and 0100=4
1 0 1 0 0
Correct BCD for is 14 (00010100)
Half Sub tractor :
Binary sub tractor can be made using
half sub tractor. Block diagram is shown
below:
Difference D
A
Inputs Half
Sub tractor Borrow
B B
Input Output
A B Difference D Borrow B
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
D=A’B+AB’
B=A’B
Half Sub tractor’ Truth table:
From the truth table we can write the
sum of product expression for difference
D and borrow B.
Half sub tractor using Ex-OR gate.
D=A’B+AB’
B=A’B Difference
A
B D
Borrow
B
K-MAP for Half Subtractor:
A B
B 0 1 A 0 1
0 1 0
1 1 1 1
D=A’B+AB’
B=A’B
K-MAP for D/ B :
A
Difference
B
D
Borrow
B
D=A’B+AB’
B=A’B
Full Sub tractor :
Block diagram is shown below:
Difference
Bi D
A Full
Inputs Sub tractor Borrow
B B
Bi H/S2 Borrow B
Block diagram of Full Sub tractor using two half sub tractor
K-MAP for Full Subtractor:
K-Map for Sub
AB
Ci 00 01 11 10
0 1 1
1 1 1
K-Map for Borrow
AB
Ci 00 01 11 10
0 1
1 1 1 1
K-MAP for Full Subtractot:
AB C
Difference
D
Borrow
B
Sequential Circuit :
Digital electronics is classified into
combinational logic and sequential logic.
Combinational logic output depends on
the input levels whereas sequential logic
output depends on sorted level and also
the input levels.
The memory element are devices
capable of storing binary info.
The binary info stored in the memory
elements at any given time defines the
state of the sequential circuit.
Sequential Circuits:
Inputs Outputs
Sequential
Circuit
Memory Element
R R Q Q
S S Q’
Q’
(1) SR or RS FF :
The most fundamental flip flop is the
simple RS flip flop or (RS latch) where R
and S stand reset and set.
RS flip flop using two NOR gate is
displayed.
R S Q Comments
0 0 1 No change
0 1 1 Set
1 0 0 Reset
1 1 ? Forbidden
(1) SR or RS FF (Logical Diagram) :
1
R 0
1 1 Q
0
S 2 Q’
1
0
Clocked RS FF :
In the simple R-S flip flop the output is depends on
input condition that is at any time the input
conditions are changed, output is also changed. They
are called as asynchronous flip flop.
The clocked R-S flip flop requires a clocked (Enabled)
input.
It means that this type of flip flop has three inputs,
named as S (set), R (Reset), and C (Clock).
Its R and S inputs will control the state of the flip flop
only when the clock input is high.
When the clock is low, the input becomes ineffective
and no change of state can take place.
This flip flop is known as Gated R-S flip flop or
Synchronous flip flop.
Clocked RS FF :
R SR Q
C flip flop
S With Q’
CLK
Block diagram of RS FF with clock
R S Q Comments
0 0 1(High) No change
0 1 1(High) Set
1 0 1(High) Reset
1 1 1(High) Indeterminate
Clocked RS FF :
If both inputs R and S equal to zero
during the clock transition the output
does not change, that is Q remain
unchanged.
The second input condition R=0 and
S=1 forces of output of first NAND gate
to be high, that is Q=1. Thus Q=1 is
said to SET.
The third input condition in the truth
R=1 and S=0 forces output of second
NAND gate to be high, that is Q’=1 and
Q=0 is said to RESET.
(1) SR or RS FF with clock (Logical
Diagram) :
S
3
1 Q
CLK
4 2 Q’
R
(2) D Flip Flop / Delay flip flop :
In D type flip flop there is one input called D
input (or data input) in addition to clock input.
The main disadvantages of R-S flip flop is
when both the inputs at high level it produced
forbidden condition.
To eliminated this condition the new kind of
flip flop is introduced with modification and it
is also known as Delay flip flop or D flip flop.
An inverter is connected as shown in the input
so that both that both the input terminals do
not go to same state simultaneously. So
forbidden condition does not arise.
(2) D Flip Flop / Delay flip flop :
Truth table of D flip flop:
Q(t) Present state D Q(t+1) Next State
0 0 0
0 1 1
1 0 0 Reset
1 1 1 Set
Output =D’Q+DQ
When D=0 and clock is high then it makes next
state Q(t+1) low, means reset the flip flop.
When D value is high with high clock pulses it
causes the flip flop to set. It does not have no
change condition.
(2) D Flip Flop / Delay flip flop :
D Q
CLK Q’
(2) D Flip Flop / Delay flip flop :
D
3
1 Q
4 2 Q’
R
K-MAP for D flip flop:
D
Q 0 1
0 1
1 1 1
Q(t+1)=D’Q+DQ
(3) J-K (Jump & Kick) flip flop :
The JK flip flop is called a universal flip flop
because the other flip flop like D, RS and T
can be derived from it.
The JK flip flop is very versatile and most
widely used.
The block diagram and circuit diagram shown
in figure.
The J k inputs are equal to S (Set) and R
(Reset) inputs of RS flip flop.
Working of J-K flip flop :
The functioning of J K flip flop is similar to that
of the R-S flip flop.
Inputs J and K behave like inputs S and R to
set and reset flip flop.
As shown in the truth table if both the inputs J
and K equal to zero then no change of state
take place even if a clock pulse is applied.
The second condition J=0 and K=1 causes flip
flop reset.
When J=1 and K=0 the flip flop sets.
When both inputs J=K=1 the flip flop switches
to its complement state.
(3) Working of J-K flip flop :
J Q
CLK
JK
K
FF
Q’
(3) Working of J-K flip flop :
J 3 1
0 1 Q
1
2 Q’
K 4 0
(3) Working of J-K flip flop :
J K Q(t+1)
0 0 No Change
0 1 0 Reset
1 0 1 Set
1 1 Q’ Complement
Q(t+1)=J’KQ’+JK’Q+JKQ’
K-MAP for J-K flip flop :
JK K-MAP for
Q 00 01 11 10
0 1 1 Reset
Set
1 1 Complement
Q(t+1)=J’KQ’+JK’Q+JKQ’
(4) T flip flop (Toggle(Two input) flip
flop) :
This flip flop has a single control input, labeled
as T for Toggle.
This flip flops are not widely available but it is
easy to construct from J K flip flop.
T flip flop is obtained by combining J and K
inputs of JK flip flop.
T FF has only two condition when T=0(J=K=0)
clock transition does not change the state of
flip flop but when T=1, clock transition
complements or toggles the state of flip flop.
T flip flop :
Q(t) T Q(t+1)
0 0 0 No Change
0 1 1
1 0 1
1 1 0 Complement
Q(t+1)=Q’T+QT’
K-MAP for T flip flop :
T
Q 0 1
0 1
1 1
Q(t+1)=Q’T+QT’
(4) T flip flop (Toggle(Two input) flip
flop) :
It means when
T=0 : Q(t+1)=Q(t) Q
T=1 : Q(t+1)=Q’(t) Q’
1
T 3 1 Q
0
1 0
2 Q’
4
(5) Master Slave flip flop) :
A master slave flip flop is constructed with the
help of two separate circuits.
First part of the circuit serves as a master and
second part of the circuit serves as a slave flip
flop.
Operation : When clock pulse CP=0 the
output of the inverter 1. This is applied to
Slave flip flop.
Since the clock input of the slave in now 1.
The flip flop is enabled and output Q is equal
to Y, while Q’ is equal to Y’.
(5) Master Slave flip flop) :
When the clock pulse again goes to 1, the
information then at the external J & K inputs is
transmitted to the master flip flop and thus Y
and Y’ get the values to the inputs of J-K
values.
The slave flip flop however is isolated as long
as the clock pulse is at its 1 level because the
output of the inverter is zero.
When the clock input of the slave is 1, the flip
flop enabled and output Q is equal to Y while
Q’ is equal to Y’.
(3) Working of J-K flip flop :
Y
J Q
J 1 Y
3 5
7 Q
Y’ 8 Q’
4 6
K 2
CP 9
Difference Between Sequential and
Combinational Circuit :
Combinational Sequential Circuit
Circuit
1. In this only logic 1. In this circuit
gates are used. No memory element used
memory element is addition with gates.
used.
2. Output at any 2. In this output at any
instant depends only instant is dependent
on the input condition. also on the past
condition.
Difference Between Sequential and
Combinational Circuit :
Combinational Sequential Circuit
Circuit
3. Design is simple 3. Design is difficult
due to absence of the due to memory
memory element. element.
4. More hardware 4. Less hardware
required. needed.
5. Cost is more as 5. Cost is less.
more hardware
needed.