Forum Discussion
Altera_Forum
Honored Contributor
15 years agoVHDL timer
hi, how can I write a program for a timer which Measures a pulse width that represents of range.i'm using un ultrasonic sensor, The distance can be calculated using the scale factor of 147u...
Altera_Forum
Honored Contributor
13 years agoOk I wrote this code for timer 2 second in Ahdl so please how can I convert it to VHDL
SUBDESIGN 2_sec_cnt ( clk ,enl: INPUT; 2_second : OUTPUT; ) VARIABLE count[25..0] : DFF; BEGIN count[].clk = clk; IF (enl)Then IF ((count[].q == 48000000)) THEN count[].d = 0; 2_second = VCC; ELSE count[].d = count[].q + 1; 2_second = GND; END IF; Else 2_second = GND; END IF; END;