简体   繁体   中英

VHDL Signal changes on the edge of two separate signals

I was looking at this post Flip-Flop triggered on the edge of two signals

I have a similar problem, my circuit will have one signal act as a "Start" and another as "End" to control a transmitter. The logic is something like this:

if (start) then 
    running <= true 
else if (end) then 
    running <= false

The solution provided by "Marty" answers this problem. In one of his replies, "giroy" said: "I realize this is not the best way of doing it, but that is outside my control and i'm stuck working with it"

I am new to VHDL and wondering what is a better way of implementing the problem above

You simply need a (clocked) RS-FF:

  • set = start
  • reset = end

Example code for a SR-FF:

process(Clock)
begin
  if rising_edge(Clock) then
    if (set = '1') then
      reg <= '1';
    elsif (reset = '1') then
      reg <= '0';
    end if;
  end if;
end process;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM