latches.vhd
来自「多个Verilog和vhdl程序例子」· VHDL 代码 · 共 35 行
VHD
35 行
library ieee;
use ieee.std_logic_1164.all;
entity latches is
port (data, clk, rst, set : in std_logic;
-- note: VHDL allows outputs to be read
-- inside the architecture, only if they are
-- declared as mode "buffer"
q, qr, qs, qrs: buffer std_logic);
end latches;
architecture behave of latches is
begin
-- regular latch (no set or reset)
q <= data when clk = '1' else q;
-- latch with reset
qr <= '0' when rst = '1' else
data when clk = '1' else qr;
-- latch with set
qs <= '1' when set = '1' else
data when clk = '1' else qs;
-- latch with reset and set
qrs <= '0' when rst = '1' else
'1' when set = '1' else
data when clk = '1' else qrs;
end behave;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?