Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Nice clean pulse signal

Reply
Thread Tools

Nice clean pulse signal

 
 
matchstick86 matchstick86 is offline
Junior Member
Join Date: Oct 2009
Posts: 19
 
      12-14-2009
Let's say we have a signal as such, so I have a sig_reg to make a delay of the signal by half clock cycle.

And using this code:
Code:
process(clk, sig, sig_reg) is
begin
	if rising_edge(clk) then
		sig_reg <= sig;
	end if;
		sig_pulse<=sig and not (sig_reg);
end process;
Code:
Sig: 
....----............---........----............------....---.......

Sig_reg:
......----............---........----............------....---.....

Sig_pulse (final result):
....--..............--.........--..............--........--........
"." being '0' and "-" being '1'.
(Illustration purpose only)

It should give me a nice pulse signal that is the difference in intervals of the rising edges of sig & sig_reg.

That means that when sig = '1' at falling_edge(clk), a sig_reg will be produced at the successive rising_edge(clk). However, nothing happens when sig='1' is at the rising_edge(clk), i.e. no pulse signal is produced since sig_reg appears at the same time as sig and difference is zero. So it seems like the code does what it's supposed to do only when the high signal is at the falling_edge(clk).

Question is: How do I create sexy pulsed signals regardless of whether it is at rising_ or falling_edge(clk)?
 

Last edited by matchstick86; 12-14-2009 at 04:54 AM..
Reply With Quote
 
 
 
 
matchstick86 matchstick86 is offline
Junior Member
Join Date: Oct 2009
Posts: 19
 
      12-21-2009
It's Halloween in here where ghosts roam...Woooo~~
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulse signal with variable working cycle controlled by a rotary control! symba05 VHDL 0 11-26-2011 09:03 PM
clean nice way (hash) Shai Rosenfeld Ruby 23 07-16-2007 09:18 PM
Clean up my Hard drive before selling it. Clean Registry? what else? baaab Computer Support 5 05-10-2005 08:30 AM
Wanted: A nice clean ruby app to disect Curt Hibbs Ruby 6 03-19-2005 01:35 PM
Generating a output signal with a specific pulse width arturomeza@gmail.com VHDL 3 12-21-2004 07:33 PM



Advertisments