1.思路
利用2输入端与非门元件,设计4输入端的与非与非电路
1.1
1.2
1.3
2.实现过程
2.1 设计2输入端与非门
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13library ieee; use ieee.std_logic_1164.all; entity nd2 is port(a,b : in std_logic; c : out std_logic); end nd2; architecture nd2bahave of nd2 is begin c <= a nand b; end nd2bahave;
2.2 将设计的元件声明装入my_pkg程序包中(完成元件的“封装”)
复制代码
1
2
3
4
5
6
7
8
9
10library ieee; use ieee.std_logic_1164.all; package my_pkg is component nd2 --元件声明 port (a,b : in std_logic; c : out std_logic); end component; end my_pkg;
2.3 用原件例化产生电路(完成电路板上的元件“插座”的定义)
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22library ieee; use ieee.std_logic_1164.all; entity ord41 is port (a1,b1,c1,d1 : in std_logic; z1 : out std_logic); end ord41; architecture ord41behave of ord41 is --元件例化 signal x,y : std_logic; component nd2 --元件声明 port (a,b : in std_logic; c : out std_logic); end component; begin u1 : nd2 port map (a1,b1,x); --位置关联方式:表达式(信号)必须与元件声明语句中的端口顺序一致 u2 : nd2 port map (a => c1, --名字关联方式 b => d1,c => y); u3 : nd2 port map (x,y,c => z1); --混合关联方式 end ord41behave;
3.注意:被调用的模块,要将其vhd文件放入调用者的文件中
最后
以上就是开放小馒头最近收集整理的关于VHDL——设计4输入端的与非与非电路(元件例化)的全部内容,更多相关VHDL——设计4输入端内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复