Professional Documents
Culture Documents
Logic Circuits: Fundamentals of Instrumentation and Control
Logic Circuits: Fundamentals of Instrumentation and Control
S* = S’ + CK ‘ R* = R’ + CK’
Clocked RS Flip Flop (NAND)
• Case 1 : S = 0 and R = 0 then S* = 1 and R* = 1
• Case 2 : S = 0 and R = 1 then S* = 1 and R* = 0
• Case 3 : S = 1 and R = 0 then S* = 1 and R* = 0
• Case 4 : S = 1 and R = 1 then S* = 0 and R* = 0
CLK S R Qn Q’ n Qn+1
0 X X Memory Qn
1 0 0 No Change
1 0 1 0 1 0
1 1 0 1 0 1
1 1 1 1 1 Racing
D (Data) Flip Flop
• In the clocked SR flip flop
– The input is memorized until the next clock signal is provided
– S input is always opposite to R input for useful conditions
• This can be used to store the bit value and provide the clock only when a
change is desired
• We don’t need two separate inputs but one and its compliment
connected to the second input
RS
JK Flip Flop
Qn Q’ n Qn+1
• TO USE THE NOT USED CLK J K
0 X X Memory
CONDITION OF S-R Qn
1 0 0 No Change
FLIPFLOP WE NEED TO 1 0 1 0 1 0
1 1 0 1 0 1
USE THE J-K FLIP FLOP
Q n’
1 1 1 X X
Toggle
• When Clock occurs and
J and K both are in set
condition the output
will invert from present
state i.e. Toggle
T Flip Flop
• Simply obtained by tying both the J and K inputs of a JK Flip
Flop together
• Very useful for counting applications and frequency division
applications
CLK T Qn+1
0 to1 0 Qn
Qn
0 to 1 1
1 to 0 0 Qn
Q’n
1 to 0 1
(Toggle)
Binary Counters
• Constructed from T (or JK) flip-flops
by taking the output of one cell to
the clock input of the next and tying
the inputs (T or J and K) of each flip-
flop to 1 to produce a toggle at each
cycle of the clock input
• For each two toggles of the first cell,
a toggle is produced in the second,
and so on down to the fourth cell
• Taking the levels of all outputs gives a
binary number equal to the number
of cycles of the input clock signal as
X 3 X 2 X1 X 0
Down Counters
• The counters may count the number of pulses both upwards and downwards
• The counter we studied earlier is an up counter as it counts from all zeroes to all
ones
• The counter that counts from all ones to all zeroes is called a down counter
• A down counter may simply be designed using the complementary output Q’ of
the flip flops for the outputs rather than Q
Up/Down Counters
• Also called Bidirectional Counters
• The circuit is designed to have an additional input to choose between up
and down counting
Registers
• Made using multiple D flip flops operating
with single clock
Shift Registers
• Take input serially through one data line only
• Used to convert serial data into parallel
Digital Adders
• Digital Logic Circuits that can be used to add bits together
• Have two output bits
1. Sum
2. Carry
• There are two basic circuits
1. Half Adder: Adds 2 bits
2. Full Adder: Adds 3 bits.
• Byte addition is performed using full adders in parallel with carry out of
each bit as third input (called “Carry in”) to full adder circuit of higher bit
• Subtraction can be performed by adding negative (2’s complement) of
the byte to be subtracted
Half Adder
Bit 1 Bit 2 Sum Sum Carry
(A) (B) Bit (S) Bit (C)
0 0 00 0 0
0 1 01 1 0
1 0 01 1 0
1 1 10 0 1
•Sum =
• Carry =
Full Adder
A B Cin Sum Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
• Sum=Cin⊕(A⊕B)
• Cout=(A.B)+(Cin.(A⊕B)
4 Bit Binary Adders
• One half adder and any
number of full adder cells can
be connected together to
form an n-bit addition
• In this design, there is no Cin
input
• Inputs A and B are four bits
wide, and bit 0 (A(0) and B(0))
are the LSBs
• Sum is also four bit wide with
a Carry-Out as fifth bit
Binary Adder/ Subtractor
• Subtraction is addition of negative
• Negative are represented as 2’s complement
• 2’s complements are obtained by adding a 1 to
LSB of 1’s complement
• An additional signal (K) may decide whether
the number is to be subtracted (1) or added
(0)
Binary Adder/ Subtractor
XOR Gate as Controlled Inverter
Control Bit Data Bit Output
K B Q
Q= • XOR Gate can be used as
0 0 0 controlled inverter
B
0 1 1
1 0 1
• When the control input K is
B´ 0, it transfers the controlled
1 1 0
input B as it is to the output
• When the control input K is
1, it transfers the
complement B’ of the
controlled input B to the
output