优先级编码器.vhd

来自「含有各类寄存器」· VHDL 代码 · 共 33 行

VHD
33
字号
--Highest Priority Encoderentity priority isport(I : in bit_vector(7 downto 0); --inputs to be prioritisedA : out bit_vector(2 downto 0); --encoded outputGS : out bit); --group signal outputend priority;architecture v1 of priority isbeginprocess(I)beginGS <= '1'; --set default outputsA <= "000";if I(7) = '1' thenA <= "111";elsif I(6) = '1' thenA <= "110";elsif I(5) = '1' thenA <= "101";elsif I(4) = '1' thenA <= "100";elsif I(3) = '1' thenA <= "011";elsif I(2) = '1' thenA <= "010";elsif I(1) = '1' thenA <= "001";elsif I(0) = '1' thenA <= "000";elseGS <= '0';end if;end process;end v1;

⌨️ 快捷键说明

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