-- +-----------------------------+ -- | Copyright 1997 DOULOS | -- | Library: RadioComms | -- | designer : Tim Pagden | -- | opened: 23 Apr 1997 | -- +-----------------------------+ -- Architectures: -- 23.04.97 both_edges -- PASSED SIMULATION 23.04.97 first time! architecture both_edges of spectrum_spreader is signal state_pos : std_ulogic; signal state_neg : std_ulogic; signal state_toggle : std_ulogic; begin SVR_pos : process (clock, reset) -- this flip-flop toggles when state_neg is 1 during state_toggle HIGH -- but then toggles on each clock when state_toggle is LOW begin if reset = '1' then state_pos <= '0'; elsif clock'event and clock='1' then if state_toggle = '1' then if state_neg = '1' then state_pos <= not state_pos; end if; else -- state_toggle = '0' state_pos <= not state_pos; end if; end if; end process; SVR_neg : process (clock, reset) -- this is simply a toggle flip-flop with reset begin if reset = '1' then state_neg <= '0'; elsif clock'event and clock='0' then state_neg <= not state_neg; end if; end process; fsm_toggle : process (state_neg, reset) -- toggles on the +ve edge of state_neg when state_pos LOW begin if reset = '1' then state_toggle <= '0'; elsif state_neg'event and state_neg='1' then if state_pos = '0' then state_toggle <= not state_toggle; end if; end if; end process; output: spread_data <= (state_pos xor state_neg) xor RF_data; end both_edges;