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%

Registers, Counters, Latches and The Master-Slave Flip-Flop

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

4-Bit Serial-In Serial-Out (SISO) Shift Register

---

SR Latch (NAND-Based)

S (active-low)R (active-low)QQ'
0110(Set)
1001(Reset)
11QQ'(Hold)
0011Forbidden

The NAND-based SR latch uses active-LOW inputs (inputs are inverted). Forbidden state: both S and R = 0 (both outputs = 1 simultaneously).

---

Register Types

TypeFull NameDescriptionUse Case
SISOSerial-In, Serial-Out1-bit in/out per clock; data shifts throughSerial communication, delay lines
SIPOSerial-In, Parallel-Out1-bit in per clock; all bits out simultaneouslySerial-to-parallel conversion
PISOParallel-In, Serial-OutAll bits loaded; 1-bit out per clockParallel-to-serial conversion
PIPOParallel-In, Parallel-OutAll bits in/out simultaneouslyCPU registers, buffer

---

Shift Register Arithmetic Property

  • Left shift by 1 = multiply by 2 (shift contents left, fill LSB with 0)
  • Right shift by 1 = divide by 2 (shift contents right, fill MSB with 0 for unsigned)
  • Example: 0101 (5) left-shift → 1010 (10) ✓
  • Example: 1010 (10) right-shift → 0101 (5) ✓

This is exploited by compilers for fast multiply/divide by powers of 2.

---

2-Bit Ripple Counter State Diagram

---

Ripple (Asynchronous) vs Synchronous Counter

FeatureRipple (Asynchronous)Synchronous
ClockOnly LSB FF clocked by system clockAll FFs clocked simultaneously
SpeedSlower — carry ripples through all FFsFaster — no ripple delay
GlitchesYes — intermediate invalid states during transitionNo — all FFs change together
HardwareSimple — each FF output drives next FF clockComplex — requires combinational logic
Max frequencyLimited by cumulative delayHigher frequency possible

---

Modulo-N Counter Summary

CounterFlip-Flops NeededCount SequenceApplication
MOD-210,1,0,1,...Divide-by-2, clock divider
MOD-420,1,2,3,0,...2-bit counter
MOD-830–7, repeat3-bit counter, octal
MOD-10 (BCD)4 (with reset at 10)0–9, repeatDecimal counter, clock
MOD-1640–15, repeatHex counter, 4-bit

For MOD-N: need ⌈log₂N⌉ flip-flops.

---

Ring Counter vs Johnson Counter (4-bit)

FeatureRing CounterJohnson Counter (Twisted Ring)
Bit pattern1000, 0100, 0010, 00010000, 1000, 1100, 1110, 1111, 0111, 0011, 0001
StatesN states for N flip-flops2N states for N flip-flops
DecodingSimple — no extra logicRequires 2-input AND gates
Self-correctingNoNo
ApplicationSequence generator, timingFrequency divider, control sequence

---

Master-Slave JK Flip-Flop

The master-slave configuration consists of:

  1. Master FF: Positive-level triggered; samples J and K when CLK=1
  2. Slave FF: Negative-level triggered; transfers master output to slave when CLK=0

This ensures the output changes only once per clock cycle on the falling edge, eliminating the race-around condition. Modern edge-triggered FFs (using transmission gates) provide the same result in fewer transistors.

📝 Exam Tips: - SISO: data enters and exits serially — useful for serial communications - n-bit ripple counter needs n T flip-flops; each successive FF toggles at half the frequency - Ring counter: exactly 1 bit is 1 at any time; Johnson counter: has 2N states - MOD-N counter: if N is not power of 2, use reset logic when count reaches N