Combinational logic
There is no intended stored state. Change the inputs and the output follows after propagation delay.
Discover how digital circuits remember a state, respond to clock edges, count events and move data. Build a synchronous two-bit binary counter using real logic ICs.
In Module 24, combinational logic produced outputs from the present inputs. A sequential circuit can also depend on information stored from an earlier moment. That stored information is called state.
There is no intended stored state. Change the inputs and the output follows after propagation delay.
Stored state feeds back into the decision process. Clocked circuits update state at defined instants.
Remember: memory does not always mean a computer memory chip. A single latch or flip-flop can store one binary bit.
A latch is a level-sensitive storage element. A basic SR latch responds directly to its set and reset inputs; a gated latch adds an enable signal so it accepts input changes only while enabled and holds its state while disabled.
In an active-HIGH NOR latch, S=1 sets Q=1 and R=1 resets Q=0. With S=R=0 it holds. S=R=1 is forbidden because both outputs are forced LOW, breaking the complementary-state relationship.
| S | R | Next Q | Meaning |
|---|---|---|---|
| 0 | 0 | Hold | Remember |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Invalid | Forbidden |
This table describes the active-HIGH NOR implementation. NAND SR latches use active-LOW inputs and a different truth table.
A flip-flop is an edge-triggered storage element. A positive-edge-triggered flip-flop samples its input at the rising edge of the clock. It holds its output between active edges, subject to its timing and electrical limits.
Conceptual timing only. Real devices specify setup time, hold time, propagation delay, minimum clock pulse width and maximum clock frequency.
Many ICs also provide asynchronous preset and clear inputs that can change state without waiting for the clock.
| Type | Inputs | Next state at active edge |
|---|---|---|
| D | D | Q(next) = D |
| JK | J, K | 00 hold · 01 reset · 10 set · 11 toggle |
| T | T | 0 hold · 1 toggle |
| SR | S, R | 00 hold · 01 reset · 10 set · 11 device-specific invalid/restricted |
Select a flip-flop type, change its inputs and apply a clock edge. The teaching model updates the stored Q state according to the selected next-state rule. It does not model analogue timing, metastability or a specific IC.
Initial state Q=0. Change D, then apply a rising edge to sample it.
| Input combination | Next Q if current Q=0 | Next Q if current Q=1 |
|---|
The table changes with the selected flip-flop type.
Frequency is the number of cycles per second: f = 1/T. A 2 Hz clock has a period of 0.5 seconds.
A T flip-flop toggles once per active clock edge. If it toggles on every rising edge, its output frequency is half the clock frequency. Cascading stages can divide frequency by 4, 8, 16 and so on.
For n ideal divide-by-two stages. Actual maximum frequency and timing depend on the device and circuit implementation.
Each stage is clocked by the previous stage's output. It is simple, but delays accumulate through the chain and outputs do not all change simultaneously.
All flip-flops receive the same clock edge. Combinational logic calculates the next state. This avoids ripple clocking but still requires timing analysis.
Each clock edge moves stored data one stage. Shift registers can convert serial data to parallel data or parallel data to serial form.
Each clock edge advances this modulo-4 counter. Reset returns it to 00. This is a logical state model, not a timing-accurate simulation of a particular IC.
Ready at 00. Apply a clock pulse to advance the count.
| Clock edges | Q1 | Q0 | Decimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 2 | 1 | 0 | 2 |
| 3 | 1 | 1 | 3 |
| 4 | 0 | 0 | 0 |
We will use a dual positive-edge-triggered D flip-flop and an XOR gate to create a counter whose two storage bits update on the same clock edge. A 555 timer from Module 10 can provide a slow clock, or a suitable logic-level clock source can be used.
Let Q0 be the least significant bit and Q1 the most significant bit. The next-state equations are:
Both D flip-flops share the same clock. At each rising edge, Q0 toggles. Q1 toggles only when the current Q0 is HIGH. The sequence is 00 → 01 → 10 → 11 → 00.
Functional block diagram. Use the pin-level wiring guide below for the actual IC connections.
| IC / pin | Connection | Purpose |
|---|---|---|
| 74HC74 pin 14 | +5 V | Supply |
| 74HC74 pin 7 | GND | Ground |
| 74HC74 pins 4 and 10 | +5 V | Inactive asynchronous PRE̅ inputs |
| 74HC74 pins 1 and 13 | Tied together; 10 kΩ to +5 V; reset button to GND | Active-LOW asynchronous clear |
| 74HC74 pin 3 (CLK1) | Clock source | Shared rising-edge clock |
| 74HC74 pin 11 (CLK2) | Same clock source | Shared rising-edge clock |
| 74HC74 pin 2 (D0) | Pin 6 (Q̅0) | Toggle Q0 each edge |
| 74HC74 pin 5 (Q0) | LED through 1 kΩ to GND; 74HC86 pin 2 | Least significant bit and XOR input |
| 74HC74 pin 6 (Q̅0) | 74HC74 pin 2 (D0) | Complement feedback |
| 74HC74 pin 12 (D1) | 74HC86 pin 3 (XOR output) | Next state for Q1 |
| 74HC74 pin 9 (Q1) | LED through 1 kΩ to GND; 74HC86 pin 1 | Most significant bit and XOR input |
| 74HC86 pin 14 / pin 7 | +5 V / GND | XOR IC supply |
| 74HC86 pin 1 / pin 2 | 74HC74 pin 9 (Q1) / pin 5 (Q0) | XOR inputs |
| 74HC86 pin 3 | 74HC74 pin 12 (D1) | XOR output to second D input |
| Both ICs | 100 nF from pin 14 to pin 7, close to each package | Local supply bypassing |
DIP-14 pin numbering is viewed from above, notch at the top, counter-clockwise. Confirm the exact manufacturer's datasheet and pinout before wiring.
| Pulse | Q1 Q0 | Decimal |
|---|---|---|
| Reset | 00 | 0 |
| 1 | 01 | 1 |
| 2 | 10 | 2 |
| 3 | 11 | 3 |
| 4 | 00 | 0 |
Important: the 74HC74 preset and clear inputs are active LOW. Never leave them floating. Do not assert preset and clear simultaneously. Do not connect a raw bouncing pushbutton directly to the clock and expect one clean count. Check the exact IC supply range, input thresholds, output current and timing specifications for the manufacturer and device suffix you have.
Explore these open lessons at your own pace. For personalised explanations, project-specific troubleshooting, guided practical training or masterclasses, EazyLife offers paid support tailored to your learning goals.
Free or sponsored lesson referrals may be available through active programmes; they are not guaranteed.