myand.vhd

来自「收集的CPLD_FPGA很好的代码」· VHDL 代码 · 共 23 行

VHD
23
字号
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);
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 + -
显示快捷键?