码迷,mamicode.com
首页 > 其他好文 > 详细

FPGA学习系列 各种门器件程序积累

时间:2017-10-09 22:37:53      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:nand   arch   pga   积累   es2017   bsp   nbsp   com   png   

1. 两输入与(and)门

技术分享

 

entity and2gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end and2gate;

architecture Behavioral of and2gate is

begin
z <= x and y;

end Behavioral;

2.两输入或(or)门

技术分享

entity or2gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end or2gate;

architecture Behavioral of or2gate is

begin
z <= x or y;

end Behavioral;

3.一输入非(not)门

技术分享

 

 

entity notgate is
Port ( x : in STD_LOGIC;
y : out STD_LOGIC);
end notgate;

architecture Behavioral of notgate is

begin
y <= not x;

end Behavioral;

2.两输入与非(nand)门

技术分享

entity nand2gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end nand2gate;

architecture Behavioral of nand2gate is

begin
z <= x nand y;

end Behavioral;

5.两输入或非(nor)门

技术分享

entity nor2gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end nor2gate;

architecture Behavioral of nor2gate is

begin
z <= x nor y;

end Behavioral;

 

6.两输入异或(xor)门

 技术分享

entity xor2gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end xor2gate;

architecture Behavioral of xor2gate is

begin
z <= x xor y;

end Behavioral;

6.两输入异或(xnor)门

 技术分享

 

 

entity xnor2gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end xnor2gate;

architecture Behavioral of xnor2gate is

begin
z <= x xnor y;

end Behavioral;

FPGA学习系列 各种门器件程序积累

标签:nand   arch   pga   积累   es2017   bsp   nbsp   com   png   

原文地址:http://www.cnblogs.com/panlangen/p/7642936.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!