-- Interactive Audio Manipulation Processor -- -- file: count_xy.vhd -- status: simulated - no known bugs -- -- author: see reference [7] -- -- Except for this header, this file is a verbatim copy of count_xy.vhd -- from the EE552 Dicerace project application notes. See References section -- of report (reference [7]) and this URL: -- http://www.ee.ualberta.ca~elliott/ee552/studentAppnotes/1998_w/dicerace_video_display/ LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.all; USE IEEE.STD_LOGIC_ARITH.all; USE IEEE.STD_LOGIC_UNSIGNED.all; ENTITY count_xy IS PORT( clock : in STD_LOGIC; countX,countY : out STD_LOGIC_VECTOR(9 downto 0); HSync,VSync : in BOOLEAN ); END count_xy; ARCHITECTURE counting of count_xy IS SIGNAL countlocX, countlocY : STD_LOGIC_VECTOR( 9 downto 0); --SIGNAL HSync,VSync : BOOLEAN; -------------------------------------------------------------------------------------------- BEGIN counting: process(clock) BEGIN IF clock'EVENT and clock = '1' THEN IF HSync THEN countlocX <= "0000000000"; ELSE countlocX <= countlocX + '1'; END IF; IF VSync THEN countlocY <= "0000000000"; ELSIF HSync THEN countlocY <= countlocY + '1'; END IF; countX <= countlocX; countY <= countlocY; END IF; END process counting; -------------------------------------------------------- END counting;