Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Need to delay a signal a great number of clk cycles

Reply
Thread Tools

Need to delay a signal a great number of clk cycles

 
 
martin.wahlstedt martin.wahlstedt is offline
Junior Member
Join Date: Mar 2007
Posts: 14
 
      05-14-2007
Hi

Do someone have any tricks on how to delay a signal without using shift registers? Need to delay an enable signal (one bit) approx. 1024 clock cycles, and an shift register implementation will be quite big. The implementation is to be synthesises so 'after' commands are not possible.

Thanks
Martin
 
Reply With Quote
 
 
 
 
scottcarl scottcarl is offline
Member
Join Date: May 2007
Location: USA
Posts: 51
 
      05-15-2007
Use a 10-bit counter to delay something 1024 clock cycles. Use this 2-state state machine.

Code:
Count_grab : process(clk, reset)
begin
  if (reset = '1') then
    counter               <= (others => '0'); -- Counts from 0 to 1023
    YOUR_END_PULSE <= '0';  
    s_pulse_grab <= s_idle;
  elsif elsif rising_edge(clk) then
       counter              <= (others => '0'); -- defualt wherever it's not defined
       YOUR_END_PULSE <= '0';   -- defualt wherever it's not defined
    when s_idle => 
      if (incoming_pulse = '1') then  -- Latch in the incoming pulse 
        counter        <= counter + '1'; -- Start counting
        s_pulse_grab <= s_enabling;
      else
        s_pulse_grab <= s_idle;
      end if;
    when s_enabling => 
      if (counter = 1022) then  -- Find one sample before the end 
        YOUR_END_PULSE <= '1';   -- This is your 1024 delayed pulse
        s_pulse_grab       <= s_idle;
      else
        counter              <= counter + '1'; 
        s_pulse_grab       <= s_enabling;
      end if;
    when others =>
  end if;
end process;
Enjoy,
Scott
 

Last edited by scottcarl; 05-15-2007 at 09:26 PM..
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
Modelsim and signal transitions on clk edges neilmac VHDL 2 01-11-2008 10:45 AM
with clk'event, must we use clk='1' or clk='0' ? sunshinekisses@gmail.com VHDL 18 08-09-2007 10:42 PM
Aside from delta cycles and/or resolution functions, how can the effective value of a signal differ from a driving signal of its? Colin Paul Gloster VHDL 0 01-11-2007 01:31 PM
Signal Set-up Before CLK Rise Wojtek VHDL 12 07-05-2006 01:16 PM
Xilinx translate error : Cannot find signal "clk" Rakesh Sharma VHDL 2 10-22-2004 08:03 PM



Advertisments