Wa0009.
Wa0009.
Combinational Memory
logic elements
External inputs
Memory Q
command element stored value
Memory Elements
Memory Elements
▪ Memory element with clock. Flip-flops are memory elements that
change state on clock signals.
Memory Q
command element stored value
clock
▪ Clock is usually a square wave.
Positive pulses
S R Q Q'
R
Q 1 0 1 0 initial
0 0 1 0 (afer S=1, R=0)
0 1 0 1
Q' 0 0 0 1 (after S=0, R=1)
S 1 1 0 0 invalid!
Gated S-R Latch
E S R Q 𝑸′
0 0 0 Latch Latch
0 0 1 Latch Latch
0 1 0 Latch Latch
0 1 1 Latch Latch Gated SR Latch
1 0 0 Latch Latch
S
1 0 1 0 1
Q
1 1 0 1 0
1 1 1 0 0 EN
R
Latch Circuits: Not Suitable
Clock signal
▪ It comprises 3 parts:
❖a basic NAND latch
❖a pulse-steering circuit
❖a pulse transition detector (or edge detector) circuit
▪ The pulse transition detector detects a rising (or falling) edge and
produces a very short-duration spike.
S-R Flipflop
The pulse transition detector:
S
Q
Pulse
CLK transition
detector
Q'
R
CLK' CLK'
CLK CLK* CLK CLK*
CLK CLK
CLK' CLK'
CLK* CLK*
D
Q D Q
EN EN
Q' Q'
Gated D Latch
▪ When EN is HIGH,
❖ D=HIGH → latch is SET
❖ D=LOW → latch is RESET
▪ Hence when EN is HIGH, Q ‘follows’ the D (data) input.
▪ Characteristic table:
EN D Q(t+1)
1 0 0 Reset
1 1 1 Set
0 X Q(t) No change
▪ Characteristic table.
Q J K Q(t+1)
J K CLK Q(t+1) Comments 0 0 0 0
0 0 Q(t) No change 0 0 1 0
0 1 0 Reset 0 1 0 1
1 0 1 Set 0 1 1 1
1 1 Q(t)' Toggle 1 0 0 1
1 0 1 0
1 1 0 1
Q(t+1) = J.Q' + K'.Q 1 1 1 0
T Flip-flop
▪ T flip-flop: single-input version of the J-K flip flop, formed by tying
both inputs together.
T
Q T J
Pulse Q
transition C
CLK CLK
▪
detector K
Q' Q'
▪ Characteristic table.
T CLK Q(t+1) Comments Q T Q(t+1)
0 Q(t) No change 0 0 0
1 Q(t)' Toggle 0 1 1
1 0 1
1 1 0
Q(t+1) = T.Q' + T'.Q
Edge-Triggered Flip-flops
• S-R, D and J-K edge-triggered flip-flops. Note the “>” symbol at the
clock input.
S Q D Q J Q
C C C
R K
Q' Q' Q'
S Q D Q J Q
C C C
R K
Q' Q' Q'
J Q0 J Q1
CLK C C
Q0
K K
FF0 FF1
CLK 1 2 3 4
Q0 Timing diagram
00 → 01 → 10 → 11 → 00 ...
Q0 0 1 0 1 0
Q1 0 0 1 1 0
Asynchronous (Ripple) Counters
• Example: 3-bit ripple binary counter.
HIGH
J Q0 J Q1 J Q2
CLK C Q0 C Q1 C
K K K
FF0 FF1 FF2
CLK 1 2 3 4 5 6 7 8
Q0 0 1 0 1 0 1 0 1 0
Q1 0 0 1 1 0 0 1 1 0
Q2 0 0 0 0 1 1 1 1 0
Recycles back to 0
Asynchronous (Ripple) Counters
• Example: 3-bit ripple binary counter.
HIGH
J Q0 J Q1 J Q2
CLK C Q0 C Q1 C
K K K
FF0 FF1 FF2
CLK 1 2 3 4 5 6 7 8
Q0 0 1 0 1 0 1 0 1 0
Q1 0 0 1 1 0 0 1 1 0
Q2 0 0 0 0 1 1 1 1 0
Recycles back to 0
n
Asyn. Counters with MOD no. < 2
▪ States may be skipped resulting in a truncated sequence.
▪ Technique: force counter to recycle before going through all of the states in the
binary sequence.
▪ Example: Given the following circuit, determine the counting sequence (and hence
the modulus no.)
C B A
Q J Q J Q J
All J, K CLK CLK CLK
inputs Q K Q K Q K
CLR CLR CLR
are 1
(HIGH). B
C
n
Asyn. Counters with MOD no. < 2
• Example (cont’d):
C B A
Q J Q J Q J
All J, K CLK CLK CLK
inputs Q K Q K Q K
CLR CLR CLR
are 1
(HIGH). B
C
1 2 3 4 5 6 7 8 9 10 11 12 MOD-6 counter
Clock produced by
A clearing (a MOD-8
B binary counter)
C
when count of six
(110) occurs.
NAND 1
Output 0
n
Asyn. Counters with MOD no. < 2
• Example (cont’d): Counting sequence of circuit (in CBA order).
1 2 3 4 5 6 7 8 9 10 11 12
Clock
A
B
C
NAND 1
Output 0
111 000
Temporary 001
state
Counter is a MOD-6 counter.
110 010
101 011
100
n
Asyn. Counters with MOD no. < 2
• Exercise: How to construct an asynchronous MOD-5 counter? MOD-7 counter?
MOD-12 counter?
• Question: The following is a MOD-? counter?
F E D C B A
Q J Q J Q J Q J Q J Q J
Q K Q K Q K Q K Q K Q K
CLR CLR CLR CLR CLR CLR
C
D
E All J = K = 1.
F
n
Asyn. Counters with MOD no. < 2
• Decade counters (or BCD counters) are counters with 10 states (modulus-10) in
their sequence. They are commonly used in daily life (e.g.: utility meters,
odometers, etc.).
• Design an asynchronous decade counter.
(A.C)'
HIGH
D C B A
J Q J Q J Q J Q
CLK C C C C
K K K K
CLR CLR CLR CLR
n
Asyn. Counters with MOD no. < 2
• Asynchronous decade/BCD counter (cont’d).
HIGH D C B A
J Q J Q J Q J Q (A.C)'
CLK C C C C
K K K K
CLR CLR CLR CLR
1 2 3 4 5 6 7 8 9 10 11
Clock
D
C
B
A
NAND
output
Asynchronous Down Counters
• So far we are dealing with up counters. Down counters, on the other hand, count
downward from a maximum value to zero, and repeat.
• Example: A 3-bit binary (MOD-23) down counter.
1
Q0 Q1 Q2
J Q J Q J Q 3-bit binary
CLK C C C up counter
Q' K Q' K Q'
K
1
Q0 Q1 Q2
J Q J Q J Q 3-bit binary
CLK C C C down counter
Q' K Q' K Q'
K
Asynchronous Down Counters
• Example: A 3-bit binary (MOD-8) down counter.
000
001 111
1
Q0 Q1 Q2
J Q J Q J Q 010 110
CLK C C C
Q' K Q' K Q'
K
011 101
100
CLK 1 2 3 4 5 6 7 8
Q0 0 1 0 1 0 1 0 1 0
Q1 0 1 1 0 0 1 1 0 0
Q2 0 1 1 1 1 0 0 0 0
Cascading Asynchronous Counters
• Larger asynchronous (ripple) counter can be constructed by cascading smaller
ripple counters.
• Connect last-stage output of one counter to the clock input of next counter so as
to achieve higher-modulus operation.
• Example: A modulus-32 ripple counter constructed from a modulus-4 counter and
a modulus-8 counter.
Q0 Q1 Q2 Q3 Q4
J Q J Q J Q J Q J Q
CLK C C C C C
Q' K Q' Q' K Q' K Q'
K K
A0 A1 A2 A3 A4 A5
A5 A4 A3 A2 A1 A0
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 : : :
0 0 0 1 1 1
0 0 1 0 0 0
0 0 1 0 0 1
: : : : : :
Cascading Asynchronous Counters
• If counter is a not a binary counter, requires additional output.
• Example: A modulus-100 counter using two decade counters.
freq/10
1 CTENDecade CTENDecade freq/100
counter TC counter TC
CLK C Q3 Q2 Q1 Q0 C Q3 Q2 Q1 Q0
freq
A0 J A1
J Q Q
C C
Q' K Q'
K
CLK
Synchronous (Parallel) Counters Design
• Before studying the design of counters, it is important to understand the following
about FFs.
They are:
1. Truth Table
2. Characteristic Table
3. Excitation Table
JK Flipflop
Characteristic Table Excitation Table
• Truth Table
Clk J K 𝑸𝒏+𝟏 𝑸𝒏 J K 𝑸𝒏+𝟏 𝑸𝒏 𝑸𝒏+𝟏 J K
↓ X X 𝑸𝒏 0 0 0 0 0 0 0 X
↑ 0 0 𝑸𝒏 0 0 1 0 0 1 1 X
↑ 0 1 0 0 1 0 1 1 0 X 1
↑ 1 0 1 0 1 1 1 1 1 X 0
↑ 1 1 𝑸𝒏 1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
SR Flipflop
Characteristic Table Excitation Table
• Truth Table
Clk S R 𝑸𝒏+𝟏 𝑸𝒏 S R 𝑸𝒏+𝟏 𝑸𝒏 𝑸𝒏+𝟏 S R
↓ X X 𝑸𝒏 0 0 0 0 0 0 0 X
↑ 0 0 𝑸𝒏 0 0 1 0 0 1 1 0
↑ 0 1 0 0 1 0 1 1 0 0 1
↑ 1 0 1 0 1 1 1 1 1 X 0
↑ 1 1 Invalid 1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 Invali
d
T Flipflop
Characteristic Table Excitation Table
• Truth Table
Clk T 𝑸𝒏+𝟏 𝑸𝒏 T 𝑸𝒏+𝟏 𝑸𝒏 𝑸𝒏+𝟏 T
0 0 0 0 0 0
↓ X 𝑸𝒏
0 1 1
↑ 0 𝑸𝒏 0 1 1
1 0 1
↑ 1 𝑸𝒏 1 0 1
1 1 0
1 1 0
Design of Synchronous (Parallel) Counters:
Steps:
1. Decide the no. of FFs and the type of the flipflop as well
2. Excitation table of FF
3. State diagram and circuit excitation table
4. Obtain simplified equations using K-map
5. Draw the logic diagram
Practice Examples:
• Design a 2-bit synchronous Up-Counter using JK Flipflop
• Design a 3-bit synchronous down-counter using T-Flipflop
• Design a 2-bit synchronous Down-Counter using JK Flipflop
• Design a 3-bit synchronous Up-counter using T-Flipflop
Registers
Registers
• Group of storage elements read/written as a unit.
• Store related values (e.g. a binary word)
• Collection of flip-flops with common control
• Share clock, reset, set lines
• Example:
• Storage registers
• Shift registers
Storage Registers
• Basic storage registers uses flip flops
• Example: 4 bit storage register
IN D Q D Q D Q D Q
CLK
Shift-register applications
• Parallel-to-serial conversion for signal transmission
serial transmission
parallel outputs
CLK CLK
parallel inputs
OUT
IN D Q D Q D Q D Q
CLK
Shift-register Types
4-types:
1. Serial-In-Serial-Out
2. Serial-In-Parallel-Out
3. Parallel-In-Serial-Out
4. Parallel-In-Parallel-Out
Basic connections –
1. The first input (zeroth pin of multiplexer) is connected to the output pin of the corresponding flip-
flop.
2. The second input (first pin of multiplexer) is connected to the output of the very-previous flip flop
which facilitates the right shift.
3. The third input (second pin of multiplexer) is connected to the output of the very-next flip-flop
which facilitates the left shift.
4. The fourth input (third pin of multiplexer) is connected to the individual bits of the input data which
facilitates parallel loading.
Universal Shift Register
S1 S0 Register
Operation
0 0 No Changes
0 1 Shift Right
1 0 Shift Left
1 1 Parallel Load
Universal Shift Register- Applications
Advantages:
• This register can perform 3 operations such as shift-left, shift-right, and parallel loading.
• It can perform serial to parallel, parallel to serial, parallel to parallel and serial to serial
operations.
• It can perform input-output operations in both the modes serial and parallel.
• This register acts as an interface between one device to another device to transfer the data.
Applications:
• Used in Micro-Controllers for I/O expansion
• Used as a memory element in computers.
• Used in time delay applications
• Used as frequency counters, binary counters, and Digital clocks
Thank You