Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 2 — JK and T Flip-Flops, and the Race Around Condition

Lesson 22 of 49 in the free Computer Organization and Architecture notes on Siksha Sarovar, written by Rohit Jangra.

JK Flip-Flop

The JK flip-flop is the SR flip-flop with the forbidden state turned into a useful one: J = K = 1 makes the output toggle.

   Built from SR:   S = J . Q'        R = K . Q

   When J = K = 1:
      if Q = 0  ->  S = 1.1 = 1, R = 1.0 = 0  ->  SET   (Q becomes 1)
      if Q = 1  ->  S = 1.0 = 0, R = 1.1 = 1  ->  RESET (Q becomes 0)

   The feedback from Q and Q' guarantees S and R are never both 1.

Characteristic table

CLKJKQ(n+1)Operation
00Q(n)No change
010Reset
101Set
11Q(n)'Toggle

Characteristic equation

   Q(n+1) = J.Q' + K'.Q

   Derivation by K-map:
              J K
         00     01     11     10
       +------+------+------+------+
  Q=0  |  0   |  0   |  1   |  1   |
       +------+------+------+------+
  Q=1  |  1   |  0   |  0   |  1   |
       +------+------+------+------+

   Group (Q=0, J=1) -> J.Q'
   Group (Q=1, K=0) -> K'.Q
   Q(n+1) = J.Q' + K'.Q     ✓

Excitation table

Q(n) → Q(n+1)JK
0 → 00X
0 → 11X
1 → 0X1
1 → 1X0
Why JK is preferred for counter design: its excitation table has an X in every row, which produces the simplest K-maps and hence the fewest gates.

State diagram

The Race Around Condition

This is one of the most frequently asked questions in COA papers.

   Setup: a LEVEL-TRIGGERED (not edge-triggered) JK flip-flop,
          with J = K = 1, and a clock pulse of width t(p).
          Flip-flop propagation delay = t(pd).

   While CLK = 1 the flip-flop is transparent, so:

      t = 0        Q = 0
      t = t(pd)    Q toggles to 1
      t = 2.t(pd)  Q toggles to 0        <- because J=K=1 is STILL applied
      t = 3.t(pd)  Q toggles to 1
      ...

   The output oscillates for as long as the clock stays high.
   Number of toggles during one clock pulse  =  t(p) / t(pd)

   When the clock finally falls, the final state is whichever value the
   oscillation happened to land on — UNPREDICTABLE.
Definition to write in the exam: The race around condition occurs in a level-triggered JK flip-flop when J = K = 1 and the clock pulse width is greater than the propagation delay of the flip-flop. The output toggles repeatedly during the clock pulse, making the final state indeterminate.

The three cures

SolutionHow it worksPracticality
1. Narrow clock pulse: make t(p) < t(pd)Only one toggle can completeImpractical — needs an extremely narrow, precisely controlled pulse
2. Master-slave flip-flopTwo latches in series; the slave updates only after the master is isolatedStandard solution (next lesson)
3. Edge triggeringThe flip-flop is sensitive only at the instant of the edge, so the loop never closesStandard in modern design

T Flip-Flop (Toggle Flip-Flop)

Tie J and K together: T = J = K.

Characteristic table

CLKTQ(n+1)Operation
0Q(n)Hold
1Q(n)'Toggle
   Characteristic equation:

      Q(n+1) = T.Q' + T'.Q  =  T ⊕ Q

Excitation table

Q(n) → Q(n+1)T
0 → 00
0 → 11
1 → 01
1 → 10

(Simple rule: T = 1 when the state must change, i.e. T = Q(n) ⊕ Q(n+1).)

The T flip-flop as a frequency divider

   With T tied permanently to 1, the output toggles on every clock edge:

   CLK :  _|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_
   Q   :  ___|‾‾‾‾‾|_____|‾‾‾‾‾|____

   f(Q) = f(CLK) / 2

   Cascade n T flip-flops (Q of one clocking the next):
      f(out) = f(CLK) / 2^n      <- this IS a ripple counter.

Complete Flip-Flop Comparison Table

Flip-flopInputsCharacteristic equationInvalid stateMain use
SRS, RQ(n+1) = S + R'QS = R = 1Basic memory cell
DDQ(n+1) = DNoneRegisters, pipelines
JKJ, KQ(n+1) = JQ' + K'QNone (toggles)Counters, general sequential design
TTQ(n+1) = T ⊕ QNoneFrequency division, binary counters

Complete Excitation Table (memorise this — every counter design needs it)

Q(n) → Q(n+1)S RJ KDT
0 → 00 X0 X00
0 → 11 01 X11
1 → 00 1X 101
1 → 1X 0X 010

The next lesson builds the master-slave structure that makes JK flip-flops safe to use.