logic-gate-circuit-diagrams Circuit Diagram Maker Team

Logic Gate Circuit Diagrams: Symbols, Flip-Flops and Counters

Logic Gate Circuit Diagrams: Symbols, Flip-Flops and Counters
16
Min Read
2929
Words
7
Sections
Published

Logic gate circuit diagrams describe behaviour, not component values. That single difference changes how you draw them. An analog schematic lives or dies on whether the reader can find the 4k7 resistor; a digital schematic lives or dies on whether the reader can trace signal propagation through a chain of gates without losing their place. There are almost no values to annotate โ€” so every ounce of clarity has to come from symbol choice and layout.

This guide covers both symbol dialects, then works upward through the hierarchy: gates built from bare transistors, gates composed into flip-flops, flip-flops chained into counters, and finally a real counter IC. It is one of six domain guides that sit under our complete guide to circuit diagrams, which covers the universal layout conventions these rules build on.

Two Symbol Dialects: ANSI Shapes vs IEC Rectangles

Digital logic is the one area where the American and international standards diverge dramatically. Everywhere else โ€” resistors, capacitors, diodes โ€” the shapes are similar or identical. In logic they are unrecognizably different.

ANSI/IEEE 91-1984 distinctive shapes give every gate a unique silhouette. You identify the function from the outline alone, at any zoom level, in peripheral vision.

IEC 60617-12 (often loosely called the DIN style, after the older German DIN 40700) uses one rectangle for every gate, with a qualifying symbol inside that names the function.

GateANSI distinctive shapeIEC / DIN rectangleBoolean
ANDFlat back, semicircular nose โ€” a โ€œDโ€Rectangle with &Y = A ยท B
ORCurved back, pointed nose โ€” a shieldRectangle with โ‰ฅ1Y = A + B
NOTTriangle with a bubble on the outputRectangle with 1 plus bubbleY = ฤ€
NANDAND shape plus output bubble& plus output bubbleY = A ยท B inverted
NOROR shape plus output bubbleโ‰ฅ1 plus output bubbleY = A + B inverted
XOROR shape plus a second curved back lineRectangle with =1Y = A โŠ• B
XNORXOR shape plus output bubble=1 plus output bubbleY = A โŠ• B inverted
BufferPlain triangle, no bubbleRectangle with 1Y = A

The IEC qualifiers are more logical than they first appear. & is literally โ€œandโ€. โ‰ฅ1 means โ€œoutput is true when at least one input is trueโ€ โ€” which is exactly what OR means. =1 means โ€œoutput is true when exactly one input is trueโ€ โ€” exactly XOR. Once you read them that way you never forget them.

Which should you use? ANSI shapes for anything read by a human, IEC rectangles when your organization mandates them or when you are drawing complex gates where a distinctive shape does not exist. ANSIโ€™s advantage is real: a page of distinctive shapes is scannable, while a page of identical rectangles forces the reader to inspect every qualifier. Whichever you pick, never mix them on one sheet.

The Bubble Is the Whole Story

A small circle on a pin means inversion. That is the single most load-bearing convention in digital drafting:

  • Bubble on the output โ€” the function is negated. AND becomes NAND.
  • Bubble on an input โ€” that input is inverted before the gate acts on it.
  • Bubble on a clock input โ€” the flip-flop triggers on the falling edge instead of the rising edge.
  • Bubble on an IC pin, plus a name like nCS or RESET# โ€” the signal is active low: it does its job when driven to 0 V.

Because bubbles are small, keep them clean. Never let a wire touch or overlap a bubble, and never place two gates so close that the output bubble of one merges visually with the input line of the next.

Drawing Rules Specific to Digital Schematics

The universal conventions still apply โ€” inputs left, outputs right, power top, ground bottom, snap to grid. Digital work adds four of its own.

1. Gate inputs never cross each other. If two wires feeding one gate cross on their way in, swap the input order instead. For AND, OR, NAND, NOR and XOR the inputs are interchangeable, so there is no excuse. A crossed gate input is the hardest error to spot in a digital drawing because it looks perfectly normal.

2. Propagation reads left to right, always. Digital circuits often loop, and the loops are meaningful โ€” a latch is a loop. Keep every forward path strictly left-to-right so the loops stand out as the only backward wires on the sheet.

3. Collapse parallel groups into buses. Eight data lines drawn individually is eight chances to misread. D[0..7] on a single thick line is one.

4. Label the clock domain. Any sheet with more than one clock should name them (CLK_16M, CLK_SLOW) and keep each domain visually grouped. Clock lines are conventionally drawn straight and unbroken โ€” a clock that wanders through six corners looks like a data line.

flowchart LR
    A["Transistors"] --> B["Gates<br/>NOT, NAND, NOR"]
    B --> C["Latches<br/>cross-coupled pair"]
    C --> D["Flip-flops<br/>clocked, 1 bit"]
    D --> E["Counters<br/>chained divide-by-2"]
    E --> F["Decoded outputs<br/>4017, displays"]

    style B fill:#1e293b,stroke:#3b82f6,color:#fff
    style D fill:#1e293b,stroke:#22c55e,color:#fff

Each step in that chain is drawn with the same symbols at a higher level of abstraction. Understanding the bottom rung makes the rest obvious, so start there.

Building Gates from Transistors

Every gate symbol hides a transistor arrangement. Drawing those arrangements is a genuinely useful exercise, because it explains why NAND and NOR are the cheap, natural gates and AND and OR are the expensive ones.

NOT Gate Circuit

The simplest gate is a common-emitter NPN inverter:

  • Input through a base resistor (a few kฮฉ) to the base of an NPN transistor.
  • Collector resistor (1 kฮฉโ€“10 kฮฉ) from the collector up to VCC.
  • Emitter straight to ground.
  • Output taken at the collector.

Drive the input high and the transistor saturates, pulling the collector โ€” and therefore the output โ€” down to roughly 0.2 V. Drive the input low and the transistor turns off, so the collector resistor pulls the output up to VCC. Input high gives output low: inversion.

Draw it exactly as the hub guide prescribes and the function is visible: VCC at the top, collector resistor vertical, transistor below it with the emitter arrow pointing down into the ground rail, input entering from the left, output leaving from the right at the collector node. The whole gate reads in one glance.

NAND Gate Using Transistors

Now stack two transistors in series between the output node and ground: the emitter of the upper transistor connects to the collector of the lower one, and the lower emitter goes to ground. Each base gets its own input through a base resistor. One collector resistor to VCC serves both.

The output is pulled low only when both transistors conduct, which requires both inputs high. Every other input combination leaves at least one transistor off, so the pull-up resistor wins and the output stays high.

ABQ1Q2Output
00offoff1
01offon1
10onoff1
11onon0

That is a NAND truth table. Series transistors give you NAND for free โ€” and that is precisely why NAND is the universal building block of real logic families, not AND.

Put the same two transistors in parallel โ€” both collectors on the output node, both emitters on ground โ€” and the output is pulled low when either conducts. That is NOR. Series equals NAND, parallel equals NOR. Two arrangements, both gates, no extra parts.

To get a true AND you need the NAND followed by an inverter: three transistors instead of two. AND and OR are literally more expensive than their inverted cousins, which is why datasheets are full of NAND and NOR packages.

XOR Gate Using Transistors

XOR is where discrete construction stops being elegant. The Boolean identity is:

Y = (A ยท Bฬ„) + (ฤ€ ยท B)

Output is high when the inputs differ. In discrete form that means two inverters to generate ฤ€ and Bฬ„, then two series pull-down pairs โ€” one for A ยท Bฬ„, one for ฤ€ ยท B โ€” with both pairs sharing a single collector pull-up resistor to wire-OR their results. Six transistors and five resistors for one gate.

Draw it as two clearly separated halves, one per product term, stacked vertically and meeting at the shared output node. If you try to draw all six transistors in one row it becomes unreadable immediately. This is also the moment to note that in any real design you would use one seventh of a 74HC86 instead โ€” the discrete version exists to teach the identity, not to be built.

Flip-Flop Circuits

A flip-flop is what happens when you feed a gateโ€™s output back to its own input. That loop gives the circuit memory โ€” one bit of it.

The SR Latch

Cross-couple two NOR gates: the output of gate 1 feeds an input of gate 2, and the output of gate 2 feeds an input of gate 1. The remaining free inputs become S (set) and R (reset), and the two outputs are Q and Qฬ„.

  • Pulse S high: Q goes high and stays high after S returns low.
  • Pulse R high: Q goes low and stays low.
  • Both low: the latch holds its previous state โ€” this is the memory.
  • Both high: forbidden, because both outputs are forced low and the โ€œQฬ„ is the opposite of Qโ€ contract breaks.

Swap the NOR gates for NAND gates and you get the active-low version, where the inputs are Sฬ„ and Rฬ„ and idle is both high.

The SR latch is the one place where the no-crossing rule is deliberately broken. The conventional drawing puts the two gates one above the other with the feedback wires visibly crossing between them, because that X shape is the recognizable signature of a latch. Draw it any other way and readers will not recognize it.

D and JK Flip-Flops

Add a clock and the latch becomes a flip-flop that only changes state at a defined moment.

TypeInputsBehaviourDrawing notes
DD, CLKQ takes the value of D at the clock edgeMost common; one data input, no forbidden state
JKJ, K, CLKJ sets, K resets, both high togglesThe toggle mode is what makes counters possible
TT, CLKToggles when T is highA JK with J and K tied together

At schematic level you almost always draw these as rectangles, not as the underlying gates. Conventions for the block: D or J/K inputs on the left, clock on the left with a bubble if it is falling-edge triggered, Q on the upper right, Qฬ„ on the lower right, and asynchronous set/reset on the top and bottom edges. Following that layout means any reader recognizes the block instantly without reading the part number.

Binary Counter Circuits

A JK flip-flop with both inputs tied high toggles on every clock edge. Its output is therefore exactly half the input frequency โ€” a divide-by-2 stage. Chain them and each stage divides again:

flowchart LR
    CLK["CLK"] --> A["FF0<br/>รท2 = bit 0"]
    A --> B["FF1<br/>รท4 = bit 1"]
    B --> C["FF2<br/>รท8 = bit 2"]
    C --> D["FF3<br/>รท16 = bit 3"]

    style A fill:#1e293b,stroke:#22c55e,color:#fff
    style D fill:#1e293b,stroke:#22c55e,color:#fff

Read the four Q outputs together and you have a 4-bit binary number that increments once per input clock: a binary counter counting 0 to 15. Because each stage clocks the next, this is an asynchronous or ripple counter โ€” the stages update in sequence rather than simultaneously, so there is a brief settling period after each clock where the output is invalid.

Drawing rules for counters:

  • Left to right in bit order. Bit 0 on the left, most significant bit on the right. Never reverse this; readers assume it absolutely.
  • Label each output with its bit weight, Q0/Q1/Q2/Q3 or รท2/รท4/รท8/รท16.
  • Run the clock along a straight horizontal line beneath or above the chain and drop taps up into each stage. Do not thread the clock diagonally between flip-flops.
  • Tie unused asynchronous inputs explicitly to their inactive rail and show it. A floating reset pin on a counter is a guaranteed field failure.

For a synchronous counter, every flip-flop shares one clock and combinational logic decides which bits toggle. The drawing changes character completely: one clean clock line to every stage, plus a triangular block of AND gates fanning across the sheet. It is more parts and more drawing, and it eliminates the ripple settling problem.

The IC 4017 Decimal Counter

In practice you rarely draw a counter from flip-flops โ€” you use a counter IC. The CD4017 is the classic: a 5-stage Johnson counter with decoded outputs, giving ten outputs that go high one at a time, in sequence, one per clock pulse. It is the heart of nearly every LED chaser, sequencer, and step-counting circuit ever built.

Its pinout is also the single best argument for the hub guideโ€™s rule about arranging IC pins by function rather than physical order:

PinFunctionPinFunction
1Q59Q8
2Q110Q4
3Q011Q9
4Q212Carry out
5Q613Clock inhibit
6Q714Clock
7Q315Reset
8VSS (GND)16VDD

The ten outputs are scattered across both sides of the package in no useful order. If you draw the symbol in physical pin order, Q0 through Q9 zigzag around the block and every wire you attach crosses another. Draw it functionally instead โ€” clock, inhibit and reset stacked on the left, Q0 through Q9 in numerical order down the right side, VDD on top, VSS on the bottom, with pin numbers in small text next to each โ€” and a ten-LED chaser becomes ten parallel horizontal wires with zero crossings.

The three control pins matter when you draw one:

  • Clock (14) advances the sequence on the rising edge.
  • Clock inhibit (13) freezes the counter while high. Tie it to ground if unused โ€” do not leave it floating.
  • Reset (15) returns the count to Q0 while high. Tie it to ground if unused, or drive it from the output you want to be the last step in a shortened sequence. Feeding Q4 back into reset, for example, turns the 4017 into a 4-step sequencer, and that feedback wire is one of the few right-to-left wires that belongs on a digital sheet.
  • Carry out (12) pulses once per ten clocks, so it feeds the clock of a second 4017 to cascade beyond ten steps.

A typical LED chaser therefore reads: a 555 astable on the left generating the clock, the 4017 in the middle, ten LEDs with current-limiting resistors fanning out to the right, and both power symbols vertical. Clock generation for exactly this kind of circuit is covered in the amplifier and oscillator circuits guide, and if the 4017 is driving anything larger than an LED, the switching stages in the sensor and protection circuit guide are what belong between them.

Digital Schematic Checklist

Run this before you call a logic drawing finished:

  1. One symbol standard only โ€” ANSI shapes or IEC rectangles, never both.
  2. No crossed gate inputs anywhere.
  3. Every bubble clearly separated from surrounding wires.
  4. Active-low signals named consistently (nRESET, /RESET or RESET# โ€” pick one).
  5. Every unused input tied to a defined level, explicitly drawn.
  6. Every unused output marked with a no-connect X.
  7. Counter and register bits in ascending left-to-right order.
  8. Clock lines straight, labelled, and grouped by domain.
  9. Decoupling capacitor drawn at each ICโ€™s own power pin โ€” CMOS logic draws current spikes on every transition and this is where you record that intent.
  10. Pull-up and pull-down values annotated even though the circuit is โ€œdigitalโ€.

Start drawing your own schematic now. The gate library includes both ANSI distinctive shapes and IEC rectangles, plus flip-flops, counters and the 4017, so you can lay out a chaser or a divider chain in a couple of minutes. If you want to work from a truth table instead of placing gates by hand, the truth table to logic circuit converter generates the gate network for you, and the Boolean expression simplifier reduces the expression first so you draw the smallest circuit rather than the most obvious one.

Check our circuit diagram maker to draw and share circuit schematics online.

C

Building free tools for electronics enthusiasts and engineers. Our team focuses on providing intuitive, browser-based circuit design solutions and educational resources for makers worldwide.

Ready to build circuits?

Put your knowledge into practice. Use our free editor to easily sketch, simulate, and export beautiful electronic schematic diagrams directly in your browser.

Open Circuit Editor โ†’