We know that toggle T-type flip-flops can work as standalone divide-by-two counters. By connecting several toggle flip-flops in a sequence, we can create a digital Binary-Coded Decimal (BCD) counter. This counter can store or display the frequency of a specific counting sequence.
Clocked T-type flip-flops act as binary divide-by-two counters. In asynchronous counters, the output from one stage serves as the clock pulse for the next stage. Each flip-flop has two output states. By adding more flip-flop stages we can build a divide-by-2^N counter. However a 4-bit binary counter has a counting range from 0000 to 1111 which is from 0 to 15 in decimal.
To design a counter that counts from 1 to 10, we need to set it up to only register binary values from 0000 to 1001 which represent decimal values from 0 to 9. Luckily counting circuits are available as integrated circuits, like the Asynchronous 74LS90 Decade Counter.
Digital counters count from zero up to a set value when we apply a clock signal. When the counter reaches this value then we can use a reset function to bring it back to zero and start counting again.
A decade counter counts in tens and resets to zero after reaching nine. To count up to nine in binary, the counter needs at least four flip-flops to represent each decimal digit properly.
This is clearly shown in the following diagram.
Diagram Showing the BCD Counter State
We use a decade counter made up of four flip-flops. This setup allows us to represent 16 different states. However, we only use 10 of these states in real applications. By connecting multiple counters in series, we can count up to 100, 1,000, or any number we choose.
The total number of counts a counter can handle is called its **modulus**. A counter that resets to zero after counting to “n” is known as a modulo-n counter. For example, we might see a modulo-8 (MOD-8) or a modulo-16 (MOD-16) counter. In an “n-bit counter,” the counts range from 0 to “2^n – 1”.
As we discussed in the tutorial on asynchronous counters, a counter that resets after ten counts, the counting from the binary 0000 (which is 0 in decimal) to 1001 (which is 9 in decimal) is called a binary-coded-decimal (BCD) counter. We can build a MOD-10 counter using just four toggle flip-flops.
A BCD counter gets its name because its ten states match the Binary-Coded Decimal (BCD) code. Unlike a regular binary counter, the BCD does not follow a uniform pattern.
For example the 74LS90 model is a single-stage BCD counter that counts from decimal 0 to 9. This means that, it can register up to nine pulses. We should also note that a digital counter can count in different directions, up, down, or both, based on the control signal it receives.
The BCD code, which is known as the 8421 code, uses four binary digits. The name “8421” refers to the binary weight of these bits, 8 for 2^3, 4 for 2^2, 2 for 2^1, and 1 for 2^0. One major advantage of using BCD is that it makes converting between decimal and binary numbers easy.
The 74LS90 BCD counter is a decade counter. It works on the MOD-10 principle. This IC gives a Binary-Coded Decimal output. It has four master-slave JK flip-flops. These flip-flops are connected to act as a MOD-2 counter and a MOD-5 counter.
We have one toggle JK flip-flop that uses the CLK A input. The other three toggle JK flip-flops form an asynchronous counter with the CLK B input. The outputs of the counter are labeled Q with numbers showing their binary weight.
The counting starts when the clock signal changes from high to low. The reset pins can set the counter back to zero or to nine, depending on how they are activated.
Understanding 74LS90 BCD Counter
We represent the four outputs of the counter with the letter Q and a number. These numbers show the binary weight of each bit in the BCD counter. We call these outputs QA, QB, QC, and QD. The counting starts when the clock signal, called CLK, goes from high (1) to low (0).
We also have extra input pins named R1 and R2 for resetting the counter. The inputs S1 and S2 are for setting the counter. When we connect R1 and R2 to high (1), then counter resets to zero (0000). When we set S1 and S2 to high (1), the counter goes to its maximum value of 9 (1001) no matter what the current count is.
The 74LS90 counter has a divide-by-2 counter and a divide-by-5 counter in one package. We can use either counter alone to create a divide-by-2 or a divide-by-5 frequency counter. We can also use both counters together to make a divide-by-10 BCD counter.
When we disable the four flip-flops in the divide-by-5 section then we can apply a clock signal to pin 14 (CLKA) and take the output from pin 12 (QA). This setup gives us a standard divide-by-2 binary counter which is useful in frequency division circuits.
Analyzing the Divide-by-2 Counter IC 74LS90
A typical divide-by-5 counter may be created by turning off the initial flip-flop as described above and applying the clock input signal straight to pin 1 (CLKB), with pin 11 (QD) providing the output signal as demonstrated.
We notice that the output waveform of the divide-by-5 counter is asymmetrical. It has a mark-space ratio of 4:1.
This means that for every four input clock signals, the output is LOW or logic “0.” The fifth input clock signal gives us a HIGH state or logic “1.”
To create a divide-by-10 BCD decade counter, we use both internal counter circuits. This gives us a division factor of 2 times 5.
The first output called QA, from flip-flop “A” is not connected to the next stages. This design lets us extend the counter to make a 4-bit BCD counter by connecting the QA output to the CLKB input as shown in the diagram.
Analyzing the Divide-by-5 Counter IC 74LS90
It is really important to notice that in this divide-by-5 counter setup, the output waveform is not symmetrical. It has a mark-space ratio of 4:1.
This means that for every four clock signals that come in, the output stays LOW or at logic “0” and then on the fifth clock signal, it goes HIGH, or to logic “1.”
To make a divide-by-10 BCD decade counter, both internal counter circuits are used which gives us a division of 2 times 5.
Interestingly the first output called QA, from flip-flop “A” is not connected to the next stages inside. This design makes it possible to expand the counter into a 4-bit BCD counter by hooking up the QA output to the CLKB input as shown in the diagram.
Analyzing the Divide-by-10 Counter IC 74LS90
We know that BCD counters work like binary counters. They start at 0000 and go up to 1001. After reaching 1001, they reset to 0000.
We can add a pushbutton switch, called SW1, to the clock input CLKA.
Each time we release the button, the counter increases by one.
If we connect LEDs to the output terminals QA, QB, QC, and QD, we can see the BCD count displayed in real-time as it changes.
Evaluating the IC 74LS90 BCD Decade Counter
Truth Table
Count | QD | QC | QB | QA |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 |
2 | 0 | 0 | 1 | 0 |
3 | 0 | 0 | 1 | 1 |
4 | 0 | 1 | 0 | 0 |
5 | 0 | 1 | 0 | 1 |
6 | 0 | 1 | 1 | 0 |
7 | 0 | 1 | 1 | 1 |
8 | 1 | 0 | 0 | 0 |
9 | 1 | 0 | 0 | 1 |
10 | 0 | 0 | 0 | 0 |
When you keep pressing the push-button switch SW1, the count goes up to nine which is 1001 in binary.
But when you press it for the tenth time the outputs ABCD go back to zero so we can start counting again.
This counting system is called a MOD-10 and it helps us use a decade counter to show numbers on a digital display.
If we want to see the count on a seven-segment display we need to change the BCD output into something that the display can understand. The special circuit that takes the four outputs from our 74LS90 BCD counter and lights up the right parts of the display is called a Decoder.
Specialized Display Drivers
Someone smart made a special chip called the BCD to 7-segment Display Decoder IC like the 74LS47, to help us show numbers on a display.
The 74LS47 has four spots where you can put in BCD digits A, B, C, and D, and it has outputs for each part of the seven-segment display.
A regular 7-segment LED display usually has eight connections. Seven of these are for each LED segment and one is for all the segments to connect together. Some displays even have a spot for a decimal point (DP) to show a dot.
Understanding 74LS47 BCD to 7-segment Driver
The 74LS47 takes special numbers called BCD codes and turns them into signals to light up the right parts of an LED display which shows how many times you pressed a button.
When you want to light up a part of the display you need to send a LOW signal (which is like saying “yes”) to that part and if you send a HIGH signal (like saying “no”), it will turn off.
To make everything work properly, three special connections called LP (Lamp Test), BI/RBO (Blanking Input/Ripple Blanking Output), and RBI (Ripple Blanking Input) need to be connected to HIGH.
Now the 74LS47 is designed for displays where all the positive sides of the lights are connected together (thats called a common-anode display).
If you have another type called a common-cathode display, you would use the 74LS48 instead because it works with HIGH signals to light up the LEDs.
You can connect the 74LS47 to another device called a 74LS90 BCD Counter. This way every time you press a button (let’s call it SW1), it shows a new number on the display.
If you move where the button and a little resistor (1kΩ) are placed, you can change how the count happens, either when you press or when you let go of the SW1 button!
The Ultimate 4-bit BCD Counter Circuit
A 7-segment display is composed of seven separate light emitting diodes. The most effective way to limit the current across a seven segment display is to connect a current limiting resistor in series to all of the seven LEDs, as illustrated. However we can accomplish this in a couple of methods.
How to Connect the Current Limiting Resistors to the Display LEDs
Using Single Resistor: It means that you have just one resistor to control how much electricity goes through the whole 7-segment display. If you dont mind if the lights aren’t always super bright, this is the easiest way to make it work.
When electricity goes through the LED, the light it generates changes depending on how much electricity is flowing. With just one resistor, the light gets shared between all the segments that are lit up. So if more segments are switched on, they wont be as bright because they have to share the electricity.
Using Multiple Resistors: Now with Multiple individual Resistors, each segment of the display has its own resistor. This way every segment can shine as bright as it needs to, without worrying about what the others are doing.
Usually a 7-segment display needs about 12 to 20 milli-amps of electricity to light up properly. So for each resistor, we pick a value that keeps the current in that range. Be careful though, If you push too much current (like 40mA or more) then you can burn the display.
The best thing about using separate resistors is that each LED can light up independently. This means the LEDs stay bright no matter how many segments are lit up simultaneously.
You can also adjust resistor values based on how bright you want the display to be. Because more light around the atmosphere will need that much higher brightness on the LEDs.
Using a 74LS90 BCD Counter and a 74LS47 7-segment display driver, this circuit design demonstrates a simple digital counter that functions between 0 and 9.
We have to connect two separate divide-by-ten counters in a cascade fashion in order to increase our counting capacity beyond the number 10 and enable the display of a two-digit base-ten counter.
With this setup, a two-digit BCD counter may efficiently count in decimal from 00 to 99 (which is equivalent to 0000 0000 to 1001 1001) before resetting to 00.
It should be noted that although the counter may display two digits, it cannot handle numbers that match to hexadecimal representations for A through F in this specific coding scheme.
Additionally three cascaded decade counters would need to be put in place if we wanted to extend our counting range to include values from 0 to 999 (or, in binary, from 0000 0000 0000 to 1001 1001 1001).
Basically, by connecting separate BCD counter circuits, each of which is assigned to a different decade, as shown in the diagram, it is possible to easily make multiple decade counters.
Working Diagram of a 2-digit BCD Counter from 00 to 99
Conclusions
In this lesson we have discussed the idea of a BCD (Binary-Coded Decimal) Counter, an IC that when it receives clock signals, successively moves through 10 different states before returning to zero when the count reaches nine.
Although a push-button switch produces the clock pulses in the simple example given above, it is crucial to remember that counters may be used to count a number of real-time occurrences, including the counting of moving objects.
But as such occurrences can happen at predetermined times or at unpredictability, it could be essential to install the proper circuitry to generate the electrical pulses that corresponds to each occurrence that needs to be counted.
Toggle flip-flops or other flip-flop types that may be modified to accomplish the appropriate switching functionality are commonly used in the construction of digital counters in the field of digital electronic circuits and their diverse applications.
As a different option, specific counting integrated circuits such the 74LS90 might be used. Additionally it is important to note that binary counters work by iterating through a binary sequence. An n-bit binary counter, which is made up of “n” flip-flops, may count from zero to two raised to the power of n minus one.
Sources:
[1] https://www.electronics-lab.com/article/bcd-counter-circuit/
[2] https://mechatronics.colostate.edu/files/lab_book.pdf
[3] https://www.allelcoelec.com/blog/All-About-the-74LS90-BCD-Counter-IC.html
[4] https://www.riverpublishers.com/pdf/ebook/RP_E9788793102293.pdf
[5] https://www.electronics-tutorials.ws/counter/bcd-counter-circuit.html
[6] https://tajseer.files.wordpress.com/2014/06/computerorganization.pdf
[7] https://www.jotrin.com/technology/details/74ls90-bcd-decade-counter-ic
[8] https://vtechworks.lib.vt.edu/bitstream/handle/10919/64041/LD5655.V855_1977.J656.pdf
[9] https://components101.com/ics/74ls90-bcd-counter-ic-pinout-equivalent-datasheet