4Unit 4

Sequential Logic Circuits

12h

Class hours

6

Topics

0%

0/32 done

Progress0/32 topics

Why This Unit Matters

Memory-bearing circuits where outputs depend on current inputs AND past state — latches, flip-flops, registers, and state machines.

Why This Unit Matters

Unit 4 is where digital circuits gain memory and intelligence. Every computer, phone, and microcontroller relies on sequential logic — flip-flops store data in registers, state machines implement protocols and controllers, and shift registers move data in and out of processors. The JK flip-flop appears in TU BCA exams every single year, and state machine design is a guaranteed Group C (10-mark) question.

Unit Overview in Simple Words

1

Memory Elements

Latches and flip-flops — the hardware that remembers one bit of information.

2

Clocked Storage

Edge-triggered flip-flops — SR, D, JK, T — each with unique behavior.

3

Shift Registers

Four modes of shift registers — serial/parallel I/O for data movement.

4

State Machines

Moore and Mealy machines — designing circuits that respond to sequences.

Learning Outcomes

1Explain the concept of state, clock signal, and the difference between latch and flip-flop
2Describe all 4 triggering types: level, positive-edge, negative-edge, master-slave
3Draw and analyze SR latch (NOR and NAND), D latch with truth tables
4Write characteristic tables and equations for SR, D, JK, T flip-flops
5Write excitation tables for all four flip-flop types
6Explain the race-around condition and how Master-Slave JK solves it
7Perform flip-flop conversions (especially JK→D, D→JK) using K-maps
8Distinguish SISO, SIPO, PISO, PIPO registers and give applications
9Define Moore and Mealy machines; compare them in a table
10Design a sequential circuit using the 8-step procedure; solve sequence detector problems
⏱️

Teaching Hours

12 hours

📌

Topics

6 main topics

🎯

Exam Weight

~25% of paper

⚠️

Must Know

JK FF + FF Conversion + State Machine

Introduction to Sequential Logic

Definition

A sequential circuit is a digital circuit whose output depends not only on the present inputs but also on the past history of inputs (i.e., the current state). It has memory — it remembers what happened before.

Formula: Output = f(Present State, Input) and Next State = g(Present State, Input)

🧠

Has Memory

Stores the past state using flip-flops or latches. Output depends on history.

Clock-Driven

State changes happen at specific clock moments — synchronous circuits are predictable and reliable.

🔁

Feedback Present

The output feeds back as input — the 'next state' becomes the 'present state' on the next clock edge.

📊

State Machine

Every sequential circuit can be described as a finite state machine with states and transitions.

Sequential vs Combinational

FeatureCombinationalSequential
MemoryNo memoryHas memory (flip-flops)
Output depends onPresent inputs onlyPresent inputs + past state
Clock requiredNoUsually yes (synchronous)
FeedbackNo feedback pathsOutput fed back as state
State conceptNo statesHas finite number of states
ExamplesAdder, MUX, DecoderFlip-flop, Counter, Register
Analysis toolTruth Table / K-mapState Diagram / State Table

The Concept of State

A state is a snapshot of all memory in the circuit at a given moment. It summarizes the entire past history of inputs that is needed to predict future outputs.

State Terminology

Present State (PS): The current contents of all flip-flops. Written as Q.
Next State (NS): The state the circuit will move to on the next clock edge. Written as Q⁺ or Q(t+1).
Input: External signals that (together with PS) determine NS and output.
Output: In Moore: depends only on PS. In Mealy: depends on PS + input.
Transition: Moving from one state to another when input changes or clock ticks.

State Transition Flow

PresentStateSequentialCircuit(Memory + Logic)NextStateClockOutput

The Next State feeds back to become the Present State on each clock tick — this is what creates "memory."

Clock Signal

The clock is a periodic signal that alternates between 0 and 1. It controls when state changes happen in synchronous sequential circuits. Without a clock, circuits would race — outputs would change unpredictably.

Period (T)Time for one complete cycle (high + low)
Frequency (f)f = 1/T — clock cycles per second (Hz)
Duty Cycle% of time signal is HIGH. Ideal = 50%.
Rising EdgeTransition from LOW (0) to HIGH (1). Also called positive edge.
Falling EdgeTransition from HIGH (1) to LOW (0). Also called negative edge.

Clock Waveform

HIGHLOW10
Rising edge Falling edge

Triggering and Its Types

Triggering determines exactly when a flip-flop or latch responds to its inputs and changes state. Different triggering methods affect timing, race conditions, and circuit design.

═══Level Triggering (Latch)

Active whenever the enable/clock is at a fixed level (HIGH or LOW). A HIGH level-triggered latch is transparent when clock=1 — changes in input immediately change output. Problem: multiple state changes can occur in one clock cycle (timing hazards).

Positive Edge Triggering

Flip-flop captures input and updates output ONLY on the rising edge (0→1 transition) of the clock. All other times, input changes are ignored. Most common for synchronous design. Clear and predictable.

Negative Edge Triggering

Flip-flop captures input and updates output ONLY on the falling edge (1→0 transition) of the clock. Denoted with a small bubble or ▽ on clock input in logic diagrams. Used when falling-edge timing is more convenient.

↑↓Pulse / Master-Slave Triggering

A two-stage FF: master captures input on rising edge (clock=1), slave transfers to output on falling edge (clock=0). Eliminates 1s-catching problem of simple edge triggering. Used in the classic Master-Slave JK flip-flop.

Trigger TypeActive WhenLatch or FFProblem
Level HIGHClock = 1LatchMultiple transitions per cycle
Level LOWClock = 0LatchMultiple transitions per cycle
Positive Edge0 → 1 transitionFlip-FlopNone (most common)
Negative Edge1 → 0 transitionFlip-FlopNone
Pulse (Master-Slave)Entire HIGH pulseFlip-Flop1s-catching in SR type

Synchronous vs Asynchronous Sequential Circuits

Synchronous

  • All flip-flops share a common clock signal
  • State changes only at clock edges
  • Easier to design and analyze
  • Timing is predictable — no race conditions
  • Almost all modern digital systems are synchronous
  • Example: Registers, synchronous counters

Asynchronous

  • No common clock — state changes when inputs change
  • Faster (no clock delay), but harder to design
  • Prone to race conditions and hazards
  • Each FF may have different propagation delays
  • Example: Ripple counters, SR latches

Latches & Flip-Flops

SR Latch

The SR Latch (Set-Reset Latch) is the fundamental memory element. It stores 1 bit and has two stable states. Built from two cross-coupled gates (NOR or NAND). It is level-sensitive — it responds whenever its inputs change (no clock).

SR Latch (NOR Gate Implementation)
Fig 4.1Two cross-coupled NOR gates with feedback paths

S = 1, R = 0 → Q = 1 (Set)

S = 0, R = 1 → Q = 0 (Reset)

S = 0, R = 0 → Q unchanged (Remember)

S = 1, R = 1 → Both outputs = 0 (INVALID — forbidden state)

SRQ (next)Action
00Q (no change)Hold / Remember
010Reset
101Set
11Invalid⚠ Forbidden

NOR-based SR Latch. Both Q and Q' become 0 when S=R=1 (violates complement rule).

D Latch (Transparent Latch)

The D Latch eliminates the forbidden state of the SR latch by tying R = S' (complement of S). It has one data input D and one enable input E (or EN). Called "transparent" because when E = 1, Q follows D immediately.

E (Enable)DQ (next)Action
0XQ (no change)Latch closed — stores value
100Q follows D = 0
111Q follows D = 1

X = don't care. D latch has no forbidden state — much safer than SR.

Boolean Expression

Q⁺ = D (when E = 1)  |  Q⁺ = Q (when E = 0)

Why use it: The D latch is the building block for registers and memory cells. When E = 0, it stores its value indefinitely (until E goes high again).

Problem: If the enable stays high for a long time and D changes multiple times, all changes propagate through — not always desirable. Solution: use edge-triggered D flip-flop.

Latch vs Flip-Flop

FeatureLatchFlip-Flop
TriggeringLevel-sensitive (EN signal)Edge-triggered (clock edge)
When it changesWhenever enable is activeOnly at clock edge
Clock neededNo (has enable instead)Yes
SpeedFaster (propagates instantly)Controlled by clock
Hazard riskHigher (glitches propagate)Lower (captured at edge)
Use in sync designAvoid in synchronous systemsStandard element
Common typesSR Latch, D LatchSR, D, JK, T flip-flops
SymbolTriangle or EN pinTriangle with clock triangle
Memory trick: A latch is like an open door — whenever the enable is active, everything walks through. A flip-flop is like a revolving door — only one person (value) enters at each clock tick.

SR Flip-Flop

An SR flip-flop behaves like an SR latch but with edge-triggered input. It captures S and R only at the active clock edge and ignores changes at other times.

SRQ⁺ (next state)Operation
00QNo change (hold)
010Reset
101Set
11?Undefined (forbidden)

Characteristic table: given present S, R, what is next Q?

Characteristic Equation

Q⁺ = S + R'Q   (SR = 0 constraint)

Excitation Table

Q (present)Q⁺ (next)SR
000X
0110
1001
11X0

X = don't care (either 0 or 1 gives same result)

The excitation table asks: "What inputs do I need to achieve a desired state transition?" This is the reverse of the characteristic table — used in sequential circuit design.

D Flip-Flop (Data / Delay)

The D flip-flop is the most widely used FF in digital systems. It has a single data input D. On each clock edge, Q captures whatever D was. It effectively delays D by one clock cycle.

DQ⁺ (next state)Operation
00Reset
11Set

Simplest characteristic table — Q just follows D with one clock delay.

Characteristic Equation

Q⁺ = D

Uses:

  • Shift registers (D FF chains)
  • Pipeline registers in CPUs
  • Bounce elimination (for switch inputs)
  • Data synchronization between clock domains
D Flip-Flop Gate-Level Circuit
Fig 4.3NOT + 2 NAND (input stage) + 2 NAND (cross-coupled SR latch). CLK gates D into storage.

JK Flip-Flop ⭐ (Most Important)

TU BCA Exam Alert: JK flip-flop is the most frequently asked flip-flop. Know the characteristic table, equation, and toggle condition by heart.

The JK flip-flop improves on SR by eliminating the forbidden state. When J = K = 1, instead of being undefined, the output toggles (Q becomes Q'). J stands for "Jump" (Set) and K stands for "Kill" (Reset).

JKQ⁺ (next state)Operation
00QNo change
010Reset (Kill)
101Set (Jump)
11Q'Toggle ← key feature

No forbidden state — J=K=1 gives toggle, not undefined output.

Characteristic Equation

Q⁺ = JQ' + K'Q

Excitation Table

Q (present)Q⁺ (next)JK
000X
011X
10X1
11X0

X = don't care. JK has the most X entries → easiest K-map minimization

JK has the most X (don't care) entries → simplest K-map minimization → preferred in sequential circuit design problems.

JK Flip-Flop Logic Symbol
Fig 4.4Standard IC symbol — J (set), K (reset), CLK (triangle = edge-triggered), Q and Q̄ outputs

T Flip-Flop (Toggle)

The T flip-flop is a simplified JK with J and K tied together. When T = 0, hold. When T = 1, toggle. Essential for counter design.

TQ⁺ (next state)Operation
0QHold (no change)
1Q'Toggle

Derived from JK by connecting J = K = T.

Characteristic Equation

Q⁺ = T ⊕ Q   (XOR)

Derived from JK with J=K=T

Q⁺ = TQ' + T'Q = T ⊕ Q

Counters: A chain of T FFs with T=1 forms a ripple counter. Each FF divides the frequency by 2 — the LSB toggles every clock, MSB changes slowest.

Master-Slave JK Flip-Flop

The Master-Slave JK consists of two latches in series. The master captures input during clock HIGH; the slave transfers to output during clock LOW. This ensures the output changes only once per clock cycle, fixing the race-around problem.

Master-Slave JK Flip-Flop Block Diagram
Fig 4.5Two SR latches in series — Master captures on CLK HIGH, Slave transfers on CLK LOW (via inverter)

Operation Sequence

CLK = 1 (Master active)

Master JK latch captures J, K inputs. Output of master changes. Slave is disabled (CLK=0 for slave because of inverter).

CLK ↓ (Falling edge)

Master gets disabled. Slave gets enabled. Slave's output (Q, Q') changes to match master's stored value.

CLK = 0 (Slave active)

Slave holds the value captured at falling edge. Master is isolated — J,K changes don't affect anything.

Key insight: The output changes on the falling edge of the clock. Master-Slave JK is a negative-edge triggered flip-flop in its effective behavior.

Flip-Flop Comparison Summary

FF TypeInputsChar. EquationToggle?Forbidden?Best Use
SRS, RS + R'QNoYes (SR=11)Simple set/reset control
DDDNoNoRegisters, pipelines
JKJ, KJQ' + K'QYes (J=K=1)NoGeneral purpose, design problems
TTT ⊕ QAlways (T=1)NoCounters, frequency dividers
⏱️

Interactive Flip-Flop Simulator

Set inputs and pulse the clock to observe state changes.

sr FF
S
R
Q
Q'

1. Set Inputs

S (Set)
R (Reset)

2. Current State Q(t)

0

Transition History

No clock pulses yet. Pulse the clock to see transitions.

Excitation Tables

Excitation tables are the key to designing sequential circuits. They tell you: "What inputs do I need to move from Q to Q+?"

Q (present)Q⁺ (next)JK
000X
011X
10X1
11X0

X = don't care. JK has the most X entries → easiest K-map minimization

Flip-Flop Conversions

What is FF Conversion?

Sometimes you have one type of flip-flop available but need to implement another type's behavior. FF conversion means designing combinational logic circuits to place between the available FF's inputs and the desired FF's inputs, so that the available FF behaves exactly like the target FF.

Standard 5-Step Conversion Procedure

1

Write the characteristic table of the target (desired) FF

List all combinations of current state Q and desired next state Q⁺. This defines what transitions we need to achieve.

2

Write the excitation table of the available (given) FF

For each (Q → Q⁺) transition, look up what inputs the available FF needs. Fill in the required inputs (use don't cares X where applicable).

3

Form the combined conversion table

Merge: columns = [current inputs of target FF, Q, Q⁺, required inputs of available FF]. Each row represents one truth table entry.

4

Draw K-maps for each input of the available FF

Variables: inputs of target FF + current state Q. Minimize each K-map to get the Boolean expression.

5

Implement the resulting expressions with gates

Connect the gate circuit's outputs to the available FF's inputs. The available FF now behaves like the target FF.

Convert JK Flip-Flop to D Flip-Flop

We have a JK FF and want it to behave as a D FF. We need to find: J = f(D, Q) and K = f(D, Q).

JK to D Conversion Procedure1/5
Step 1: Write D FF characteristic table

The target FF is D. Its behavior: Q+ = D. List all (D, Q) to (Q+) mappings: D=0,Q=0 gives Q+=0; D=0,Q=1 gives Q+=0; D=1,Q=0 gives Q+=1; D=1,Q=1 gives Q+=1.

D (target input)Q (present)Q⁺ (next)J (required)K (required)
0000X
010X1
1011X
111X0

Q⁺ = D (target). J,K from JK excitation table for each Q→Q⁺ transition.

K-maps for JK to D Conversion
Fig 4.2Minimize J and K as functions of D and Q

Result

J input circuit

J = D

K input circuit

K = D' (NOT gate on D)

Connect D directly to J, and D through a NOT gate to K. When D=0: J=0, K=1 → Reset (Q→0). When D=1: J=1, K=0 → Set (Q→1). JK now behaves exactly like D FF.

Registers

Definition

A register is a group of flip-flops used to store a multi-bit binary number. An n-bit register consists of n flip-flops and can store n bits simultaneously. Registers are the basic storage elements inside a CPU — the "registers" in assembly language (AX, BX, etc.) are hardware shift registers made of D flip-flops.

SISO

Serial In Serial Out

▶▶

Data enters one bit at a time from one end and exits one bit at a time from the other. Simplest shift register. Acts as a delay line — introduces n-clock-cycle delay.

In: SerialOut: Serial
SIPO

Serial In Parallel Out

▶⊞

Data enters bit by bit, all n bits available simultaneously at output after n clock cycles. Used in serial-to-parallel conversion (e.g., receiving serial data from UART).

In: SerialOut: Parallel
PISO

Parallel In Serial Out

⊞▶

All n bits loaded simultaneously (parallel load), then shifted out one bit at a time per clock. Used in parallel-to-serial conversion (e.g., transmitting parallel data serially).

In: ParallelOut: Serial
PIPO

Parallel In Parallel Out

⊞⊞

All n bits loaded simultaneously, all n bits available simultaneously at output. Fastest mode — one clock cycle for load and read. Used as CPU accumulators.

In: ParallelOut: Parallel

SISO — Serial In, Serial Out

InD-FF1CLKD-FF0D-FF1D-FF1OutSISO — 4-bit Shift Register

Each D flip-flop passes its output to the next FF's input. On each clock edge, every bit shifts right by one position.

Example: Load 1011 serially (MSB first), read serially after 4 clocks.

Start0000CLK1 (in=1)
CLK11000CLK2 (in=0)
CLK20100CLK3 (in=1)
CLK31010CLK4 (in=1)
CLK41101All bits shifted in

Operation

D₀ (first FF):Receives serial input each clock
D₁:Q₀ output of FF₀
D₂:Q₁ output of FF₁
D₃ (last FF):Q₂ output of FF₂
Serial Output:Q₃ — the rightmost FF output

SISO function

Serial delay line: n clock cycles to pass through n-bit data

SIPO — Serial In, Parallel Out

Same hardware as SISO — the only difference is that outputs of all flip-flops are connected to external wires. After clocking in n bits, all bits are available simultaneously as Q₀, Q₁, Q₂, Q₃.

Serial → Parallel conversion example

Input serial data: 1 → 1 → 0 → 1 (4 clock cycles, MSB first)

CLK1Q=[1,0,0,0]
CLK2Q=[1,1,0,0]
CLK3Q=[0,1,1,0]
CLK4Q=[1,0,1,1]

After CLK4, parallel outputs: Q₀=1, Q₁=1, Q₂=0, Q₃=1 → reads 1101

Applications

  • UART (Universal Async Receiver Transmitter) — serial data → parallel bus
  • SPI/I2C interfaces — receiving serial sensor data
  • Barcode scanner input decoding
  • RS-232 serial communication → parallel computer bus

PISO — Parallel In, Serial Out

PISO has two modes: load mode (parallel data loaded in one clock cycle) and shift mode (data shifted out one bit per clock cycle). A mode-select signal (LOAD/SHIFT) controls which operation occurs.

PISO operation sequence

Step 1:Apply parallel input data to D₀, D₁, D₂, D₃
Step 2:Set LOAD = 1, pulse clock once → all 4 bits loaded into FFs simultaneously
Step 3:Set LOAD = 0 (shift mode). Each clock, LSB exits from serial output
Step 4:After 4 clock pulses, all 4 bits have exited serially

Application: Parallel-to-serial conversion for transmission over single wire (USB, Ethernet frame building).

PIPO — Parallel In, Parallel Out

The fastest register — all bits loaded and read in a single clock cycle. Used in CPU accumulators, temporary storage registers, and buffers in digital systems.

How it works

  • All D inputs connected to parallel data lines
  • Single clock edge loads all bits simultaneously
  • All Q outputs available simultaneously
  • No shifting — pure storage register
  • Can include synchronous clear/reset

Uses in real systems

  • CPU general-purpose registers (AX, BX, SP)
  • Instruction register (holds current instruction)
  • Memory Address Register (MAR)
  • Memory Buffer Register (MBR)
  • Program Counter (PC) — actually a PIPO with increment logic

Bidirectional Shift Register

A bidirectional shift register can shift data both left and right, controlled by a direction select bit. Uses 2:1 multiplexers at each FF input to choose between left-shift and right-shift data paths.

Operation modes

S₁S₀ModeDescription
00HoldNo change — present state maintained
01Shift RightData shifts right; serial input enters from left
10Shift LeftData shifts left; serial input enters from right
11Parallel LoadAll bits loaded simultaneously from parallel inputs

Application: Arithmetic shift operations (multiply/divide by 2), serial communication that must handle both directions, and universal shift register ICs (e.g., 74194).

🧮

Interactive 4-Bit Shift Register

Apply clock pulses to see data shift through the registers.

Serial In
Out
0
Serial Out
0
FF0
0
FF1
0
FF2
0
FF3

Register Types — Summary Table

TypeInputOutputClocks to LoadClocks to ReadSpeedApplication
SISOSerialSerialnnSlowDelay line
SIPOSerialParalleln1MediumSerial → Parallel
PISOParallelSerial1nMediumParallel → Serial
PIPOParallelParallel11FastCPU registers
BidirectionalParallel/SerialParallel/Serial1 or n1 or nFlexibleArithmetic shift

State Machines (Moore & Mealy)

🔵

Moore Machine

Output depends only on present state

Named after Edward F. Moore. The output is a function of the current state only. Output is labeled inside each state circle in the state diagram.

Output equation

Z = f(Q) — state only

  • Output changes only at clock edges (stable output)
  • Generally requires more states than Mealy
  • Easier to analyze and debug
  • Output labeled: state circle shows "State / Output"
🟣

Mealy Machine

Output depends on state AND current input

Named after George H. Mealy. The output is a function of both the current state and the input. Output is labeled on the transition arc in the state diagram.

Output equation

Z = f(Q, X) — state + input

  • Output can change immediately when input changes (reactive)
  • Fewer states needed than Moore for same function
  • Output labeled on arc: "Input / Output"
  • Potential glitches if input is noisy
Moore Machine State Diagram
Fig 4.5Output labeled inside state circles -- depends only on present state
Mealy Machine State Diagram
Fig 4.6Output labeled on transition arcs as Input/Output
🔄

Interactive Sequence Detector

Moore Machine detecting "101" (Overlapping).

Input:
-
Output:
10101001 (overlap)
S0/0
Got Nothing
S1/0
Got "1"
S2/0
Got "10"
S3/1
Got "101"
FeatureMooreMealy
Output depends onPresent state onlyPresent state + input
Output labeled in diagramInside state circlesOn transition arcs
Number of statesMore states neededFewer states needed
Output timingChanges at clock edgeCan change anytime (async)
Glitch riskLow (synchronized)Higher (input-dependent)
Synchronous outputYesNot guaranteed
Preferred whenOutput stability neededFewer states is priority

State Table

A state table (also called transition table) is the tabular form of the state diagram. It lists every combination of present state and input, showing the next state and output.

Moore Machine State Table (Detect single 1)

Present StateInput X=0Input X=1Output Z
S0S0S10
S1S0S11

Output Z is listed as a separate column — depends only on state.

Mealy Machine State Table (Detect consecutive 1s)

Present StateX=0 (NS/Z)X=1 (NS/Z)
S0S0 / 0S1 / 0
S1S0 / 0S1 / 1

Output is shown with NS: "Next State / Output". Z=1 when consecutive 1 detected.

State Reduction Technique

State reduction minimizes the number of states in a state machine without changing its input-output behavior. Fewer states → fewer flip-flops → simpler circuit.

Method: Equivalent State Identification

Two states Si and Sj are equivalent if and only if:

Condition 1:They produce the same output for every possible input combination.
Condition 2:For every possible input, their next states are also equivalent (or identical).

If both conditions hold, merge the equivalent states — replace all occurrences of one with the other. Repeat until no further reduction is possible.

State Reduction — Step Through

Step 1 of 4

Original State Table (with redundant states)

We have 4 states. Check for states with identical next-state and output behavior.

StateInput=0 (NS, Out)Input=1 (NS, Out)
S0S0, 0S1, 0
S1S0, 0S2, 0
S2S0, 0S1, 0
S3S0, 0S2, 0

Sequential Circuit Design Procedure

1

Understand the problem

Identify the number of inputs, outputs, and describe the behavior for every input sequence. Determine Moore or Mealy.

2

Draw state diagram

Create circles (states) and directed arcs (transitions with input/output labels). Start from the initial state.

3

Reduce states (optional)

Apply state equivalence reduction to minimize the number of states.

4

State assignment

Assign binary codes to each state. For n states, need ⌈log₂n⌉ flip-flops. Choose state codes to minimize combinational logic.

5

Write the state table

Fill in present state (PS), input (X), next state (NS), and output (Z) for all combinations.

6

Choose flip-flop type

Select FF type (usually JK or D). Write the excitation table for the chosen FF.

7

Derive FF input equations

For each FF input, use K-map with variables (state bits + inputs) to find minimized Boolean expressions.

8

Implement the circuit

Draw the combinational logic (from input equations) feeding the FF inputs. Add output logic. Verify with timing simulation.

Worked Example: "11" Sequence Detector

Problem: Design a Moore machine that outputs Z=1 whenever the last two consecutive inputs were "11" (two 1s in a row). Input: X (1 bit). Output: Z (1 bit).

We need to remember how many consecutive 1s we've seen. Three states suffice:

S0 (Z=0):Initial state. Last input was 0 (or no input yet).
S1 (Z=0):Seen exactly one consecutive 1. Waiting for second.
S2 (Z=1):Seen two consecutive 1s — pattern detected! Z=1.

Transitions:

S0 + X=0 → S0 (stay, saw 0)

S0 + X=1 → S1 (one 1 seen)

S1 + X=0 → S0 (streak broken)

S1 + X=1 → S2 (two consecutive 1s!)

S2 + X=0 → S0 (streak broken)

S2 + X=1 → S2 (still in ≥2 consecutive 1s)

Design Procedure: '11' Sequence Detector (Moore)1/5
Step 1: Define states

S0 (Z=0): no consecutive 1s seen. S1 (Z=0): one 1 seen. S2 (Z=1): two consecutive 1s detected. Three states need 2 flip-flops (ceil(log2(3)) = 2).

Sequence Detector Demo

Enter bits one at a time. Output = 1 when pattern detected.

No input yet

Practice & Self-Assessment

Quick Recall

Try to answer from memory. Click to reveal.

TU BCA Exam-Style Questions

6 marks

Draw and explain the JK Master-Slave flip-flop. How does it solve the race-around condition?

5 marks

Convert a JK flip-flop to behave as a D flip-flop. Show the K-map and derivation.

8 marks

Design a sequence detector for the pattern '101' using a Moore machine.

5 marks

What are the types of shift registers? Explain PISO with a diagram and operation table.

4 marks

Differentiate between synchronous and asynchronous sequential circuits.

Mini-Test (8 Questions)

Test yourself! All questions to submit.

Q1.Which flip-flop eliminates the forbidden state of SR by allowing toggle?

Q2.The characteristic equation of a JK flip-flop is:

Q3.In a D flip-flop, what is Q⁺ (next state)?

Q4.A Master-Slave JK flip-flop changes its output on:

Q5.The race-around condition occurs in JK flip-flop when:

Q6.Which register type performs serial-to-parallel conversion?

Q7.In a Moore machine, the output depends on:

Q8.To convert JK to T flip-flop, the connections are:

Answer all questions to submit

How to Remember Unit 4

Memory Tricks for Unit 4

🔑

FF Names — What the Letters Mean

SR = Set/Reset. D = Data (or Delay — it delays by 1 clock). J = Jump (like Set), K = Kill (like Reset). T = Toggle (flips every time T=1).

S→Set Q=1, R→Reset Q=0, D→Directly sets Q=D, J→Jump to 1, K→Kill to 0, T→Toggle

JK Characteristic: NCRT

When J=K: NC (No Change if 00), Reset (01), Toggle... wait no. Order: No Change, Kill, Jump, Toggle. Think 'No Change – Reset – Set – Toggle' for JK=00,01,10,11.

JK: 00→NC, 01→Reset, 10→Set, 11→Toggle
🔄

D FF: Simplest of all

D flip-flop is so simple: Q⁺ = D. Period. No other variables. It just copies D on the clock edge. 'D' stands for Data — it stores whatever data you give it.

Q⁺ = D (one line!)

T FF: Think XOR

T flip-flop equation is Q⁺ = T XOR Q. Remember: XOR means 'different = 1'. When T=1, Q⁺ is different from Q (it toggles). When T=0, Q⁺ same as Q (no change).

Q⁺ = T ⊕ Q: T=0→same, T=1→flip
🎯

Excitation Table X Entries Rule

More X entries = less hardware needed in K-maps. JK has MOST X entries → best for design problems. SR has X entries but also a forbidden state. D and T have NO X entries — deterministic.

JK excitation: 0→0: J=0,K=X; 0→1: J=1,K=X; 1→0: J=X,K=1; 1→1: J=X,K=0
🔀

Register SIPO vs PISO: Serial in/out is SLOW

SIPO: Serial enters (slow), Parallel exits (fast, all at once). PISO: Parallel enters (fast), Serial exits (slow). When SERIAL is the INPUT, you wait n clocks to load. When SERIAL is the OUTPUT, you need n clocks to read all bits.

SIPO = n clocks IN, 1 clock OUT | PISO = 1 clock IN, n clocks OUT
🎭

Moore vs Mealy: WHERE is the output?

MoORe = Output in the ciRcle (state). MeaLy = output on the Line (arc/transition). Mealy has fewer states because one state can give multiple outputs. Moore is more stable (output only changes with state).

Moore: circle → output inside | Mealy: arrow → output on label
🔁

Master-Slave: Master TAKES, Slave GIVES

Master takes/captures input during CLK=1 (master is active, slave is locked). Slave gives/shows output during CLK=0 (slave is active, master is locked). Output only appears when clock falls.

CLK↑ → Master captures J,K | CLK↓ → Slave releases to Q

Flip-Flop Master Cheat Sheet

FFInputsQ⁺ (char. eq)Excitation key ruleForbidden?Toggle?Best for
SRS, RS + R'Q0→0: S=0,R=X; 0→1: S=1,R=0; 1→0: S=0,R=1; 1→1: S=X,R=0⚠ YesBasic. Avoid SR=11
DDDD = Q⁺ (always equal)✓ NoSimplest. Registers
JKJ, KJQ' + K'QMost X entries → easy K-maps✓ No✓ YesGeneral purpose. Best for design
TTT ⊕ QT = Q ⊕ Q⁺ (T=1 when change needed)✓ No✓ YesCounters. Derived from JK

FF Conversion Quick Reference

JKD1 NOT gate

J = D, K = D'

JKTJust connect T to both

J = T, K = T

JKSRDirect mapping

J = S, K = R

DJK2 ANDs + 1 OR

D = JQ' + K'Q

DT1 XOR gate

D = T ⊕ Q

TJK2 ANDs + 1 OR

T = JQ' + KQ

SRD1 NOT gate

S = D, R = D'

TD1 XOR gate

T = D ⊕ Q

Register Types — Remember This Grid

PARALLEL OUT
SERIAL OUT
PARALLEL IN

PIPO

Fastest: 1 CLK in, 1 CLK out

CPU registers

PISO

Load 1 CLK, output n CLKs

Parallel→Serial

SERIAL IN

SIPO

Input n CLKs, output 1 CLK

Serial→Parallel

SISO

Slowest: n CLKs in, n CLKs out

Delay line

Memory anchor: First letter = INPUT type (P=Parallel, S=Serial), second letter = OUTPUT type. PIPO has the most P's → most parallel → fastest. SISO has the most S's → all serial → slowest.

Quick Revision by Section

Exam Checklist — Unit 4

1Define sequential circuit and explain the concept of state
2Explain synchronous vs asynchronous sequential circuits
3Describe all 4 triggering types with their differences
4Draw and explain SR Latch (NOR-based) — truth table, forbidden state
5Draw and explain D Latch — truth table, operation, why it's "transparent"
6Compare Latch vs Flip-Flop in a table
7Write characteristic tables AND equations for SR, D, JK, T flip-flops
8Write excitation tables for SR, D, JK, T flip-flops
9Explain the JK toggle condition and race-around problem
10Draw and explain Master-Slave JK FF — how it solves race-around
11Perform any FF conversion (especially JK→D, D→JK) using K-maps
12Explain all 4 register types (SISO, SIPO, PISO, PIPO) with examples
13Explain bidirectional shift register operation modes
14Define Moore and Mealy machines — compare in a table
15Draw a state diagram and construct a state table
16Apply state reduction to minimize number of states
17Describe the sequential circuit design procedure (all 8 steps)
18Design a "11" sequence detector using Moore machine
TU BCA Most-Asked: JK flip-flop (every year), FF conversion (JK→D is most common), Master-Slave JK, and sequence detector design. Know the JK characteristic equation cold: Q⁺ = JQ' + K'Q.
BCAStudyHub

Your complete interactive study guide for TU BCA Semester I — covering all subjects with interactive tools, past papers, and exam prep.

TU BCASemester I

Program Info

University
Tribhuvan University
Program
BCA — Bachelor in Computer Application
Semester
I (First)
Subjects
5 (4 live, 1 coming soon)

Made by SawnN