Nicolas Matringe wrote:
> I have come up with this, which looks like a dual-edge FF but with some
> limitations:
Hmmm ... 3 flipflops for dual-edge behavior?
What about
--------------------------------
signal reset,clk,D,ff_rise,ff_fall,de_dff : std_ulogic;
process(reset,clk)
begin
if (reset='1') then
ff_rise<='0';
elsif rising_edge(clk) then
ff_rise<=ff_fall XOR D;
end if;
end process;
process(reset,clk)
begin
if (reset='1') then
ff_fall<='0';
elsif falling_edge(clk) then
ff_fall<=ff_rise XOR D;
end if;
end process;
de_dff<=ff_rise XOR ff_fall;
--------------------------------
I call this thing a "pseudo dual-edge D-flipflop" (de_dff).
In real life one will not use plain D-flipflop behavior, but something like
process(reset,clk)
begin
if (reset='1') then
ff_rise<='0';
elsif rising_edge(clk) then
if (ff_fall='1' AND state=some_state AND some_signal='1') then
ff_rise<=some_other_signal;
else -- and so on...
end if;
end if;
end process;
I used this pseudo dual-edge flipflop for generating a manchester coded
output signal (everytime a transition at the begin of a bit and
additionally a transition in the middle of the bit, if a '0' is
transferred). It was very helpful for a low-power solution.
Ralf
|