--------------------------------------------- --Project Gump --Marc Binette --Ralph Nevins --Lambert Lo ---------------------------------------------- --servo_controller_8bithold.vhd --This holds an eight bit value(data) when load --is high. It has an asynchronous reset --input=> load(1bit), data(8bits), reset(1bit) --output=> hold_out(8bits) LIBRARY ieee; USE ieee.std_logic_1164.ALL; --entity declaration of a generic hold --default is 8 bits ENTITY servo_controller_8bithold IS GENERIC( holdwidth : positive := 8); PORT(load, reset : IN std_logic; data : IN std_logic_vector(holdwidth-1 DOWNTO 0); hold_out : BUFFER std_logic_vector(holdwidth-1 DOWNTO 0)); END servo_controller_8bithold; --behavioural discription of the 8bithold ARCHITECTURE behavioural OF servo_controller_8bithold IS BEGIN --process waits for load or reset hold :PROCESS(load, reset) IS BEGIN --if reset is high then hold_out is set to zero IF reset = '1' THEN hold_out <= (OTHERS => '0'); --if no reset but there is a rising edge of load then hold_out is --set equal to data ELSIF rising_edge(load) THEN hold_out <= data; END IF; END PROCESS hold; END behavioural;