comment faire une détection de niveau haut ou "1" en vhdl ?

A

Arnaud

Slt tlm

je dois faire une détection de pik sur un signal, et mon programme VHDL doit
détecter ce niveau haut du signal pour compter le nombre de période

étant donné que je débute en VDHL, j'aurais besoin d'aide à ce sujet

merci
 
A

Amontec Team, Laurent Gauch

Arnaud said:
Slt tlm

je dois faire une détection de pik sur un signal, et mon programme VHDL doit
détecter ce niveau haut du signal pour compter le nombre de période

étant donné que je débute en VDHL, j'aurais besoin d'aide à ce sujet

merci
Arnaud,

Tu dois d'abord faire une detection du flanc montant.
You have to detect a rising edge.

Tu dois respecter la lois d'echantillonnage : clock signal doit être au
minimum 2 fois plus grand que la largeur de ton pulse.
For clk frequency, you have to respect 'Shanon' !!!

Clk : your system clock
in1 : your input signal
dff_in1 : synchonizing your input signal, registering in1
dff_in1 : registering dff_in1
rise_found : signal corresponding with a rising edge detection of you
input in1

rise_found <= '1' WHEN (dff_in1 = '1') AND (dff_in2 = '0') ELSE '0';

clk _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
in1 ____________------------------________________--------
dff_in1 _____________------------------________________-------
dff_in2 _______________------------------________________------
rise_foundd_____________--________________________________--__

The corresponding VHDL is :

--> VHDL START HERE

--
-- VHDL Architecture
--
-- Created:
-- by - gal.UNKNOWN (AMTBOOK)
-- at - 10:30:51 03/18/03
--------------------------------------------------------------------------------
-- Copyright (C) since 1999, Amontec, www.amontec.com
--------------------------------------------------------------------------------
-- @@amtref
-- @@amtcomment

ARCHITECTURE rtl OF rising_edge detector IS

SIGNAL dff_in1 : std_ulogic;
SIGNAL dff_in2 : std_ulogic;

BEGIN


------------------------------------------------------------------------------
reg : PROCESS(rst, clk)

------------------------------------------------------------------------------
BEGIN
IF rst = '1' THEN
dff_in1 <= '0';
dff_in2 <= '0';
ELSIF rising_edge(clk) THEN
dff_in1 <= in1;
dff_in2 <= dff_in1;
END PROCESS reg;

-- rising edge detection
edge_found <= '1' WHEN ((dff_in1 = '1') AND (dff_in2 = '0')) ELSE '0';

END rtl;

--> VHDL END HERE

Please visit our Amontec VHDL memo for more on VHDL

Regards,
Laurent
www.amontec.com






------------ And now a word from our sponsor ---------------------
For a secure high performance FTP using SSL/TLS encryption
upgrade to SurgeFTP
---- See http://netwinsite.com/sponsor/sponsor_surgeftp.htm ----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top