-------------------------------------------------------------------------------
-- Title       : burst_phase
-------------------------------------------------------------------------------
-- File        : burst_phase.vhd
-- Author      : Frederic Lochon
-------------------------------------------------------------------------------
-- Description :
-- generation de la phase pour porteuse du colorburst
-- 0-1024 <=> 0-360°
-- 0 = 0°
-- 1023 = 359,6484375°
--
-- à chaque coup de clock: 59,115° (pour 37,037ns)
--
-------------------------------------------------------------------------------
-- Modification history :
-- 2006/08/27 : created
-------------------------------------------------------------------------------

LIBRARY ieee, work;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_unsigned.all;

ENTITY burst_phase IS
	PORT (
		clock		: in std_logic;
		reset		: in std_logic;
		phase		: OUT std_logic_vector(9 downto 0)
	);
END burst_phase ;

ARCHITECTURE dto OF burst_phase IS 

	signal int_phase: std_logic_vector(31 downto 0);

	BEGIN

	phase <= int_phase(31 downto 22);

	counter : process (clock, reset)
	begin
		if reset = '1' then
			int_phase <= "11000000000000000000000000000000";
		elsif rising_edge(clock) then
			int_phase <= int_phase + "00101010000010011000101011001011"; -- 705268427
		end if;
	end process;

end dto;

