NivaarExam PrepOfficial exam papers ↗

22-Elec-A4 Digital Systems and Computers · May 2013

Question 2 of 6: Asynchronous Binary and Decade Counters

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Paper format. National Exams, May 2013 — 07-Elec-A4 Digital Systems & Computers. Three hours, closed book (one approved Casio or Sharp calculator). Six questions are printed; any five constitute a complete exam and all questions are worth 12 marks. An excitation table for the RS/JK/T/D flip-flops and a table of basic Boolean identities are supplied on the last page of the paper. All six questions are solved below, because this set is a study resource rather than a timed sitting.

Reference texts.

Convention used throughout. In the address/data expressions a prime denotes complement (\(\overline{A}\) is written A′ in the figures, where SVG text cannot carry an overbar). Hexadecimal constants keep the Motorola dollar-sign notation of the exam paper, written here as $7A01 in prose so that it cannot be mistaken for a mathematics delimiter.

Question 2: Asynchronous Binary and Decade Counters (12 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. Toggle (T) flip-flops with the excitation behaviour printed on the last page of the paper — $Q^{+} = Q$ when $T = 0$ and $Q^{+} = \overline{Q}$ when $T = 1$ — and an asynchronous (ripple) architecture, in which only the first stage sees the system clock and each subsequent stage is clocked by the preceding stage's output.

ItemSpecification
Part (a)/(b)Modulus 16, states 0000 through 1111, natural binary order
Part (c)/(d)Modulus 10 (decade), states 0000 through 1001, then back to 0000
Flip-flopT type, negative-edge triggered, with an asynchronous active-low CLEAR
Marks(a) 2, (b) 4, (c) 2, (d) 4

Find. The two state-transition tables and the two ripple-counter schematics, the second obtained from the first by adding decoding logic that truncates the count.

Approach. Exploit the defining property of a natural binary up-count: bit $Q_k$ toggles precisely when all lower bits roll over from 1 to 0. In a ripple counter this condition is produced by the wiring rather than by logic — each stage's own falling edge is the next stage's clock — so every $T$ input is tied permanently to logic 1. The decade counter is then the same hardware plus a NAND gate that detects the first illegal state and asynchronously clears the chain.

  1. (a) State-transition table for the modulo-16 counter. With $Q_3$ the most significant bit, the present state simply increments:
    Present $Q_3Q_2Q_1Q_0$Next $Q_3^{+}Q_2^{+}Q_1^{+}Q_0^{+}$$T_3T_2T_1T_0$PresentNext$T_3T_2T_1T_0$
    000000010001100010010001
    000100100011100110100011
    001000110001101010110001
    001101000111101111000111
    010001010001110011010001
    010101100011110111100011
    011001110001111011110001
    011110001111111100001111
    The $T$ columns are the bitwise exclusive-OR of present and next state, i.e. the list of bits that must change. Reading them down, $T_0$ is 1 in every row, $T_1$ is 1 whenever $Q_0 = 1$, $T_2$ whenever $Q_1Q_0 = 11$, and $T_3$ whenever $Q_2Q_1Q_0 = 111$ — the classic carry-chain condition.
  2. (b) Realise the ripple counter. A synchronous design would implement those AND conditions with gates. The asynchronous design instead delivers them for free: if stage $k$ is clocked by $Q_{k-1}$ and triggers on the falling edge, then stage $k$ toggles exactly when $Q_{k-1}$ goes from 1 to 0, which happens only when all bits below it were 1 and have just rolled over. Therefore $$T_3 = T_2 = T_1 = T_0 = 1$$ and the entire counter needs no gates at all. Each stage divides the frequency of the previous one by two, so $Q_0$ runs at $f_{\text{clk}}/2$, $Q_1$ at $f_{\text{clk}}/4$, $Q_2$ at $f_{\text{clk}}/8$ and $Q_3$ at $f_{\text{clk}}/16$.
    TQQ'FF01Q0TQQ'FF11Q1TQQ'FF21Q2TQQ'FF31Q3CLKAsynchronous (ripple) 4-bit up-counter: every T = 1, each stage clocks the next
    Question 2(b) - asynchronous 4-bit binary up-counter built from T flip-flops.
  3. (c) State-transition table for the decade counter. A decade counter is a modulo-10 counter: it uses the natural binary sequence but returns to zero after nine, so the six states 1010 through 1111 are never entered in normal operation.
    Present $Q_3Q_2Q_1Q_0$DecimalNext state$T_3T_2T_1T_0$
    0000000010001
    0001100100011
    0010200110001
    0011301000111
    0100401010001
    0101501100011
    0110601110001
    0111710001111
    1000810010001
    1001900001001
    1010–111110–15unused (don't care)—
    Only the last row differs from the modulo-16 table: from 1001 the counter must jump to 0000 rather than to 1010.
  4. (d) Truncate the ripple counter to modulus ten. Following the hint, keep the hardware of part (b) and add a decoder that forces the chain back to zero. Because a ripple counter cannot be steered synchronously, the standard technique is to let it enter the first illegal state 1010 for a few nanoseconds and immediately abort it through the asynchronous CLEAR inputs. The state 1010 is uniquely identified among the states the counter can actually reach by the pair $Q_3 = 1$ and $Q_1 = 1$: no legal state 0000 through 1001 has both bits set, since the only legal states with $Q_3 = 1$ are 1000 and 1001, in which $Q_1 = 0$. Hence a single two-input NAND suffices: $$\overline{\text{CLR}} = \overline{Q_3 \cdot Q_1}$$ which is logic 1 (inactive) for every legal count and drops to 0 the instant 1010 appears, clearing all four stages. $$\boxed{\,\text{Decade ripple counter} = \text{modulo-16 ripple counter} + \text{NAND}(Q_3, Q_1) \rightarrow \overline{\text{CLR}}\,}$$
    TQQ'CLRFF01Q0TQQ'CLRFF11Q1TQQ'CLRFF21Q2TQQ'CLRFF31Q3CLKNANDCLRNAND detects the first illegal count and clears every stageDecade counter: NAND(Q3,Q1) detects 1010 and asynchronously clears
    Question 2(d) - the same chain truncated to a decade counter by NAND(Q3,Q1) driving CLEAR.
  5. Confirm the truncated sequence. Simulating the chain stage by stage from 0000 gives 0, 1, 2, ..., 9, then the transient 1010 which the NAND immediately erases, so the observed sequence is 0, 1, ..., 9, 0, 1, ... The output frequency at $Q_3$ is therefore $f_{\text{clk}}/10$ rather than $f_{\text{clk}}/16$, though the $Q_3$ waveform is no longer a symmetric square wave.

Check: the glitch is inherent to the asynchronous approach. The 1010 state really is entered, and the clear propagates in finite time, so a narrow spike appears on $Q_1$ and the counter is briefly in an illegal state. That is acceptable for a divider or a display driver but not for logic that decodes the count combinationally at full speed; a synchronous decade counter (steering the T inputs with gates so that 1001 goes directly to 0000) is the drop-in alternative when glitch-free decoding is required. The exam's hint explicitly asks for the modify-the-ripple-counter answer, which is what is given here.

PartQuantityResult
(a)Modulo-16 transitionsNatural increment; $T_k = 1$ when all lower bits are 1
(b)Ripple up-counterFour T flip-flops, all $T = 1$, $Q_k$ clocks stage $k+1$; no gates
(c)Decade transitions0000–1001 then back to 0000; 1010–1111 unused
(d)Decade ripple counterSame chain plus $\overline{\text{CLR}} = \overline{Q_3 Q_1}$ detecting 1010
—Division ratios$f(Q_3) = f_{\text{clk}}/16$ (binary), $f_{\text{clk}}/10$ (decade)