📄 pack_pro.vhd
字号:
--************************************
--* PACKAGE PROCEDURE DECLARATION *
--************************************
library IEEE;
use IEEE.std_logic_1164.all;
PACKAGE PACK_PRO IS
procedure DEMUL4 (
signal D: in std_logic;
signal S: in std_logic_vector(1 downto 0);
signal Y: out std_logic_vector(0 to 3)
);
procedure DEMUL2 (
signal D: in std_logic;
signal S: in std_logic;
signal Y: out std_logic_vector(0 to 1)
);
end PACK_PRO;
PACKAGE BODY PACK_PRO IS
procedure DEMUL4 (
signal D: in std_logic;
signal S: in std_logic_vector(1 downto 0);
signal Y: out std_logic_vector(0 to 3)
) is
begin
case S is
when "00" => Y <= D & "111";
when "01" => Y <= '1' & D & "11";
when "10" => Y <= "11" & D & '1';
when others => Y <= "111" & D;
end case;
end DEMUL4;
procedure DEMUL2 (
signal D: in std_logic;
signal S: in std_logic;
signal Y: out std_logic_vector(0 to 1)
) is
begin
case S is
when '0' => Y <= D & '1';
when others => Y <= '1' & D;
end case;
end DEMUL2;
end PACK_PRO;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -