⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bin_onehot_decoder.vhd

📁 8051 VHDL IP Core
💻 VHD
字号:
---- Copyright (c) 2001 Koay Kah Hoe.  Permission to copy is granted-- provided that this header remains intact.  This code is provided-- with no warranties.---- Version : 1.0----------------------------------------------------------------------------------- Bin_Onehot_Decoder: Library module created by VHDL Module Generator---- Bin_Onehot_Decoderlibrary IEEE;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;entity Bin_Onehot_Decoder is	generic (		InWidth: integer:= 3	);	port (		BinIn: in UNSIGNED(InWidth-1 downto 0);		EN: in STD_LOGIC;		DecOut: out STD_LOGIC_VECTOR(2**InWidth-1 downto 0)	);end Bin_Onehot_Decoder;architecture Bin_Onehot_Decoder_arch of Bin_Onehot_Decoder isbegin	process (BinIn,EN)		constant len: INTEGER := 2**InWidth;		variable S:UNSIGNED (len-1 downto 0);		variable iA: integer range 0 to len-1;	begin		S := (others=>not('1'));		if EN = '1' then			iA := CONV_INTEGER(BinIn);			S(0) := '1';			for I in 0 to len-1 loop				if I < iA then					S := SHL(S,"1");					S(0) := not('1');				end if;			end loop;		end if;		DecOut <= CONV_STD_LOGIC_VECTOR(S,len);	end process;end Bin_Onehot_Decoder_arch;

⌨️ 快捷键说明

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