if hcnt < h_period then hcnt <= hcnt + 1; else hcnt <= (others => '0'); end if; end if; end process;
process(clk25M) --行同步 begin if (clk25M'event and clk25M = '1') then if (hcnt >= (h_data + h_front) and hcnt < (h_data + h_sync + h_front)) then hsync <= '0'; else hsync <= '1'; end if; end if; end process;
process(clk25M) --列扫描 begin if (clk25M'event and clk25M = '1') then if hcnt = (h_data + h_sync + h_front) then if vcnt < v_period then vcnt <= vcnt + 1; else vcnt <= (others => '0'); end if; end if; end if; end process;
process(clk25M) --列同步 begin if (clk25M'event and clk25M = '1') then if (vcnt >= (v_data + v_front) and vcnt < (v_data + v_sync + v_front)) then vsync <= '0'; else vsync <= '1'; end if; end if;