priority_encoder83.vhd
来自「计数器、频率计、优先编码器、数码管扫描电路、数据选择器」· VHDL 代码 · 共 25 行
VHD
25 行
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity priority_encoder83 is
port ( a: in std_logic_vector(7 downto 0);
b: out std_logic_vector(2 downto 0));
end priority_encoder83;
architecture a of priority_encoder83 is
begin
priority:process(a)
begin
b<="000";
for i in 7 downto 0 loop
if (a(i)='1') then
b<=to_stdlogicvector(i,3);
end if;
exit;
end loop;
end process;
end a;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?