实验背景:3-8 译码器(3 to 8 Demultiplexer),也叫 3-8 解码器
用途:用一组二进制代码来产生各种独立的输出信号,这种输出信号可以用来执行不同的工作。显示器中的像素点受到译码器的输出控制。
逻辑框图:用逻辑符号(Symbol)来解释该电路输入与输出信号之间的逻辑关系,既省事又直观。
VHDL代码:
Library IEEE;--库声明
USE IEEE.std_logic_1164.all;
ENTITY sanbayimaqi IS--实体
PORT(a,b,c:IN std_logic;
y0,y1,y2,y3,y4,y5,y6,y7:OUT std_logic);
END sanbayimaqi;
ARCHITECTURE one of sanbayimaqi is--结构体
SIGNAL out1,out2,out3,out4,out5,out6:std_logic;
BEGIN
out1<=(not a) and (not b);
out2<=(not a) and b;
out3<=a and (not b);
out4<=a and b;
out5<=c;
out6<=(not c);
y0<=out1 and out5;
y1<=out2 and out5;
y2<=out3 and out5;
y3<=out4 and out5;
y4<=out1 and out6;
y5<=out2 and out6;
y6<=out3 and out6;
y7<=out4 and out6;
END ARCHITECTURE one;
RTL视图: