Skip to main content

Design of 8-bit Synchronous Counter


Design of 8-bit Synchronous Counter

A counter is a sequential circuit that counts pulses and is widely used for event counting, frequency division, timing, and control operations. Its outputs progress in a predictable repeating pattern, advancing one state per clock pulse. The modulus (m) of a counter is the number of states in its cycle. A counter with m states is called a modulo-m or divide-by-m counter.

General structure and state diagram of a counter
Fig.1: General Structure of a counter’s state diagram—a single cycle

Ripple Counters

An n-bit binary counter can be constructed using n flip-flops. Each bit toggles when the preceding bit changes from 1 to 0, generating a carry to the next higher-order bit. This “rippling” of the carry gives the ripple counter its name.

Synchronous Counters

Unlike ripple counters, synchronous counters have all flip-flop clock inputs connected to the same CLK signal, so all outputs change simultaneously after a single flip-flop propagation delay. T flip-flops with enable inputs are used, and combinational logic determines which flip-flops toggle per clock cycle.

Synchronous 4-bit binary counter with serial enable logic
Fig.2: A synchronous 4-bit binary counter with serial enable logic

Master count enable signal (CNTEN) allows each flip-flop to toggle only when asserted and all lower-order bits are 1. Counters can operate in two directions:

  • UP – count from MSB to LSB
  • DOWN – count from LSB to MSB
Various synchronous counter configurations
Fig.3: Synchronous Counters
Circuit diagram of 4-bit up counter
Fig.4: Circuit Diagram of 4-bit Up Counter
Circuit diagram of 4-bit down counter
Fig.5: Circuit Diagram of 4-bit Down Counter
Example showing 3-bit up and down counting sequence
Fig.6: Example of 3-bit Up & Down Counting Process

Circuits / Block Diagrams

Block diagram of up counter
Fig.7: Block Diagram of Up Counter
Internal circuit of up counter
Fig.8: Internal Circuit of Up Counter
Block diagram of down counter
Fig.9: Block Diagram of Down Counter
Internal circuit of down counter
Fig.10: Internal Circuit of Down Counter

Observations & Data

Write a VHDL program, run it to generate the RTL schematic, and then create the Test Bench Waveform (TBW). The input and output waveforms can then be observed according to the given inputs.

RTL Schematic

[Include RTL schematic image]

Test Bench Waveform (TBW)

[Include TBW waveform image]

Input & Output Waveform

[Include waveform image]

Procedure

Refer to Xilinx Software Procedure for step-by-step VHDL simulation and synthesis.

Conclusion

Using Xilinx ISE software, the VHDL program was implemented, RTL schematic generated, and Test Bench Waveform obtained. The input/output waveforms matched the expected design, demonstrating correct synchronous counter operation.

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

📘 Overview of BER and SNR 🧮 Online Simulator for BER calculation 🧮 MATLAB Code for BER calculation 📚 Further Reading 📂 View Other Topics on M-ary QAM, M-ary PSK, QPSK ... 🧮 Online Simulator for Constellation Diagram of m-ary QAM 🧮 Online Simulator for Constellation Diagram of m-ary PSK 🧮 MATLAB Code for BER calculation of ASK, FSK, and PSK 🧮 MATLAB Code for BER calculation of Alamouti Scheme 🧮 Different approaches to calculate BER vs SNR What is Bit Error Rate (BER)? The abbreviation BER stands for Bit Error Rate, which indicates how many corrupted bits are received compared to the total number of bits sent. BER = (number of bits received in error) / (total number of transmitted bits) What is Signal-to-Noise Ratio (SNR)? SNR is the ratio of signal power to noise powe...

Comparing Baseband and Passband Implementations of m-ary QAM

  Let's assume your original digital message bitstream is: 0, 0, 1, 0, 0, 0, 1, 0, 1, 1 In 4-QAM, we group them into pairs: (00), (10), (00), (10), (11). Your baseband symbols are: Symbol 1 (Bits 00): -1.00 - j1.00 Symbol 2 (Bits 10): 1.00 - j1.00 Symbol 3 (Bits 00): -1.00 - j1.00 Symbol 4 (Bits 10): 1.00 - j1.00 Symbol 5 (Bits 11): 1.00 + j1.00   To transmit these symbols over a wireless medium, we modulate this baseband signal onto a high-frequency carrier (e.g., 50 Hz). This process creates the passband signal , where the information is stored in the phase and amplitude of the sine wave. Fig 1: 4-QAM Baseband I and Q Components Fig 2: 4-QAM Passband Modulated Signal   In this example, the symbol rate is 5 symbols per second. Detailed Explanation 4-QAM Constellation Mapping In standard 4-QAM mapping, bits are converted to complex points on a grid: Bits...

Comparing Baseband and Passband Implementations of ASK, FSK, and PSK

📘 Overview 🧮 Baseband and Passband Implementations of ASK, FSK, and PSK 🧮 Difference betwen baseband and passband 📚 Further Reading 📂 Other Topics on Baseband and Passband ... 🧮 Baseband modulation techniques 🧮 Passband modulation techniques   Baseband modulation techniques are methods used to encode information signals onto a baseband signal (a signal with frequencies close to zero). Passband techniques shift these signals to higher carrier frequencies for transmission. Here are the common implementations: Amplitude Shift Keying (ASK) [↗] : In ASK, the amplitude of the signal is varied to represent different symbols. Binary ASK (BASK) is a common implementation where two different amplitudes represent binary values (0 and 1). ASK is simple but susceptible to noise. ASK Baseband (Digital Bits) ASK Passband (Modulated Carrier)     Fig 1:  ASK Passband Modulation (...

Amplitude, Frequency, and Phase Modulation Techniques (AM, FM, and PM)

📘 Overview 🧮 Amplitude Modulation (AM) 🧮 Online Amplitude Modulation Simulator 🧮 MATLAB Code for AM 🧮 Q & A and Summary 📚 Further Reading Amplitude Modulation (AM): The carrier signal's amplitude varies linearly with the amplitude of the message signal. An AM wave may thus be described, in the most general form, as a function of time as follows: When performing amplitude modulation (AM) with a carrier frequency of 100 Hz and a message frequency of 10 Hz, the resulting peak frequencies are as follows: 90 Hz (100 - 10 Hz), 100 Hz, and 110 Hz (100 + 10 Hz). Figure: Frequency Spectrums of AM Signal (Lower Sideband, Carrier, and Upper Sideband) A low-frequency message signal is modulated with a high-frequency carrier wave using a local oscillator to make communication possible. DSB, SSB, and VSB are common amplitude modulation techniques. We find a lot of bandwidth loss in DSB. The bandwidth of S...

Shannon Limit Explained: Negative SNR, Eb/No and Channel Capacity

Understanding Negative SNR and the Shannon Limit Understanding Negative SNR and the Shannon Limit An explanation of Signal-to-Noise Ratio (SNR), its behavior in decibels, and how Shannon's theorem defines the ultimate communication limit. Signal-to-Noise Ratio in Shannon’s Equation In Shannon's equation, the Signal-to-Noise Ratio (SNR) is defined as the signal power divided by the noise power: SNR = S / N Since both signal power and noise power are physical quantities, neither can be negative. Therefore, the SNR itself is always a positive number. However, engineers often express SNR in decibels: SNR(dB) When SNR = 1, the logarithmic value becomes: SNR(dB) = 0 When the noise power exceeds the signal power (SNR < 1), the decibel representation becomes negative. Behavior of Shannon's Capacity Equation Shannon’s channel capacity formula is: C = B log₂(1 + SNR) For SNR = 0: log₂(1 + SNR) = 0 When SNR becomes smaller (in...

Analog vs Digital Modulation Techniques | Advantages of Digital ...

Modulation Techniques Analog vs Digital Modulation In our previous discussion, we explored the necessity of modulation. In this article, we focus on the fundamental differences between analog and digital modulation. The primary distinction is that digital modulation uses a discrete digital signal to modify the carrier, whereas analog modulation uses a continuous analog signal. Advantages of Digital Modulation over Analog Modulation Bandwidth Efficiency: Digital techniques (like QAM) can transmit more data within a limited frequency range. Noise Resistance: Digital signals have superior resistance to noise because they can be perfectly regenerated. Multiplexing: It is much easier to multiplex various data types (audio, video, text) into a single digital stream. Higher SNR: Better noise immunity leads to a higher Signal-to-Noise Ratio (SNR). Increased Throughput: Modern digital techniques provide significantly higher data ...

ASK, FSK, and PSK (with MATLAB + Online Simulator)

📘 Overview 📘 Amplitude Shift Keying (ASK) 📘 Frequency Shift Keying (FSK) 📘 Phase Shift Keying (PSK) 📘 Which of the modulation techniques—ASK, FSK, or PSK—can achieve higher bit rates? 🧮 MATLAB Codes 📘 Simulator for binary ASK, FSK, and PSK Modulation 📚 Further Reading ASK or OFF ON Keying ASK is a simple (less complex) Digital Modulation Scheme where we vary the modulation signal's amplitude or voltage by the message signal's amplitude or voltage. We select two levels (two different voltage levels) for transmitting modulated message signals. For example, "+5 Volt" (upper level) and "0 Volt" (lower level). To transmit binary bit "1", the transmitter sends "+5 Volts", and for bit "0", it sends no power. The receiver uses filters to detect whether a binary "1" or "0" was transmitted. ...

Calculation of SNR from FFT bins in MATLAB

📘 Overview 🧮 MATLAB Code for Estimation of SNR from FFT bins 🧮 MATLAB Code for SNR from PSD using Kaiser Window 📚 Further Reading Here, you can find the SNR of a received signal from periodogram / FFT bins using the Kaiser operator. The beta (β) parameter characterizes the Kaiser window, which controls the trade-off between the main lobe width and the side lobe level. Steps Set up the sampling rate and time vector Compute the FFT and periodogram Calculate the frequency resolution and signal power Exclude the signal power from noise calculation Compute the noise power and SNR MATLAB Code for Estimation of SNR from FFT bins clc; clear; close all; % Parameters fs = 8000; f_tone = 1000; N = 8192; t = (0:N-1)/fs; % Generate signal + noise signal = sin(2*pi*f_tone*t); SNR_true_dB = 20; signal_power = mean(signal.^2); noise_power = signal_power / (10^(SNR_true_dB/10)); noisy_signal = signal + sqrt(noise_power) * randn(1, N); % Apply ...