Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL simulating a clock that doesn't run all the time

Status
Not open for further replies.

shaiko

Advanced Member level 5
Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Visit site
Activity points
18,302
Hello,

Signal x is a simulated clock that's defined as follows:
Code:
signal x : std_logic := '0' ;
x <= not x after 10ns ;

Suppose, I want x to start running after 100ns and stop after 1000ns.
The obvious solution will be to mux it...my question:

Is there a simple simulation syntax that allows to do that without using a mux?
 

You can use this.
x <= '0', not x after 100 ns, '0' after 1000 ns;

That wont make a clock, that will just set it high for 900 ns.

The easiest option is a mud like you suggested, or a process with control loops.
 

Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
Process
Begin
  input <= '0';
  wait for 100ns;
 
  for I in 1 to 90 loop 
    input <= not input;
    wait for 10 ns;
  end loop;
 
 input <= '0';
End process;

 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top