Why Does Increasing Sampling Frequency Fix Sequential Logic Simulation Issues?

In summary, when simulating sequential logic circuits, it is important to choose a sampling frequency that is at least four times the highest frequency component and to use a sufficient number of samples (at least four times the number of clock cycles) for accurate results. Choosing a sampling frequency of at least 4096 Hz and using 40 or more samples in the simulation has resolved the issue with the constant output of the pulse train.
  • #1
kbaumen
192
0
[SOLVED] Sequential logic simulation

I have built a circuit (using the SystemVue software package) that has a 5 bit adder (adds two 2s-complement five-bit numbers - A4A3A2A1A0 and B4B3B2B1B0) with overflow detection and saturation circuits. I am trying to clock the data in so I can check if it works with all possible combinations of the two input numbers. Hence I have 10 JK flipflops cascaded at the input as a frequency divider (all Js and Ks tied to 1, Q fed into clock of the next flipflop). Therefore I get all possible combinations of A's against every possible combination of B's for the input carry being both 0 and 1.

All of that seems more or less fine to me. What is causing me problems is simulating this circuit. I am feeding a pulse train into the first flipflop with a frequency of 1024 Hz and a pulse width of 50e-6 s. I then set the simulation to run with 1024 samples with a sampling frequency of 4096 Hz. The estimated time is determined (by the system) to be 0.4 s. It actually takes about 4 minutes to do the simulation. And if I set up a probe at the pulse train source, it gives a straight line, no sign of a pulse train. I think what I am having trouble with has to be something to do with the sampling rates and simulation. I don't understand it that well and have introductory DSP only next semester.

Does anyone have any idea why the output of the pulse train is staying constant and what I might be doing wrong?

EDIT: Hmm, choosing a sampling frequency at least 4 times the number of samples (say 256 samples, then at least 1024 Hz sampling frequency) made it work. I don't know why, but it works now.
 
Last edited:
Physics news on Phys.org
  • #2


Hello,

Thank you for sharing your circuit and simulation setup. It sounds like you have a good understanding of the circuit and its components. From your description, it seems like the issue may be related to the sampling frequency and number of samples used in the simulation.

In general, when simulating sequential logic circuits, it is important to choose a sampling frequency that is at least four times the highest frequency component in the circuit. This is known as the Nyquist-Shannon sampling theorem. In your case, it seems like your pulse train has a frequency of 1024 Hz, so choosing a sampling frequency of at least 4096 Hz is a good choice.

Additionally, the number of samples used in the simulation should also be considered. As a rule of thumb, the number of samples should be at least four times the number of clock cycles in the circuit. In your case, since you have 10 JK flip-flops cascaded, the number of clock cycles would be 10. So, using 40 or more samples in the simulation would be a good starting point.

I hope this helps to explain why increasing the sampling frequency and number of samples has resolved your issue. If you have any further questions or need more clarification, please feel free to ask. Best of luck with your simulation!
 

What is sequential logic simulation?

Sequential logic simulation is a process used by scientists and engineers to model and verify the behavior of digital circuits. It involves creating a computer program that emulates the behavior of sequential logic circuits, which are circuits that use memory elements to store and process data in a sequential manner.

Why is sequential logic simulation important?

Sequential logic simulation is important because it allows scientists and engineers to test and debug digital circuits before they are physically built. This can save time and resources, as errors can be corrected in the simulation stage rather than in the physical circuit. It also helps to ensure that the final circuit will function as intended.

What types of digital circuits can be simulated using sequential logic simulation?

Sequential logic simulation can be used to simulate a wide range of digital circuits, including flip-flops, counters, shift registers, and finite state machines. It can also be used to simulate more complex circuits, such as microprocessors and digital signal processors.

How is sequential logic simulation performed?

Sequential logic simulation is typically performed using a hardware description language, such as Verilog or VHDL. The circuit is described using this language, and then a simulator program executes the code and produces a simulation waveform, which shows the behavior of the circuit over time. The waveform can be analyzed to identify any errors or unexpected behavior.

What are the benefits of using sequential logic simulation?

There are several benefits of using sequential logic simulation, including the ability to catch errors early in the design process, the ability to test different scenarios and inputs without physically building the circuit, and the ability to save time and resources by identifying and correcting errors in the simulation stage.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
Replies
9
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
6
Views
1K
Replies
5
Views
858
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
3K
Back
Top