NivaarExam PrepOfficial exam papers ↗

04-BS-8 · December 2019

Question 1 of 5: Synchronous Up-Down Counter (Non-Binary Sequences)

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

Notes on this paper

04-BS-8 Digital Logic Circuits — December 2019
National Exams, 3 hours, closed book (Casio or Sharp approved calculator only; one hand-written 8.5"×11" aid sheet permitted). Format: five questions offered, each worth 25 marks (100 total); any four constitute a complete paper and only the first four appearing in the answer book are marked. All five are solved below for completeness.

Reference texts: Mano & Ciletti, Digital Design (6th ed., Pearson) — Boolean minimization, K-maps, PAL/PLA architectures, flip-flop conversion, sequential-circuit design, code conversion; Floyd, Digital Fundamentals (11th ed., Pearson) — logic gates, shift registers, flip-flop characteristic tables, parity generation.

Question 1: Synchronous Up-Down Counter (Non-Binary Sequences) (25 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.

Check

The up cycle {0,2,4,5,6} and down cycle {7,5,4,3,1} together use every one of the 8 three-bit codes exactly once, sharing only states 4 and 5. The question defines a next state for each state in its own cycle's direction only (e.g. state 0 has no down-direction (C=1) neighbour, since 0 is not in the down cycle). These "wrong-direction" transitions (from 0,2,6 when C=1; from 1,3,7 when C=0) are treated as don't-cares in the K-map — the standard, and only self-consistent, reading for a counter whose two prescribed cycles do not cover all 16 (state,C) combinations between them.

Given. Up cycle (C=0): $0\to2\to4\to5\to6\to0$. Down cycle (C=1): $7\to5\to4\to3\to1\to7$. Negative edge-triggered D flip-flops, state = $Q_2Q_1Q_0$ (natural binary code equal to the decimal state shown).

Find. (a) State diagram. (b) D flip-flop state equations $D_2,D_1,D_0$, minimized. (c) Circuit implementation.

Approach. Draw both cycles on one 8-state diagram (they share states 4 and 5); build the 16-row $(Q_2,Q_1,Q_0,C)\to(D_2,D_1,D_0)$ transition table directly from the two given cycles, marking every "wrong-direction" row as a don't-care; Quine–McCluskey-minimize each $D_i$ with those don't-cares, brute-force-verify the result against every defined row, then implement with 3 negative-edge D flip-flops driven by the minimized combinational logic.

  1. Part (a) — state diagram. The two cycles are drawn together below: the blue arrows are the up cycle (active when $C=0$), the red arrows are the down cycle (active when $C=1$); states 4 and 5 are the only states common to both cycles, so they are the only states where the counter can change direction without first completing a full lap of its current cycle.
    01234567C=0C=0C=0C=0C=0C=1C=1C=1C=1C=1Up cycle (C=0): 0-2-4-5-6-0Down cycle (C=1): 7-5-4-3-1-7
    Fig. Q1(a) — combined state diagram for the up-down counter. Blue = up cycle (C=0): 0-2-4-5-6-0. Red = down cycle (C=1): 7-5-4-3-1-7.
  2. Part (b) — state equations. Building the 16-row transition table from the diagram above (8 states × 2 directions, 8 rows defined per direction, 8 don't-care rows for the wrong-direction cases) and Quine–McCluskey-minimizing each output bit with those don't-cares gives $$D_2 = Q_2Q_1'C' + Q_2Q_0 + Q_2'Q_1Q_0' + Q_1'Q_0$$ $$D_1 = Q_2'Q_1' + Q_0C' + Q_0'C$$ $$\boxed{D_0 = Q_2'Q_0 + Q_1C + Q_2Q_1'Q_0'}$$ Because negative edge-triggered D flip-flops simply latch their D input on the falling clock edge, these three expressions are directly the next-state equations $Q_i^+ = D_i$.
  3. Part (c) — circuit implementation. Three negative edge-triggered D flip-flops hold $Q_2Q_1Q_0$; a combinational "next-state logic" block realizes $D_2,D_1,D_0$ from the equations above (inputs $Q_2,Q_1,Q_0,C$) and feeds the three D inputs every clock, exactly the K-map-derived-logic→D-FF-bank→feedback template used throughout this paper.
    Next-State LogicD2,D1,D0 = f(Q2,Q1,Q0,C)(per K-map equations)FF2 (Q2)DCLKQFF1 (Q1)DCLKQFF0 (Q0)DCLKQCD2D1D0CLKQ2Q1Q0
    Fig. Q1(c) — 3 negative-edge D flip-flops with feedback through the combinational next-state logic block (equations from Part (b)).
Final results — Question 1
ItemResult
Flip-flops3, negative edge-triggered D-type
D2$Q_2Q_1'C'+Q_2Q_0+Q_2'Q_1Q_0'+Q_1'Q_0$
D1$Q_2'Q_1'+Q_0C'+Q_0'C$
D0$Q_2'Q_0+Q_1C+Q_2Q_1'Q_0'$
Shared states4 and 5 (only states common to both cycles)
← Paper overview