- Joined
- Oct 18, 2007
- Messages
- 4
- Reaction score
- 0
Hi there,
I am new on this forum and would like to get some assistance with a vhdl program I am writing.
I am using an Altera DE2 development and education board together with the Altera Quartus II v.7.1 software. I would like to determine the time elapsed between two events. Either my time determination isn't working or I just cannot output the value to anywhere. The two processes that should determine the time is below:
-- Process that determines whether the signal is back or not
count_clk_cycles: PROCESS (output_xcorr, load, EXT_CLOCK)
VARIABLE counter : INTEGER := 5;
VARIABLE str_counter : STRING(1 TO 6) := "000111";
BEGIN
IF (loaded = '1' AND xcorr = '0') THEN
counter := counter + 1;
END IF;
IF (loaded = '1' AND xcorr = '1') THEN
str_counter := fix(INTEGER'IMAGE(counter));
display(str_counter);
END IF;
END PROCESS;
-- Process that determines the state of the entire process.
set_state : PROCESS(load, loaded, output_xcorr, xcorr, EXT_CLOCK)
BEGIN
IF (load = '1') THEN
loaded <= '1';
END IF;
IF (output_xcorr = '1') THEN
xcorr <= '1';
END IF;
IF (loaded = '1' AND xcorr = '1') THEN
loaded <= '0';
xcorr <= '0';
END IF;
END PROCESS;
Let me describe the project a little. When the 'load' signal is high, a code is loaded into a shift register and sent out. The code is then received back and cross-correlated with the original to produce the output, 'output_xcorr'. I would like to determine the time from which the code is loaded until cross-correlation is successful.
The 'display' function displays the value of counter on a 7-segment display, but this isn't working. It only displays zero. When I however give counter a value like 'counter := 123', then it displays the correct value '123'.
I only need the time between the two events and output it from the board to anywhere, as long as I can get the value. I would really appreciate any assistance in this regard.
Best Regards.
I am new on this forum and would like to get some assistance with a vhdl program I am writing.
I am using an Altera DE2 development and education board together with the Altera Quartus II v.7.1 software. I would like to determine the time elapsed between two events. Either my time determination isn't working or I just cannot output the value to anywhere. The two processes that should determine the time is below:
-- Process that determines whether the signal is back or not
count_clk_cycles: PROCESS (output_xcorr, load, EXT_CLOCK)
VARIABLE counter : INTEGER := 5;
VARIABLE str_counter : STRING(1 TO 6) := "000111";
BEGIN
IF (loaded = '1' AND xcorr = '0') THEN
counter := counter + 1;
END IF;
IF (loaded = '1' AND xcorr = '1') THEN
str_counter := fix(INTEGER'IMAGE(counter));
display(str_counter);
END IF;
END PROCESS;
-- Process that determines the state of the entire process.
set_state : PROCESS(load, loaded, output_xcorr, xcorr, EXT_CLOCK)
BEGIN
IF (load = '1') THEN
loaded <= '1';
END IF;
IF (output_xcorr = '1') THEN
xcorr <= '1';
END IF;
IF (loaded = '1' AND xcorr = '1') THEN
loaded <= '0';
xcorr <= '0';
END IF;
END PROCESS;
Let me describe the project a little. When the 'load' signal is high, a code is loaded into a shift register and sent out. The code is then received back and cross-correlated with the original to produce the output, 'output_xcorr'. I would like to determine the time from which the code is loaded until cross-correlation is successful.
The 'display' function displays the value of counter on a 7-segment display, but this isn't working. It only displays zero. When I however give counter a value like 'counter := 123', then it displays the correct value '123'.
I only need the time between the two events and output it from the board to anywhere, as long as I can get the value. I would really appreciate any assistance in this regard.
Best Regards.