IntroductionYou may not know it, but synchronous counters are everywhere in digital electronics. CPUs are full of them. Appliances all have them in their microcontroller. Digital clocks have them. They are everywhere! Integrated circuit manufacturers all build very sophisticated, versatile, synchronous counters. Examples are the 74HC193, DM74LS169, and SN54ALS191A.Many electronic hobbyists are familiar with the asynchronous ripple counter. They are easy to understand and work great. So what's the problem with them?Counters are made from flip flops. It takes time for a flip flop to change states. When the clock input to one stage of a counter depends on the previous stage to change states, that time delay becomes cumulative. For a slow counter, no one cares about propagation delay. But if you have a 64-bit counter operating at 1 GHZ, even a 0.1 nanosecond propagation delay per stage is a disaster. You would have to sit and wait for many clock cycles for your counter to finally come to rest at its final state.So digital logic designers are taught to avoid asynchronous counters all together. They simply pose too many timing issues even at slow speeds, and they become completely useless at very high speeds.So this tutorial is all about flip flops and synchronous counters, how to count up and down, how to preload numbers into them, how the cascade them together, all the things that modern, versatile synchronous counters can do!I have recently been experimenting with various counter designs using Logisim. I described Logisim in a previous posting Logic Design with Logisim. Logisim is available here. I have now learned a lot about counters and will share it with you in this tutorial.The JK Flip FlopA flip flop is the fundamental sequential logic circuit used to store a single bit (1 or 0) of binary data. Unlike simple logic gates, flip-flops have two stable states and rely on "feedback" so that the output depends on both current and past inputs. Because flip flops can hold a state, they are the foundation for memory, registers, and counters.While there are several kinds of flip flop, everything we will talk about here is accomplished with JK flip flops. I used to think JK flip flops were mysterious compared to toggle flip flops, SR flip flops, and D flip flops, but JK flip flops are simply general purpose flip flops, which can easily be configured into whatever kind of flip flop you need.The JK Flip Flop
Synchronous Counters
Synchronous counters are fascinating. I'll take you from the basics to the versatile counters at the heart of computer hardware! By Doug Domke.















