nsgil85
Member level 4
Hi all
I wrote a simple dff procedure inside package as shown below.....
(procedure called from process outside)
Is there any way to "save" signal inside the procedure so i can create simple edge detection (with "not" and "and" operators)
something like this:
Thanks
Gil
I wrote a simple dff procedure inside package as shown below.....
Code VHDL - [expand] 1 2 3 4 5 6 procedure dff(signal clock : in std_logic ; signal input_signal : in std_logic ; signal output_signal : out std_logic) is begin if rising_edge(clock) then output_signal <= input_signal; end if ; end procedure dff;
(procedure called from process outside)
Is there any way to "save" signal inside the procedure so i can create simple edge detection (with "not" and "and" operators)
something like this:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 procedure edge_detection(type_of_edge : string ; signal clock : in std_logic ; signal input_signal : in std_logic ; signal output_signal : out std_logic) is signal sig_sampled : std_logic ; -- signal NOT ALLOWED begin if rising_edge(clock) then sig_sampled := input_signal; end if ; if type_of_edge = "pos" then output_signal <= (not sig_sampled) and input_signal ; elsif type_of_edge = "neg" then output_signal <= (not input_signal) and sig_sampled ; end if ; end procedure edge_detection ;
Thanks
Gil