---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- The Marienbad Game -- EE 552 Project -- Group Members: Koziar, Kory -- McDermott, Ashley -- Stangeland, Duane -- -- File : HV_Time.vhd ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- The following file was modified from the original, but only in that this -- section was remove from the display process in MIPS and is now a module -- of its own. -- MIPS can be found at: -- http://www.ee.gatech.edu/users/hamblen/ALTERA/altera.htm ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- HV_Time is the file that is used to generate the horizontal and vertical -- synchronous signals used to display information to the screen. ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- library ieee; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; entity HV_Time is port( signal Clock : in std_logic; signal Power_On : in std_logic; signal Horiz_sync : out std_logic; signal Vert_sync : out std_logic; signal Video_on_H : out std_logic; signal Video_on_V : out std_logic; signal Pixel_Col_Count : buffer std_logic_vector(5 Downto 0); signal Pixel_Row_Count : buffer std_logic_vector(5 Downto 0); signal Col_Address : buffer std_logic_vector(5 Downto 0); signal Row_Address : buffer std_logic_vector(5 Downto 0) ); end HV_Time; architecture Behavior of HV_Time is signal F_count : std_logic_vector(4 Downto 0); signal H_count : std_logic_vector(9 Downto 0); signal V_count : std_logic_vector(9 Downto 0); constant H_max : std_logic_vector(9 Downto 0) := CONV_STD_LOGIC_VECTOR(799,10); constant V_max : std_logic_vector(9 Downto 0) := CONV_STD_LOGIC_VECTOR(524,10); begin VIDEO_DISPLAY: Process Begin Wait until(Clock'Event) and (Clock='1'); If Power_on = '0' Then Video_on_H <= '0'; Video_on_V <= '0'; H_count <= CONV_STD_LOGIC_VECTOR(654,10); V_count <= CONV_STD_LOGIC_VECTOR(493,10); Else If (H_count >= H_max) then H_count <= To_Stdlogicvector(B"0000000000"); Else H_count <= H_count + To_Stdlogicvector(B"0000000001"); End if; If (H_count <= CONV_STD_LOGIC_VECTOR(755,10)) and (H_count >= CONV_STD_LOGIC_VECTOR(659,10)) Then Horiz_Sync <= '0'; ELSE Horiz_Sync <= '1'; End if; If (V_count >= V_max) and (H_count >= CONV_STD_LOGIC_VECTOR(699,10)) then V_count <= To_Stdlogicvector(B"0000000000"); Else If (H_count = CONV_STD_LOGIC_VECTOR(699,10)) Then V_count <= V_count + To_Stdlogicvector(B"0000000001"); End if; End if; If (V_count <= CONV_STD_LOGIC_VECTOR(494,10)) and (V_count >= CONV_STD_LOGIC_VECTOR(493,10)) Then Vert_Sync <= '0'; ELSE Vert_Sync <= '1'; End if; If (H_count <= CONV_STD_LOGIC_VECTOR(639,10)) Then video_on_H <= '1'; If pixel_col_count < CONV_STD_LOGIC_VECTOR(15,6) Then pixel_col_count <= pixel_col_count + '1'; Else pixel_col_count <= "000000"; col_address <= col_address + '1'; End if; ELSE video_on_H <= '0'; pixel_col_count <= "000000"; col_address <= "000000"; End if; IF(H_COUNT = CONV_STD_LOGIC_VECTOR(641,10)) Then pixel_row_count <= pixel_row_count + '1'; If (pixel_row_count = CONV_STD_LOGIC_VECTOR(15,6)) THEN pixel_row_count <= "000000"; row_address <= row_address + '1'; End if; End if; If (V_count <= CONV_STD_LOGIC_VECTOR(479,10)) Then video_on_V <= '1'; ELSE video_on_V <= '0'; pixel_row_count <= "000000"; row_address <= "000000"; End if; If (V_count = CONV_STD_LOGIC_VECTOR(0,10)) and (H_count = CONV_STD_LOGIC_VECTOR(0,10)) then If (F_count = CONV_STD_LOGIC_VECTOR(30,5)) then F_count <= To_Stdlogicvector(B"00000"); Else F_count <= F_count + To_Stdlogicvector(B"00001"); End if; End if; End if; end process VIDEO_DISPLAY; end Behavior;