Binary and decimal (BCD) counters

Flip-flops (FF) are a family of bistable logic circuits whose output logic states can be either 0 or 1. The transition from either state to the other is triggered by a logic transition applied to one of their inputs, under conditions specified by the logic states applied to other auxiliary inputs. FFs are the basic units of digital counters and of solid-state memory of computers, each flip-flop storing one bit of information.

The basic unit of digital counters is flip-flop T  (FF-T). A 10 transition applied to its T input triggers a transition to its Q output. Therefore, two consecutive full pulses (01010) result into a single pulse (010) at the output, hence FF-T acts a divisor by 2. In addition, output Q is forced to a logic 0 by a 10 transition applied to CLR (clear) input of flip-flop.

By applying a sequence of N pulses to a series of cascaded FF-T’s, N/2 pulses are obtained at the output of the 1st FF-T, N/4 pulses at the output of the 2nd, N/8 pulse at the output of the 3rd, and so on. Thus, at any given moment the combined outputs of all FF-T’s represent the total number of counted pulses in the binary system. Obviously, the counting capacity of M cascaded FF-Ts is 2M-1 pulses.

Four cascaded FF-Ts (A, B, C, D) are shown in Figure 1. This circuit can count from 0 (= 00002) to 24-1 = 15 (= 11112) and is referred as a 4-bit binary counter.    

 Figure 1. Four cascaded flip-flop T act as a 4-bit binary counter act as a binary counter from 00002(=0) to 11112(=15=24-1) counts. After that limit counting starts all over again starting from 00002.

By gating of all outputs with all CLR inputs, all FF-T’s can be simultaneously reset to 0, upon the formation of a particular binary count M. Then, this circuit is a modulo-M counter. Thus, the binary counter shown in Figure 1 as it is, makes a modulo-16 counter.

Modulo-10 counters are particularly useful, and they are known as decade counters or BCD counters (BCD: binary coded decimal), since they are compatible with the commonly used base-10 counting system.

In Figure 2 the logic outputs of the 4-bit counter are tabulated. In the case of the binary counter up to 15 pulses can be counted, whereas in the case of a decade counter (BCD counter) up to 9 pulses can be counted.

 

Figure 2. Table showing the logic states of four cascaded flip-flops T, wired as binary counter or as decade counter (BCD) after counting N pulses.

Integrated circuits (ICs) 7493 and 7490. These are "classic" IC counters circuits containing 4 flip-flops. Structurally, 7493 acts as a binary 4-bit counter and it can count up to 15, hence M cascaded 7493 can count from 0 to 16M-1.

IC 7490 acts as a decade counter or as a single BCD (binary coded decimal) counter that can count from 0 to 9, hence M cascaded 7490 can count from 0 to 10M-1.

A detailed description of both ICs can be found here: DM5490/DM7490A, DM7493A: Datasheet.

 

4-to-7 decoder. These are decoder circuits with 4 inputs and 7 outputs (see applet: Digital electronics: gates, decoders, multiplexers). and they are always combined with the 7-segment numeric displays, visually representing the known decimal digits. Each one of their outputs (a, b, … g) controls the corresponding LED segment of the 7-segment digit. The truth table of IC 7447 (a typical 4-to-7 decoder) is shown in Figure 3.  

 

Figure 3. Truth table of the 7447 decoder (4-to-7 segment numeric display). The lighted segment is the one accepting logic 0 as input (‘common anode’ connection).

When a binary number from 00002 (=0) to 10012 (=9), then the corresponding decimal digit is displayed.

NOTE: IC 7447 applies logic 0 to segments to be lighted ("common anode" connection), whereas IC 7448 applies logic 1 to segments to be lighted ("common cathode" connection).

Figure 4 shows the combination of the decade counter 7490 with 4-to-7 decoder and the 7-segment numerical display. M similar circuits cascaded can count up to 10M-1 pulses.

Figure 4. Circuit of a decade (BCD) counter 7490 with the "4-to-7 decoder" 7447, and the 7-segment numerical display. Any number of similar circuits can be cascaded to make possible the counting of a big number of pulses (0 - 99.... 9).

 

Applet

This applet simulates a 3-digits BCD (decade) counter. Each digit combines a 7490 (BCD counter), a 7447, and a single 7-segment decimal digit.

The frequency of the counted square pulses can be selected at 1,5, and 20 Hz, or it can be freely adjusted to any frequency in the range (about) of 0.25-5 Hz).

Apart of the decimal representation of each digit (0 to 9), their equivalent binary representation by 4 LEDs (0000 to 1001) is also shown.

The user can change the BCD counter (IC7490) with a binary counter (IC7493). In this case, the 7-segment display shows no more the correct number of the pulses. However, this number appears correctly as a 12-bit binary number on the 3x4 = 12 LEDs.

Unrecognizable symbols appear, when the following binary codes, beyond 10012 (=9), are applied to 7447 inputs: 10102 (=10), 10112 (=11), 11002 (=12), 11012 (=13), 11102 (=14) and 11112 (=15).

All symbols shown on 7-segment numerical displays, and the corresponding binary representations are shown bellow: 

 

ATTENTION:  

For a full list of all applets click here.

Page maintained by Prof. C. E. Efstathiou