⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sinc_v.vhd

📁 simple thermometr in vhdl
💻 VHD
字号:
----------------------------------------------------------------------------------
-- Bufon, Ferluga
-- Progetto elettronica 2 FPGA
-- Termometro visualizzato su VGA
----------------------------------------------------------------------------------

--Blocco per il sincronismo verticale

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

--Dichiarazione variabili d'ingresso e di uscita:

entity sinc_v is
	Port (	
			clk : in std_logic;				
			vs : out std_logic;			
			blan: out std_logic;		
			lin : inout std_logic_vector (8 downto 0));  
end sinc_v;


architecture Behavioral of sinc_v is
-- Variabile interne
	signal count: std_logic_vector(9 downto 0);
begin
-- Processo sincronizzato su clk
A:	process (clk)
	begin					
		if (clk='1' and clk'event) then 		

			count<=count+1;						
			if (count=524) then						
				count<="0000000000";					
			end if;								
		end if;								
end process;

-- Processo sincronizzato su clk e reset
B:	process (clk)
	begin
							
	if (clk='1' and clk'event) then				
	-- nel caso di impulso di clock genera i segnali di sincronismo e abilita
	-- la scrittura delle linee dove necessario
			if (count >= 2 and count < 34) then					
				vs<='1';								
				blan<='0';							
			end if;								
			if (count >=34 and count <514) then		
				lin<=lin+"000000001";					
				blan<='1';							
			end if;								
			if (count >= 514 and count < 525) then		
				lin<="000000000";						
				blan<='0';							
			end if;								
			if (count < 2) then		
				blan<='0';							
				vs<='0';								
			end if;								
	end if;									
end process;															  
end Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -