A structural VHDL model for the pedestrian crossing controller discussed in lectures is given in the file pedxv1.vhd:
-- ENGN3213, pedxv1.vhd -- Name: MRJ, 24/11/00 -- structural implementation of PEDX controller library ieee; use ieee.std_logic_1164.all; entity pedx is port(w, reset, clock : in std_logic; green, yellow, red, halt : out std_logic; walk : inout std_logic); end pedx; architecture pedx_arch of pedx is component jkffv is port (CLOCK: in STD_LOGIC; J: in STD_LOGIC; K: in STD_LOGIC; P: in STD_LOGIC; Q: inout STD_LOGIC; QN: inout STD_LOGIC); end component; signal ja, ka, jb, kb, a, an, b, bn : std_logic; begin ja <= b; ka <= b; jb <= a or w; kb <= '1'; jka: jkffv port map(clock, ja, ka, reset, a, an); jkb: jkffv port map(clock, jb, kb, reset, b, bn); green <= an and bn; yellow <= an and b; red <= a; walk <= a and bn; halt <= not walk; end pedx_arch;
In this structural VHDL code, the JK flip flop of section 5.4 is used as a component.
ANU Engineering - ENGN3213