📄 1_4.txt
字号:
题目:
设计一个1对4分用器(输入:D ,输出: Y3 Y2 Y1 Y0,另有两个输入控制端S1与S0控制输出选择),真值表如图4。
S1 S0 Y3 Y2 Y1 Y0
0 0
0 1
1 0
1 1 D 1 1 0
1 D 1 1
1 1 D 1
1 1 1 D
本软件设计的目的和任务:1.使学生全面了解如何应用该硬件描述语言进行高速集成电路设计;2.通过软件安装环节、设计环节与仿真环节使学生熟悉XILINX PROJECT NAVIGATOR设计环境与MODEL SIM SE仿真工具;3. 通过对基本题、综合题的设计实践,使学生掌握硬件系统设计方法(自底向上或自顶向下),熟悉VHDL语言三种设计风格,并且培养学生应用VHDL语言解决实际问题的能力。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;
entity xg is
Port ( D : in std_logic;
S1 : in std_logic;
S0 : in std_logic;
Y : out std_logic_vector(3 downto 0));
end xg;
architecture Behavioral of xg is
signal sel : std_logic_vector(1 downto 0);
begin
sel<=S1&S0;
Y(0) <= D when sel = "00" else '1';
Y(1) <= D when sel = "10" else '1';
Y(2) <= D when sel = "01" else '1';
Y(3) <= D when sel = "11" else '1';
end Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -