t_procedure.vhd
来自「FPGA开发光盘各章节实例的设计工程与源码」· VHDL 代码 · 共 34 行
VHD
34 行
--4.15 过程(Procedure)
--下面还是用例子来说明其具体使用方法。
library ieee;
use ieee.std_logic_1164.all;
entity t_procedure is
port(
clk : in std_loigc;
A : in std_logic;
C : out std_logic
);
end t_procedure;
architecture behave of t_procedure is
procedure increment(
signal clk : std_logic;
signal din : std_logic;
signal dout : out std_logic) is
begin--过程可执行部分
if(clk'event and clk='1') then
dout<=din+'1';
end if;
end increment;
begin --结构体可执行部分
increment(A,clk,C);--调用上面定义的过程
end behave;
--注意:不要将VHDL中的"过程"(Procedure)和"进程"(Process)混淆。
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?