kcinimod
Member level 3
no. Im not talking about code.
A synchronised data signal will be a double registered version of data to avoid meta-stability, assuming its completly asynchronous to the clock (if its synchronous to the clock, then there is no problem.)
You need to do something like this:
Code:signal data_sync : std_logic_vector(1 downto 0); process(clk) begin if rising_edge(clk) then data_sync <= data_sync(0) & data; end if; end process; count_proc : processs(clk) begin if rising_edge(clk) then if data_sync(1) = '1' then count <= count + 1; end if; end if; end process;
Making a process sensitive to data just means you're creating logic sensitive to the data signal (probably without registers). The above code synchronises the data signal and then uses that to measure the time its high for.
sorry for being troublesome, but do you mind explaining the above code ?