You are on page 1of 31

Logic Gates

Non Basic gates


NAND: ( AND gate with inverted output)
Logic Expression: X = (AB)’

A B X
0 0 1
0 1 1
1 0 1
1 1 0
Non Basic Gates
NOR Gate : ( OR gate with Output inverted)
Logical Expression: X = (A + B)’

A B X
0 0 1
0 1 0
1 0 0
1 1 0
Non Basic Gates
XOR ( If Inputs are alike the output is 0, If Inputs
are Unlike the output is 1 )
Logical expression :

A B X
0 0 0
0 1 1
1 0 1
1 1 0
Universal gates
Universal gate is the gate which can
implement any of the Boolean function
without need for any other type of gate.

NAND gate , NOR gate are universal gates.


Transistors
It is a Device that acts, depending upon
voltage level of input signal, either as wire
that conducts electricity or resistor that
blocks the flow of electricity.
Constructing gates
A transistor has three terminals
• A Source
• A Base
• A Emitter, connected
to ground wire ( earthed)
Diodes
• Is two terminal Electric device that allows
current to flow in one direction not the
other.
• The diode's two terminals are called the
anode and cathode. In the diode symbol,
the arrow points from the anode (flat part
of triangle) toward the cathode (point of
the triangle).
Diode as AND & Or gate
Diode as AND & Or gate
• And: If one of the inputs A or B is grounded,
current flows through the diode and the output
node X is at a low voltage. The only way to get a
high output is by having both inputs high. This is
clearly a logical AND function
• Or :Whenever one or the other of the inputs A
and B are high, current flows through the
associated diode. This brings the output node Y
to a high voltage. This circuit clearly implements
a logical OR.
Adders ( Half adder )

Half adder :
Logical Circuit
that perform
addition
operation on two
bits and produces
a sum (S) and
carry (C) .
Half adder
Logical Expression :
S = A xor B  A (+) B
C = A and B  AB
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Full adder
Full adder:
Logical Circuit that
perform addition
operation on three
bits ( A , B and carry
Ci) and produces a
sum (S) and carry
(Co)
Full Adder
Logical expression : A B Ci Co S
S = A xor B xor Ci
Co = (A.B) + (Ci .(A xor 0 0 0 0 0
B)) 0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Adder as Subtractor
Suppose A- B = A + (-B) where (-B) is 2’s
complement of B.

1’s complement can be calculated using Xor


gate with I/P 1.
2’s complement can be calculated by
adding 1 to Co.
Binary Adder as Subtractor
MUX
• Mux: if N control lines,
2^N data lines and
one output line.
• Data Input selected
from control are gated
to output.
• Each AND gets three
control and one input
signal.
• OR gate is used to
select from all Inputs
DeMux
• Demultiplexer
– a single input
– n selection
inputs
– 2n outputs
Sequential Circuits
• Output depends on current as well as past
inputs
– Depends on the history
– Have “memory” property
• Sequential circuit consists of
• Combinational circuit
• Feedback circuit
– Past input is encoded into a set of state variables
• Uses feedback (to feed the state variables)
– Simple feedback
– Uses flip flops
Components of sequential Circuit
Latches
• Can remember a bit
• Level-sensitive (not edge-sensitive)
• A NOR gate implementation of SR latch
Latches
• SR latch outputs follow inputs
• In clocked SR latch, outputs respond at
specific instances
– Uses a clock signal
Latches
• D Latch
– Avoids the SR = 11 state
Flip flops
• Edge-sensitive devices
– Changes occur either at positive or negative
edges

Positive edge-triggered D flip-flop


Flip Flops
• Notation
– Not strictly followed in the literature
• We follow the following notation for latches and
flip-flops
Flip-flops
Latches
JK Flip Flop
• JK flip-flop is a
refinement of the
SR flip-flop in that
the indeterminate
state of the SR
type is defined in
the JK type
JK Flip Flop

J K Q(t+1)
0 0 Q( no
change)

0 1 0(
reset)
1 0 1(set)
1 1 Q’
(toggle)
T Flip Flop

• The T flip-flop is a
single input
version of the JK
flip-flop
T Flip Flop

Q T Q(t
+1)
0 0 0
0 1 1
1 0 1
1 1 0
Boolean algebra
1.Commutative Law
A.B=B.A
A+B=B+A
2. Associate Law
(A . B) . C = A . (B . C)
(A + B) + C = A + (B + C)
3. Distributive Law
(A + B) . C = (A . C) + (B . C)
(A . B) + C = (A + C) . (B + C)
4. Identities
A+0=A
A.1=A
5.
A+1=1
A.0=0
Boolean algebra
6.
– A+A=A
– A.A=A
7.
– A + (/A) = 1
– A . (/A) = 0
8. Inverse
– /(/A) = A

9. De Morgan’s Theorem
– /(A+ B) = (/A) . (/B)
– /(A . B) = (/A) + (/B)

• Usually /(‘) is evaluated first, then *, then +, with this order being
changed by using parentheses

You might also like