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

📄 hw3.vhd

📁 设计一个模块
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
--use ieee.std_logic_arith.all;

entity code_stream is
generic(for_detec:std_logic_vector:="11100");
port(clk:in std_logic;
	 reset:in std_logic;
	 datain:in std_logic;
	 pmatch:out std_logic);
end code_stream;

architecture arch_code_stream of code_stream is
signal stream:std_logic_vector(4 downto 0);
signal i:integer:=0;
begin
	process(clk,reset)
	begin
		if reset='1' then
			pmatch<='0';
			stream<="00000";
			i<=0;
		elsif clk'event and clk='1' then
			stream(4)<=stream(3); 
			stream(3)<=stream(2);
			stream(2)<=stream(1);
			stream(1)<=stream(0);
			stream(0)<=datain;
			if i<10 then
				i<=i+1;
			end if;			
		end if;
		if  i>4 and stream=for_detec then
			pmatch<='1';
		else
			pmatch<='0';
		end	if;

		
	end process;
	

	
	
	
	
end arch_code_stream;

⌨️ 快捷键说明

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