0% found this document useful (0 votes)
3 views

Intro_To_LOGIC

logic gates

Uploaded by

murugeshj55
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Intro_To_LOGIC

logic gates

Uploaded by

murugeshj55
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

Introduction To

LOGIC GATES

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
• What is Boolean logic?
• What are logic gates?
• What is an AND gate?
Contents • Truth table for AND gate/operator
• What is an OR gate?
• Truth table for OR gate/operator
• What is an inverter or a NOT gate?
• Truth table for NOT gate/operator
• What is an EXOR gate (XOR)?
• Truth table for EXOR gate/operator
• What is an EXNOR gate (XNOR)?
• Truth table for EXNOR gate/operator
• What is a NAND gate/NAND logic?
• Truth table for NAND gate/operator

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
• What is a NOR gate/NOR logic?
• Truth table for NOR gate/operator
• Why are NAND and NOR gates known as univer
sal gates?
Contents.. • How to design all gates using NAND and NOR l
ogic gates?
• All gates using NAND gate
• All gates using NOR gate
• What are combinational logic circuits?
• Block diagram of a combinational logic circ
uit
• What are the different types of combinational l
ogic circuits?
• What are sequential logic circuits?
• Block diagram of a sequential logic circuit
• What are the different types of sequential logic
circuits?
Copy Right Reserved • What are the differences
Design2signoff between combination
al and sequential logic circuits?
Semiconductor Pvt Ltd
What is Boolean logic?

• Boolean logic deals with True and False. It has three main components. Also
known as operators. AND, OR and NOT. These words are quite similar to their
English counterparts. And these operators are the building blocks of Boolean
logic. Using these three operators, we can make simple logical statements.

• For example, It’s NOT Monday. This implies that Monday? = 0. I would like to have
bread AND cheese for breakfast. Which implies, Breakfast = 1, if bread =1 and
cheese = 1.
• Using these simple statements we can come up with any complex statement.
After all, this is how computers and everything digital works. This is it. A basic
building block of the modern Information World. Just these three operators. Next,
we will understand the concept of logic gates. And then we will move on to truth
tables where we will see the complete property of every logical operator starting
with the basic three.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What are logic gates?

• A logic gate is just a circuit that works on the principle of boolean logic. Basically,
it is the physical manifestation of Boolean logic. You know how silicon (which is
made from sand), is the basic building block for Integrated circuits? That is
exactly how gates are made.

• Transistors are electronic switches. Even their outputs are either Vcc or GND.
Which can translate to 0 or 1/ True or False. We use special transistors called
CMOS to make circuits that deploy the statements of a particular logic. Hence for
AND logic, we have an AND gate. For OR logic, we have an OR gate and so on.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is an AND gate?

• An AND gate implements


the boolean logic AND. As
simple as that. The AND
gate is a basic gate. Let’s
take a look at the symbol
and truth table for AND
gate first.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
AND GATE
• From the truth table, we can say that the output of the AND logic or an AND gate
is True or high or 1, only when A and B are 1. If you observe the table, the
equivalent mathematical logic for the AND boolean logic is that of multiplication.
Hence, we can calculate the product of two digital inputs using an AND gate.
• For larger numbers, we can use the AND gate to design a circuit known as a
multiplier.. Can you now start to see how and why logic gates are important to
make computers? Moreover, we even represent the AND operation using the
concept of the dot product.
Y(A and B) = A.B
• Similarly, the electrical equivalent is a circuit with two resistors in series
connected to a bulb. The bulb is on only when both the switches are 1 or shorted.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is an OR gate?

• An OR gate implements the


boolean logic OR. The OR
gate is a basic gate. Let’s
take a look at the symbol
and truth table for OR gate
first.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
OR Gate

• From the truth table, we can say that the output of the OR logic or an OR gate is
True or high or 1, even if either or both of A or B are 1. If you observe the table,
the equivalent mathematical logic for the OR boolean logic is that of binary
addition. Hence, we can calculate the sum of two digital inputs using an OR gate.
Moreover, we even represent the OR operation using the sum sign.
• Y (A or B) = A + B
• Similarly, the electrical equivalent of the OR gate is a circuit with two resistors in
parallel connected to a bulb. The bulb is if either one or both of the switches are 1
or shorted.

Any Guess??

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
OR GATE

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is an inverter or a NOT gate?

• A NOT gate gives an output that is the inverse or opposite


of its input. Hence it is alternatively known as an inverter.
Think of it this way. The output of a NOT gate is not its
input. Since we only have two possible outputs, it will be
the opposite of the input. The inverter is one of the most
important logical operators available in
digital logic design. Let’s take a look at the symbol and
the truth table for a NOT gate.

• We can represent the not operation in the following


manner

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is an EXOR gate (XOR)?

• An EXOR gate or EXOR logic


is slightly tricky. It’s short
for Exclusive OR. Also
written as the XOR gate.
The easiest way I have
found to remember this
logic is by remembering
that an EXOR gate is also
known as an “inequality
detector”. This means that
the output will be high
whenever the inputs are
NOT equal. Let’s take a look
at the symbol and the truth
table for an EXOR gate.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
Semiconductor Pvt Ltd
Copy Right Reserved

The EXOR gate is not a basic logic gate. We can


make it using our basic gates. However, its logic
is so important to the core of boolean operations
that we designate it a special symbol. We can
represent the EXOR operation as follows.

XOR GATE
Design2signoff

As you can see, the second equation AB’ + A’B


indicates that we can implement the EXOR logic
using two AND gates, two NOT gates and one OR
gate. Try designing this on your own and cross-
check it if it’s the same as this.
What is an EXNOR gate (XNOR)?

• An EXNOR logic gate is the


opposite of the XOR gate. We can
extend the functionality of the
gates we have seen so far by just
attaching an inverter to them.
This will allow us to have more
options of creating complex logic
using essentially the same gates
that we have seen so far, albeit
with an inverter attached at their
outputs. Doing this, the only
change in the symbols for the
resulting logic gates is that we
put a bubble at the output to
indicate that the output shall be
opposite to that of the regular
output of the gate. So let’s take a
look at the symbol and truth table
for an EXNOR gate.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is a NAND gate/NAND logic?

• A NAND gate’s output is low


only when both the inputs
are high. In all the other
cases, its output is high. We
can obtain NAND logic by
just connecting a NOT gate
to an AND gate. Let’s take a
look at the symbol and the
truth table.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is a NOR gate/NOR logic?

• A NOR gate’s output is high


only when both the inputs
are low. In all the other
cases, its output is low. We
can obtain NOR logic by
just connecting a NOT gate
to an OR gate. Let’s take a
look at the symbol and the
truth table.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
Why are NAND and
NOR gates known as
universal gates?

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
UNIVERSAL • NAND and NOR logic gates are known as
universal gates because they can implement
GATES any boolean logic without needing any other
gate. They can be used to design any logic
gate too. Moreover, they are widely used in ICs
because they are easier and economical to
fabricate.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
• Using universal gates we can derive all
the basic logic gates, EXOR gate, and
How to design all their inverse gates. It takes a bit of
trial and error. Or you can use boolean
gates using logic to obtain these. You have the
NAND and NOR equation for a NAND gate and for a
NOR gate. You also have equations for
logic gates? the gates you wish to design. Use
Boolean logic and solve for the output
you need. It might take some time but
it is necessary to practice this to get a
hang of boolean logic and logic gates.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
All gates
using
NAND
gate.

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


All gates
using
NAND
gate.

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


All gates
using NOR
gate

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


All gates
using NOR
gate

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


LOGIC CIRCUITS

• To implement a logic, we use logic


circuits.

• There are two types of logic circuits:


• Combinational logic circuits
• Sequential logic circuits

Copy Right Reserved Design2signoff Semiconductor


Pvt Ltd
What are combinational logic circuits?

• Combinational circuits are a basic


collection of logic gates. Their outputs
depend only on the current inputs.
Combinational circuits are also time-
independent. Along with the absence of
concepts like past inputs,
combinational circuits also do not
require any clocks. The result of these
properties is a simple circuit capable of
implementing complex logic using only
logic gates. An easy to understand
example is a full adder.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What are the different types of
combinational logic circuits?

• There are three main types of combinational logic


circuits.
1.Arithmetic and logical combinational circuits –
Adders, Subtractors, Multipliers, Comparators.
2.Data handling combinational circuits –
Multiplexers, Demultiplexers,
priority encoders, decoders.
3.Code converting combinational circuits –
Binary to Gray, Gray to Binary, Binary to Excess 3,
seven-segment, etc.
Copy Right Reserved
Design2signoff Semiconductor Pvt Ltd
Combinati
onal logic
circuits:
ADDERS

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


Combination
al logic
circuits:

ADDERS

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


Multiplexer

• A multiplexer is a
digital combinational logic circuit . Its
purpose is to connect one of the inputs
to the output line, depending on a
control signal.

• It has maximum of 2m data inputs, ‘m’


selection lines and single output line.
One of these data inputs will be
connected to the output based on the
values of selection lines.
• Since there are ‘m’ selection lines,
there will be 2m possible combinations
of zeros and ones. So, each
combination will select only one data
input. Multiplexer is also called as Mux.

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
Copy Right Reserved

• Basically, it switches
between one of the many
input lines and connects
Multiplexe them one by one to the
output. It decides which
r.. input line to switch to using
Design2signoff Semiconductor Pvt Ltd

a control signal.
Multiplexer..

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
4x1 Multiplexer

• 4x1 Multiplexer has four data inputs I3, I2, I1 &


I0, two selection lines s1 & s0 and one output
Y.

• Boolean function

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
4x1
Multiplexer..

• We can implement this Boolean


function using Inverters, AND gates
& OR gate. The circuit diagram of
4x1 multiplexer is shown in the
following figure.

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
8:1 MUX

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
2:1

4:1
Multiplexer-
Types:
8:1

16:1 ..
Copy Right Reserved Design2signoff
Semiconductor Pvt Ltd
WHY NOT 6:1?
Multiplexer-
Types:

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
How to join multiplexers?

• If we have small multiplexers, but we wish to increase their


functionality, we can join them to obtain a mux with more inputs.
The cascading of multiplexers is easy. You just need to make sure
that you connect in a way that gives the same number of inputs
and control lines as your target mux.

• Let’s make a 4:1 mux using 2:1 multiplexers. We know that a 2:1
mux has two inputs and one select line. So joining two 2:1
multiplexers will give us four inputs, two outputs (we need only
1), and two select lines. So how do we proceed?

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
How to join
multiplexers?

• If we can somehow reduce the


outputs to one, it would be
really easy. Since we wish to
use only multiplexers, how do
we combine two lines to get a
single line?
We use another
2:1 mux!

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
Semiconductor Pvt Ltd
Copy Right Reserved

Implementation • Now, let us implement the following two


of Higher-order higher-order Multiplexers using lower-
order Multiplexers.
Multiplexers
Design2signoff

• 8x1 Multiplexer
• 16x1 Multiplexer
Semiconductor Pvt Ltd
Copy Right Reserved

• Let us implement 8x1 Multiplexer using 4x1


Multiplexers and 2x1 Multiplexer. We know that 4x1
Multiplexer has 4 data inputs, 2 selection lines and
one output. Whereas, 8x1 Multiplexer has 8 data
inputs, 3 selection lines and one output.

8x1 • So, we require two 4x1 Multiplexers in first stage in


Multiplexer order to get the 8 data inputs. Since, each 4x1
Multiplexer produces one output, we require a 2x1
Design2signoff

Multiplexer in second stage by considering the


outputs of first stage as inputs and to produce the final
output.

• Let the 8x1 Multiplexer has eight data inputs I7 to I0,


three selection lines s2, s1 & s0 and one output Y.
The Truth table of 8x1 Multiplexer is shown below.
8:1 MUX
USING Two
4:1 MUX

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


•Assignment…
USING

MUX
Two 8:1
16:1 MUX
Copy Right Reserved Design2signoff
Semiconductor Pvt Ltd
What are • Sequential circuits are a collection of memory
elements. These memory elements are
sequential flip-flops. These circuits are capable of
“remembering” data. Hence, a sequential
logic circuits? circuit’s output depends on the current input,
as well as past input.

• Moreover, since flip-flops are present, the


output of a sequential circuit also depends on
the clock input. These circuits are quite
complex. They are capable of implementing
complex logic with memory. Add a memory
element and feedback to a combinational
circuit, and you get a sequential circuit.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
Copy Right Reserved Design2signoff
Semiconductor Pvt Ltd
What are the 1.Synchronous sequential circuits– The
same clock input synchronizes all the memory
different elements as in synchronous counters.

types of 2.Asynchronous sequential circuits– An


sequential external clock is absent. However, the clock
inputs receive pulse inputs from other
logic circuits? sources/elements in the circuit — for example,
Asynchronous counters.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
FLIP-FLOPS & LATCHES

• Storing memory is a very important technology. This is


possible due to semiconductors. And we have the ability
to store digital data due to flip-flops and latches.

• Starting off, we will first see what latches are. Then


• What are flip-flops?
• Difference between Latches & Flip-Flops
• Finally, we will see the different types of flip-flops and
understand their working..

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
CONTENTS
• What is a digital latch?
• What are the types of latches?
• SR Latch using NAND gate
• SR NAND latch truth table
• SR Latch using NOR gate
• SR NOR latch truth table
• What are flip-flops?
• What are the different types of flip-flops?
• What are the differences between latches and flip-flops?
• How to design an SR Flip Flop?
• Working of an SR flip-flop/SR flip-flop truth table explanation
• SR flip-flop truth table
• What’s the JK Flip Flop circuit design like?
• Working of a JK flip-flop circuit
• Truth table for JK flip-flop
Copy Right Reserved Design2signoff
Semiconductor Pvt Ltd
CONTENTS..
• Advantage and disadvantage of JK flip-flop
• How to design a Master-Slave JK flip-flop?
• Working of a Master-Slave JK flip-flop
• Master-Slave JK flip-flop truth table
• How to design a D Flip-Flop?
• Working of a D flip-flop
• Truth table for D flip-flop
• How to design a T Flip-Flop?
• Working of a T flip-flop
• Truth table for T flip-flop
• An implementation of the T flip-flop truth table that shows the meaning of toggle output

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What is a digital latch?

• A latch is a simple circuit that responds


by switching its output between two
states on the application of certain
inputs. A digital latch is the building
block of sequential circuits. It is made
using NOR or NAND logic gates.
• Latches have a feedback system. This
means that the output of the latch is
given back to its input. This indicates
that the outputs of a latch depend on
current as well as previous inputs. A
latch has two inputs and two outputs.
The outputs are complementary to each
other.

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
• Depending on the types of logic
gates, we classify the digital latches
What are into two main types.
the types - SR NAND latch
of - SR NOR latch
latches?
• Their function is similar. However,
their truth tables are the opposite of
each other.

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
LATCH..
• The construction is
simple. Two inputs, S
and R. Two outputs that
are complementary to
each other, Q and Q’.
And the outputs are
fed back to the gates.
The SR latch truth
table and working of
the SR latch are given
below.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
LATCH..
Case 1
• For the input S=1; R=0, the output of the lower NAND gate
is 1. Because from the NAND truth table, even one low input
gives you a high output. Thus Q’=1. The input to the upper
NAND gate is now 1 NAND 1, which is equal to 0. Q =0.
Thus, the outputs satisfy their complementary relationship.
In this case, the latch is said to be in the RESET state.
Case 2
• For the input S=0; R=1, the output of the upper NAND gate
is 1. Thus Q=1. The input to the lower NAND gate is now 1
NAND 1, which is equal to 0. Q’ =0. Thus, the outputs satisfy
their complementary relationship. In this case, the latch is
said to be in the SET state.

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
What are flip-flops?

• Flip-flops are also the building blocks of


sequential circuits. They are made using latches.
They are circuits where the output depends not
only on the current input but also on the previous
inputs. They are also known as memory cells, as
they can store one bit of binary data.

• In fact, flip-flops are the fundamental memory


units in electronics. Flip-flops work on the
application of a clock signal. This makes them
synchronous. A flip-flop has two inputs and two
outputs. The outputs (Q and Q’) are complements
of each other.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What
are the We have four main types of flip-flops.

different SR flip-flop (Set-Reset flip-flop)

types of D flip-flop (Delay/Data flip-flop)

flip- T flip-flop (Toggle flip-flop)

flops? JK flip-flop (Jack-Kilby flip-flop)

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What are the
differences
between
latches and
flip-flops?

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


What are the
differences
between
latches and
flip-flops?

Copy Right Reserved Design2signoff Semiconductor Pvt Ltd


How to design an SR Flip Flop?

• An SR flip-flop is an
extension of the SR latch.
So let’s take our SR latch
(NAND gates). Attach the
outputs of two new NAND
gates to the inputs of the
SR latch. Apply a common
clock input to the new
NAND gates. The other
inputs to the first and
second new NAND gates
are S and R, respectively.
This is how we construct an
SR flip-flop.

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
Working of an SR flip-flop/SR flip-flop truth
table explanation

• As we know, flip-flops are edge-triggered devices. Which


means that a clock input is necessary to enable them.
More specifically, flip-flops take in or consider new
inputs only at the edge of a clock pulse. This clock pulse
can either be rising or falling.

• Let’s start by plotting the truth table for various cases of


inputs. Since we are using NAND gates, you might want
to pull up this truth table of a NAND gate in a new tab to
refer to. Just in case you don’t remember it by heart.

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd
Working of an SR flip-flop/SR
flip-flop truth table
explanation

• CLOCK = 0; S, R = x
• In the first case, we will apply no clock and see what happens. Refer
to the logic diagram above. When no clock is given to the NAND
gates, their outputs will have the logic 1. This is because, if you refer
to the NAND gate’s truth table, for even a single low input, the
output is high. So the outputs of the two NAND (A and B) gates are 1
regardless of the S and R inputs. These two outputs act as inputs to
the next two NAND gates. Let’s call the top gate with output Q as
gate x and the lower gate with Q’ output as gate y. Gate x has gate
y’s output as input. Likewise, gate y has gate x’s output as input.
Hence since they are NAND gates,
we know Y = (A.B)’
Q = (1.Q’)’ and Q’ = (1.Q)’
• Now there are two possible values for both Q and Q’. 0 and 1. Let’s
put those two values in the above equations and see what we get.
Copy Right Reserved Design2signoff
Semiconductor Pvt Ltd
What are the
differences
between
combinational
and
sequential
logic circuits?

Copy Right Reserved Design2signoff


Semiconductor Pvt Ltd
What are the differences between
combinational and sequential logic circuits?

Copy Right Reserved


Design2signoff Semiconductor Pvt Ltd

You might also like