Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen the lab →

CD4060: the 14-stage counter with a built-in oscillator, live

The CD4060 combines an oscillator with a 14-stage ripple binary counter. Each falling edge on its clock input, pin 11, adds one to the count, and ten stages come out on pins, Q4 to Q10 and Q12 to Q14, dividing the clock by 16 up to 16,384. A high RESET clears the count. Here the clock is a switch, CLKI.

TI's datasheet describes the CD4060B as "an oscillator section and 14 ripple-carry binary counter stages. The oscillator configuration allows design of either RC or crystal oscillator circuits." A high level on RESET resets the counter to all zeros and disables the oscillator, all stages are master-slave flip-flops, and the count advances on the falling edge of the clock. The oscillator is two inverting stages between pin 11 (the input, called phi I) and pins 9 and 10 (phi O and its inverse): the datasheet's typical RC circuit puts Rx from pin 10 to a timing node, Cx from that node to pin 9 and Rs from the node to pin 11, with Rs 2 to 10 times Rx, for a period of about T = 2.2 Rx Cx, and it also shows a crystal circuit. Fourteen stages divide hard: a 32,768 Hz clock comes out of Q14 at 2 Hz. This simulator is digital, so the oscillator itself is not modeled: CLKI is a switch, and each change from 1 to 0 counts one. The counter is fourteen toggling master-slave D flip-flops with clear, each clocked by the one before, as in the CD4040; Q1 to Q3 and Q11 stay inside, as on the chip, so after a reset Q4 first changes on the eighth pulse. The full 16,384-count cycle, back to zero, has been checked on all ten outputs, and every build of this page re-checks the first 70 counts and a reset in the middle of a count.

Big circuit: pinch, scroll or tap + to zoom in, then drag to move around.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

What you need

Step by step

  1. Place inputs CLKI and RESET, and probes for the pinned outputs Q4 to Q10 and Q12 to Q14.
  2. Chain fourteen toggle stages (D flip-flops with D = Q'), the first clocked by NOT CLKI and each later one by the Q' of the stage before, all cleared by RESET.
  3. Probe only the stages the chip brings out; Q1 to Q3 and Q11 stay internal.
  4. Pulse RESET, then toggle CLKI: Q4 goes high after 8 falling edges and Q14 after 8,192.

CD4060 outputs and what they divide by

OutputPinClock divided byChanges every
Q47168 clocks
Q553216 clocks
Q646432 clocks
Q7612864 clocks
Q814256128 clocks
Q913512256 clocks
Q10151,024512 clocks
Q1214,0962,048 clocks
Q1328,1924,096 clocks
Q14316,3848,192 clocks

CD4060 pinout

PinNamePinName
1Q1216VDD
2Q1315Q10
3Q1414Q8
4Q613Q9
5Q512RESET
6Q711phi I (clock in)
7Q410phi O inverted
8VSS9phi O

"Changes every" counts falling clock edges. The pinout, the RC circuit, the 3 V to 18 V range and the description are from TI's CD4060B datasheet (SCHS049C), checked 2026-10-25; it also notes that RC oscillator use is not recommended below 7 V when Rx is under 50 kilohms. TI's SN74HC4060 datasheet (SCLS161D) has the same pin positions, named QD to QN, CLKI, CLKO and CLR, for 2 V to 6 V.

You can also read the full theory in the lesson on counters. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.

Build more parts from gates

half adderfull adderhalf subtractorfull subtractor2:1 multiplexer4:1 multiplexerXOR gate from NAND gates2-to-4 decoderSR latchD flip-flopJK flip-flopT flip-flop4-bit shift register4-bit ripple carry adderD latch1-to-4 demultiplexer4-bit magnitude comparator4-bit ring counter4-bit Johnson counter4-to-2 priority encoder4-bit synchronous counter3-to-8 decoder8-to-1 multiplexer4-bit carry lookahead adderhalf adder from NAND gates2-bit comparatorBCD to 7-segment decoder4-bit up/down counterdecade counter2-bit multiplier4-bit ALU4-bit array multiplierNOT, AND, OR and NOR from NANDNOT, OR, AND and XOR from NORfull adder from NAND gatesSR latch from NAND gatesparity generator and checker4-bit adder/subtractorBCD adder4-bit universal shift registermod-6 counter4-bit ripple counterbinary to Gray code converterhalf adder from NOR gatesfull adder from NOR gates4-bit register with parallel load1011 sequence detectorbinary to BCD converterD flip-flop from NAND gates1-bit ALUCMOS inverterCMOS NAND gateCMOS NOR gatePISO shift registerSR flip-flop from NAND gatesBCD to excess-3 code converterHamming (7,4) code encoder and correctortraffic light controller4-bit barrel shifterCMOS AND gateCMOS OR gateCMOS XOR gate1-bit magnitude comparatorhalf subtractor from NAND gatesfull subtractor from NAND gates8-to-3 encoderGray to binary converter4-to-16 decoderfull adder using 4:1 multiplexersedge detectorserial adder4-bit carry-select adder4-bit Kogge-Stone adder4-bit carry-skip adder4x4 Wallace tree multiplier8-bit adderfrequency divider (by 2, 4 and 3)switch debouncer (SR latch)3-bit Gray code counterMealy machine (1011 detector)master-slave JK flip-flop (NAND)half subtractor from NOR gates1-to-8 demultiplexerexcess-3 to BCD code convertervending machine FSM4-bit carry-save adder3-bit synchronous counter (JK)CMOS transmission gatetri-state buffer (CMOS)2-to-1 mux from transmission gatesmod-5 counterflip-flop conversion (JK to D)8-bit ALUdecimal to BCD encoderBCD to decimal decoder4-to-1 mux from 2-to-1 muxesXOR gate from NOR gates4-bit LFSR74LS138 decoderBCD subtractor74181 ALUCMOS AOI gate (AOI21)D latch vs D flip-flop74LS47 BCD to 7-segment decoder74HC595 shift register7400 quad NAND gate chip7402 quad NOR gate chip7404 hex inverter chip7408 quad AND gate chip7432 quad OR gate chip7486 quad XOR gate chip7474 dual D flip-flop74HC165 shift registerCD4017 decade counter74LS283 4-bit adder74LS90 decade counter74HC161 4-bit counter74HC151 8-to-1 multiplexer74HC157 quad 2-to-1 multiplexer74HC139 dual 2-to-4 decoderCD4511 BCD to 7-segment decoder7492 divide-by-12 counter7493 4-bit binary counter74HC244 octal bufferRace-around condition (JK latch)74HC373 octal latch74HC374 octal D flip-flopTurnstile state machine1-to-2 demultiplexerhalf adder using 2:1 multiplexersregister file (4 x 4-bit)digital PWM generatorCD4013 dual D flip-flop74LS76 dual JK flip-flop7410 triple 3-input NAND chip7411 triple 3-input AND chip7420 dual 4-input NAND chipCD4011 quad 2-input NAND chipCD4001 quad 2-input NOR chipCD4081 quad 2-input AND chipCD4069 hex inverter chip74HC164 8-bit shift register7485 4-bit magnitude comparator74HC125 quad tri-state bufferCD4040 12-stage binary counter74LS193 4-bit up/down counterelectronic dice circuitmemory address register (MAR) and MDRhardware stack with a stack pointerdirect-mapped cache8-bit Brent-Kung adder4x4 Dadda multiplierbinary clock circuit

Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.

Open the CD4060 14-stage counter and oscillator in the lab →

Frequently asked

What does the CD4060 do?

It is a 14-stage binary counter with its own oscillator. The oscillator, set by an RC network or a crystal, clocks the counter, and outputs Q4 to Q10 and Q12 to Q14 give that clock divided by 16 up to 16,384. A high RESET clears the count and stops the oscillator.

What is the CD4060 pinout?

Pin 1 Q12, 2 Q13, 3 Q14, 4 Q6, 5 Q5, 6 Q7, 7 Q4, 8 VSS, 9 phi O, 10 phi O inverted, 11 phi I (clock in), 12 RESET, 13 Q9, 14 Q8, 15 Q10, 16 VDD.

How do you set the CD4060 oscillator frequency?

With the datasheet's typical RC circuit (Rx from pin 10 to a timing node, Cx from the node to pin 9, Rs from the node to pin 11, Rs 2 to 10 times Rx), the period is about T = 2.2 Rx Cx, so the frequency is about 1 / (2.2 Rx Cx). Q14 then divides that by 16,384.

Why does the CD4060 have no Q1, Q2, Q3 or Q11 pins?

A 16-pin package has room for only ten outputs once power, RESET and the three oscillator pins are in place, so those four stages stay inside the chip. They still count; you just cannot connect to them.