myand.vhd

来自「《CPLD开发实例》的配套光盘文件」· VHDL 代码 · 共 24 行

VHD
24
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity myand is
GENERIC (sreg_width:integer:=8);                --n输入与门,n=sreg_width
port(indata:in std_logic_vector(sreg_width-1 downto 0);
	q :out std_logic);
end myand;
architecture rtl of myand is
signal z:std_logic_vector(sreg_width downto 0);
component myand1
port(a,b:in std_logic;
q :out std_logic);
end component;
begin
z(sreg_width)<='1';
g1:for i in sreg_width-1 downto 0 generate                 
	u1:myand1 port map(z(i+1),indata(i),z(i));    --由二输入与门构成多输入与门
end generate;
q<=z(0);
end rtl;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?