coder42.vhd
来自「《CPLD_FPGA设计及应用》课件与实例」· VHDL 代码 · 共 22 行
VHD
22 行
library ieee;
use ieee.std_logic_1164.all;
entity coder42 is
port(inx:in std_logic_vector(3 downto 0);
y:out std_logic_vector(1 downto 0));
end coder42;
architecture bevcoder of coder42 is
begin
process(inx)
begin
if (inx(3)='1') then
y<="11";
elsif (inx(2)='1') then
y<="10";
elsif (inx(1)='1') then
y<="01";
else
y<="00";
end if;
end process;
end bevcoder;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?