------------------------------------------- -- EE552 Automatic Volume Control -- Display controller -- Created Mar 10, 2000 by Travis Robinson ------------------------------------------- -- used to test the display ------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; package avc_pack is component max_min port( rst, clk, max_sel, min_sel, incr, decr: in std_logic; max_vol, min_vol: buffer std_logic_vector(7 downto 0); count_out: out std_logic_vector(13 downto 0) ); end component; component amp_calc port( clk: in std_logic; noise_in: in std_logic_vector(7 downto 0); maxvol, minvol: in std_logic_vector(7 downto 0); ampcalc_out: out std_logic_vector(7 downto 0); count_out: out std_logic_vector(13 downto 0) ); end component; end package; library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; library work; use work.avc_pack.all; entity display_controller is port(reset,clock: in std_logic; max_sel,min_sel,incr,decr:in std_logic; max_vol,min_vol:buffer std_logic_vector(7 downto 0); display_out: out std_logic_vector(13 downto 0); amp_out:buffer std_logic_vector( 7 downto 0) ); end entity; architecture disp of display_controller is signal max_min_display,amp_display: std_logic_vector(13 downto 0); signal out_noise: std_logic_vector(7 downto 0); begin process (reset) begin if reset='0' then out_noise<="00000000"; else out_noise <=out_noise; end if; end process; maxmin1: max_min port map( rst=> reset, clk=> clock, max_sel=>max_sel, min_sel=>min_sel, incr=> incr, decr=>decr, max_vol=> max_vol, min_vol=> min_vol, count_out=> max_min_display ); ampcalc1: amp_calc port map( clk=> clock, noise_in=> out_noise, maxvol=> max_vol, minvol=> min_vol, ampcalc_out=> amp_out, count_out=> amp_display ); process(clock) begin if rising_edge(clock) then if max_sel ='0' or min_sel = '0' then display_out<= max_min_display; else display_out<= amp_display; end if; end if; end process; end architecture;