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


    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;

  • 相关阅读:
    js随机模块颜色
    可以随鼠标拖拽的div
    js动弹特效
    正则表达式-表单验证
    get你想象不到的技能
    文字列表滚动(文字轮播)
    jQuery
    jQuery中效果animate方法解决width是百分比出现的问题
    iscroll在谷歌浏览器中bug
    js倒计时 手机休眠时 时间不进行减少
  • 原文地址:https://www.cnblogs.com/panlangen/p/7642936.html
Copyright © 2020-2023  润新知