![]() |
|
|
|
#1 |
|
I've written a vhdl code in xilinx that generates an output waveform
based on the input clock. The problem i'm getting is that the code is running only for the positive edge of the clock pulse whereas i've coded it (i hope) to work for both positive as well as negative edges of the clock pulse. What i mean is that only that portion of the code is executing when clock is = 1. Code:
Any help would be appreciated... coderyogi |
|
|
|
|
#2 |
|
Posts: n/a
|
On Nov 13, 2:07*pm, coderyogi <zape...@gmail.com> wrote:
> I've written a vhdl code in xilinx that generates an output waveform > based on the input clock. The problem i'm getting is that the code is > running only for the positive edge of the clock pulse whereas i've > coded it (i hope) to work for both positive as well as negative edges > of the clock pulse. > > What i mean is that only that portion of the code is executing when > clock is = 1. > > Code:
> Any help would be appreciated... In VHDL, you're allowed to write almost any crazy thing you want and it will simulate. But only a small subset of the things you can possibly write actually make sense to get mapped into hardware. A counter (or other flopped logic) that runs on both clock edges is one of those describable but not buildable things. The other mistake you've made is that (for simulation only: do NOT try to build this for real) you should be using a template like this: process (clk) begin if rising_edge(clk) then ... insert rising edge stuff here end if; if falling_edge(clk) then .. insert falling edge here end if; end process; where rising edge is more or less a shorthand for (clk'event and clk = '1'). But again, this is for illustration only. Do not get into the habit of writing double-edge processes at all. Expunge all references to them in your mind now. Only do this to show a professor that you "get" some nuance of how the language works, or if you're writing a testbench that you know is intended only to run in a simulator. - Kenn kennheinrich@sympatico.ca |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I am having trouble editing a signal in a sub program. | Haai | Hardware | 0 | 08-28-2007 02:58 PM |
| Need help on Modelsim VHDL syntax? ASAP:) | kaji | General Help Related Topics | 0 | 03-14-2007 10:43 PM |
| Need help on a Modelsim VHDL Syntax? ASAP:) | kaji | Software | 0 | 03-14-2007 10:43 PM |
| IMHO, Digital SECAM video is better than Analog NTSC video | Radium | DVD Video | 167 | 10-25-2006 04:16 AM |
| Convert S-video to RF signal | Monkey Monkey | DVD Video | 10 | 01-14-2004 08:17 AM |