Logic Gates, Adders, FF
Logic Gates, Adders, FF
These digital
logic gates form the basis for all implemented computing machines. That is,
Logic gates are the basic building blocks of any digital system. It is an
electronic circuit having one or more than one input and only one output.
The relationship between the input and the output is based on certain
logic.
Logic gates are used to carry out logical operations based on the Boolean
Functions on a single or multiple binary inputs and give one binary output
Based on this, the basic logic gates are named as AND gate, OR gate,
NOT gate etc.
AND Gate -
A circuit which performs an AND operation and has n
input (n >= 2) and one output. The output of the AND gate is high(1)
when both the inputs are high(1) otherwise it is low(0).
NOT Gate - NOT gate is also known as Inverter. It has one input and
one output. The output is high(1) when the input is low(0) and vice versa.
XOR Gate - XOR or Ex-OR gate is a special type of gate. The exclusive-
OR gate is abbreviated as EX-OR gate or sometime as X-OR gate. It has n
input (n >= 2) and one output. This gate is used in the construction of
arithmetic circuits. The output of the XOR gate is high(1) when the inputs
are different otherwise it is low(0) when the inputs are same.
The NAND and NOR gates are universal gates. To prove that, any
Boolean function can be implemented using only NAND or NOR gates. We
will show that the AND, OR, and NOT operations can be performed using
only these gates.
1. All NAND input pins connect to the input signal A gives an output A’.
2. One NAND input pin is connected to the input signal A while all
other input pins are connected to logic 1. The output will be A’.
1 2
AB.
Thus, the NAND gate is a universal gate since it can implement the
AND, OR and NOT functions.
1. All NOR input pins connect to the input signal A gives an output A’.
2. One NOR input pin is connected to the input signal A while all other
input pins are connected to logic 0. The output will be A’.
Implementing OR Using NOR Gates only
An OR gate can be replaced by two NOR gates as shown in the figure.
Two NOR gates are connected in sequential to get the OR gate. The
output of NOR gate1 is (A+B)’. This will be an input for the NOR gate2.
The final output from the NOR gate2 is ((A+B)’)’ which is equivalent to
A+B.
1 2
Thus, the NOR gate is a universal gate since it can implement the AND,
OR and NOT functions.
Combinational circuit
Combinational Logic Circuits are made up from different gates that are
“combined” or connected together to produce switching circuits. These
logic gates are the building blocks of combinational logic circuits.
Block diagram
Adder
An adder is a digital circuit that performs addition of numbers. The adder
adds two or three binary digits called augend , addend or carry and
produces two outputs as sum and carry.
Half Adder
Half adder is a combinational logic circuit with two inputs and two
outputs. The half adder circuit is designed to add two binary input
number A and B and produces two outputs sum (S) and carry ( C ).
Block diagram
=A⊕B
S = AB’ + A’B
C = AB
Circuit Diagram
Full Adder
Full adder is developed to overcome the drawback of Half Adder circuit. Half adder
cannot able to handle the carry from previous output. Therefore full adder adds two
one-bit numbers A and B and carry from the previous output C in and produces sum (S)
and carry (Co). That is, the full adder is a three input and two output combinational
circuit.
Block diagram
Truth Table
Circuit Diagram
A ⊕ B ⊕ Cin
= Cin XOR (A XOR B)
=
As the full adder circuit above is basically two half adders connected
together, the truth table for the full adder includes an additional
column to take into account the Carry-in, CIN input as well as the
summed output, S and the Carry-out, COut bit.
Synchronous Circuit
Asynchronous Circuit
In synchronous sequential circuits, the state of device
changes at discrete times in response to a clock signal. In
asynchronous circuits, the state of the device changes in
response to changing inputs.
Synchronous Circuits
In synchronous circuits, the inputs are pulses with certain
restrictions on pulse width and propagation delay. Thus
synchronous circuits can be divided into clocked and un-
clocked or pulsed sequential circuits.
Synchronous Circuit
Asynchronous Circuits
An asynchronous circuit does not have a clock signal to
synchronize its internal changes of the state. Hence the state
change occurs in direct response to changes that occur in
primary input lines. An asynchronous circuit does not require
the precise timing control from flip-flops.
Asynchronous Circuit
Flip flop is said to be edge sensitive or edge triggered rather than being level
triggered like latches.
RS Flip Flop
Block Diagram
SR Flip Flop Block Diagram
Circuit Diagram
Truth Table
Operation
1 S = R = 0 : No
If S = R = 0 then output of NAND gates 3 and 4 are
change
forced to become 1.
Hence R' and S' both will be equal to 1. Since S'
and R' are the input of the basic S-R latch using
NAND gates, there will be no change in the state of
outputs.
2 S = 0, R = 1, E = 1
Since S = 0, output of NAND-3 i.e. R' = 1 and E = 1
the output of NAND-4 i.e. S' = 0.
Hence Qn+1 = 0 and Qn+1 bar = 1. This is reset
condition.
3 S = 1, R = 0, E = 1
Output of NAND-3 i.e. R' = 0 and output of NAND-4
i.e. S' = 1.
Hence output of S-R NAND latch is Q n+1 = 1 and Qn+1
bar = 0. This is the reset condition.
4 S = 1, R = 1, E = 1
As S = 1, R = 1 and E = 1, the output of NAND
gates 3 and 4 both are 0 i.e. S' = R' = 0.
Hence the Race condition will occur in the basic
NAND latch.
JK Flip Flop
The name JK flip-flop is termed from the inventor Jack Kilby from texas
instruments. The basic S-R NAND flip-flop circuit has many advantages
and uses in sequential logic circuits but it suffers from two basic switching
problems.
1. the Set = 0 and Reset = 0 condition (S = R = 0) must always be
avoided
2. if Set or Reset change state while the enable (EN) input is high
the correct latching action may not occur
Then to overcome these two fundamental design problems with the SR flip-
flop design, the JK flip Flop was developed.
This simple JK flip Flop is the most widely used of all the flip-flop designs
and is considered to be a universal flip-flop circuit.
Circuit Diagram
JK
Flip Flop Circuit
Block Diagram
Circuit Diagram
Truth Table
Operation
1 E=0
Latch is disabled. Hence no change in output.
2 E = 1 and D =
If E = 1 and D = 0 then S = 0 and R = 1. Hence irrespective
0
of the present state, the next state is Q n+1 = 0 and Qn+1‘=1.
This is the reset condition.
3 E = 1 and D =
If E = 1 and D = 1, then S = 1 and R = 0. This will set the
1
latch and Qn+1 = 1 and Qn+1’=0 irrespective of the present
state.
Symbol Diagram
Block Diagram
Truth Table
Operation
Circuit Diagram
Truth Table
Operation
1 J = K = 0 (No
When clock = 0, the slave becomes active and
change)
master is inactive. But since the S and R inputs
have not changed, the slave outputs will also remain
unchanged. Therefore outputs will not change if J =
K =0.
2 J = 0 and K = 1
Clock = 1 − Master active, slave inactive. Therefore
(Reset)
outputs of the master become Q 1 = 0 and Q1’ = 1.
That means S = 0 and R =1.
Clock = 0 − Slave active, master inactive. Therefore
outputs of the slave become Q = 0 and Q bar = 1.
Again clock = 1 − Master active, slave inactive.
Therefore even with the changed outputs Q = 0 and
Q’ = 1 fed back to master, its output will be Q1 = 0
and Q1’= 1. That means S = 0 and R = 1.
Hence with clock = 0 and slave becoming active the
outputs of slave will remain Q = 0 and Q’ = 1. Thus
we get a stable output from the Master slave.
3 J = 1 and K = 0 (Set)
Clock = 1 − Master active, slave inactive. Therefore
outputs of the master become Q1 = 1 and Q1‘= 0.
That means S = 1 and R =0.
Clock = 0 − Slave active, master inactive. Therefore
outputs of the slave become Q = 1 and Q bar = 0.
Again clock = 1 − then it can be shown that the
outputs of the slave are stabilized to Q = 1 and Q
bar = 0.
4 J = K = 1 (Toggle)
Clock = 1 − Master active, slave inactive. Outputs of
master will toggle. So S and R also will be inverted.
Clock = 0 − Slave active, master inactive. Outputs of
slave will toggle.
These changed output are returned back to the
master inputs. But since clock = 0, the master is still
inactive. So it does not respond to these changed
outputs. This avoids the multiple toggling which
leads to the race around condition. The master
slave flip flop will avoid the race around condition.
Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses
only the binary numbers i.e. 0 and 1. It is also called as Binary Algebra or logical
Algebra. Boolean algebra was invented by George Boole in 1854.