sel.vhd

来自「停车场显示是日常生活中使用很平常的系统」· VHDL 代码 · 共 28 行

VHD
28
字号
-----------------------------------------------------------------------
--该模块实现在停车场有汽车时,对8×8点阵的列选信号的确定
--本设计中列选信号是每过一个时钟周期就变化一次的
--通过这种快速的扫描实时输出停车场状态信息(即有没有有汽车进出)
-----------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity sel is
	port(
		clk: in std_logic;
		q  : out std_logic_vector(2 downto 0)
		);
end sel;

architecture sel of sel is
begin
	process(clk)
	variable cnt:std_logic_vector(2 downto 0);
	begin
		if clk'event and clk='1' then
			cnt:=cnt+1;
		end if;
		q<=cnt;
	end process;
end sel;

⌨️ 快捷键说明

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