MATLAB Answers

How to find the simulation time of digital circuits?

조회 수: 3(최근 30일)
sangam singh
sangam singh 2016년 12월 25일
답변: Jose Lara 2016년 12월 27일
I want to simulate some digital circuits and see the variation of signals at the different stages of the circuits. Also, I need to find the time it takes for the signal to propagate. For example, let us consider a basic AND gate shown below.
The scope always shows the time taken for the signal to reach the high state as immediate, no matter what value I set the simulation time to. Like for example, in this case I have reduced the simulation time to picoseconds and still the output change is shown to be immediate.
So, my question is how to find the delay or simulation time of various circuits.


Jose Lara
Jose Lara 2016년 12월 27일
The reason the response of the signal is immediate is because there is only one computation performed, which is the logical operation. In order to create a model with simulation time, you should make an input that is dependent in time. For example, instead of using a constant block as an input, use a Pulse Generator block as shown below:
Change the ‘Period’ to 0.5 seconds and the ‘Pulse Width’ to 50 percent of the period. Simulate the model and open the scope. The input to the logical operator will now have a time component and will calculate at the correct time.
As you can see, the pulse generator is compared to the input of the Constant block each step. You can change the step size by navigating to the Fixed-Step Size (fundamental sample time) option under Configuration Parameters > Solver.
Check out the following links for more information regarding sample time:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by