- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
here i'm getting error in using of wait statement. how to use wait statement for executing an event after a particular time like after every 83 ns high and low respectively?Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please post your code.
wait statements with specific delays are not appropriate for synthesis, only simulation. For synthesis you need to use counters to wait for the specified time.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First you should use the numeric_std library, to have access to the signed and unsigned types.
Then declare count and z as unsigned(1 downto 0) and unsigned(6 downto 0) respectively, and you can directly use arithmetic operators on them:count<=count+1;
IF ((Z = 15) or (Z = 30) or (Z = 45) or (Z = 60)) then
clkout<= not clkout;
END IF;
IF(Z = 83) THEN
Z <="0000000";
ELSE
Z <=Z+1;
END IF;
I don't understand the values you use though... do you want to divide the clock frequency by 3 (meaning 666.666kHz) or by 3000 to get 666 Hz? IF dividing by 3 you won't be able to produce a square signal with 50% duty cycle. But you can generate a clock enable signal quite easily.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you for your advice, yes i want to divide the clk frequency by 3 to get 666kHz which is equal to 166ns....
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page