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

📄 d_flip_flop.vhd

📁 一些很好的FPGA设计实例
💻 VHD
字号:
--**                       D触发器

--文件名:D_flip_flop.vhd

--功  能:D触发器

--说  明:以拨盘开关作为数据输入端,用发光二极管来反映锁存的数据;

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

entity D_flip_flop is
    Port (clk : in std_logic;	  --时钟信号;
	       reset : in std_logic; --异步复位;
	       datain : in std_logic_vector(7 downto 0);  --输入数据;
			 cs  : out std_logic_vector(1 downto 0);  ----数码管、发光二极管片选信号;
			 q   : out std_logic_vector(7 downto 0) );--输出数据;
end D_flip_flop;

architecture Behavioral of D_flip_flop is

begin

cs<="01";       --选通发光二极管;

process(clk,reset)
begin
   if reset='0' then q<="00000000";
   elsif clk'event and clk='1' then
	   q<=datain;
   end if;
end process;

end Behavioral;

⌨️ 快捷键说明

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