Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait function, De Bouncing some signals.

Status
Not open for further replies.

Markling

Programmer
Mar 19, 2003
3
0
0
DK
I'm using a xc9536 with a pc44 package...

I need to debounce som signals, there for I need a wait function...
I have a clk input at 1khz, and I need a vector to count so I get a 20 ms delay...

So the code would proberly look something like this,
VHDL is very new to me, so bare with me...
And my english isn't as good as well, I'm danish.


architecture Behavioral of cykel is
--clk signal
CLKIN : IN STD_LOGIC;
--vector for counting to 20, (5bits)
signal count : std_logic_vector (4 downto 0);

begin

if( a = "1"){
count <= &quot;0&quot;;
process ...

count <= count + &quot;1&quot;;
}

if (count = &quot;11111&quot;)
count <= &quot;0&quot;
--Here I will be able to check my a signal again I think?
-- And if it's still high, I will use it and send it on it's way...

Is the count function in the right place?
Can I make a separte function for counting?
Do u spot any troubles in my way of thinking?



 
Hi,
&quot;If&quot; statement is sequential and I think it shud always come inside a process. I'm also a newbie in this field. So not that confident.If I'm correct, the IF statement shud come within the process statement. Plz write u'r pgm in such a way that every1 can easily understand. If I am wrong plz correct me.
regards
niv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top