switch.vhd

来自「VHDL实现循环码编码」· VHDL 代码 · 共 28 行

VHD
28
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity switch is
	port
	(	ch		:in  std_logic;
		i1		:in  std_logic;
		i2		:in  std_logic;
		o1		:out std_logic;
		o2		:out std_logic);
end switch;

architecture behave_switch of switch is
begin
	process
	begin
	if (ch='0') then
		o1<=i1 XOR i2;
		o2<='0';
	elsif (ch='1') then
		o1<='0';
		o2<=i1 XOR i2;
	end if;
	end process;
end behave_switch;

⌨️ 快捷键说明

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