1、译码
将n位的编码转换为m位的编码,每一个有效的输入编码产生唯一一个输出编码,并且有n≤m≤2n。实现译码功能的电路称为译码器。
2、真值表
A2A1A0 | D0D1D2D3D4D5D6D7 |
---|---|
000 | 10000000 |
001 | 01000000 |
010 | 00100000 |
011 | 00010000 |
100 | 00001000 |
101 | 00000100 |
110 | 00000010 |
111 | 00000001 |
3、电路图
非层次化设计
层次化设计
4、代码
library ieee;
use ieee.std_logic_1164.all;
entity threetoeight is
port(A:in std_logic_vector(2 downto 0);
D:out std_Logic_vector(0 downto 7));
end threetoeight;
architecture heihei of threetoeight is
signal D1:std_logic_vector(0 downto 7);
begin
D1<="10000000"when A="000" else
"01000000"when A="001" else
"00100000"when A="010" else
"00010000"when A="011" else
"00001000"when A="100" else
"00000100"when A="101" else
"00000010"when A="110" else
"00000001"when A="111" else
"00000000";
D<=D1;
end heihei;
来源:oschina
链接:https://my.oschina.net/u/4443770/blog/3164501