Last updated at 10:00 am on 25th December 2020
Last updated at 10:00 am on 25th December 2020
ea项目总结报告
验一:译码器及计数器设计实验
1、实验目的
1)复习二进制译码器的功能。
2)学习VHDL语言源程序输入方法。
3) 学习VHDL语言源程序检查和修改。
4)掌握用VHDL语言设计一个3线-8线译码器和六十进制计数器的方法。
5)掌握VHDL语言编辑器的基本操作。
2、实验内容
1)本实验给出了有错误的3线—8线译码器的VHDL程序,请采用VHDL编辑器,修改调试程序。
2)采用VHDL设计方法,设计一个60进制计数器,采用BCD码输出。
实验步骤
(一)、3—8译码器
1、分析3—8译码器原理,设计相应端口以及信号输入输出变量等。
2、其中A、B、C为三位二进制代码输人端。Y0-Y7是八个输出端,G1、G2A、G2B为三个输入控制端。只有当G1=1,G2A=0,G2B=0时,译译码器才处于工作状态。否则、译码器将处在禁止状态,所有输出端全为高电平。
输 入
输 入
输 出
G1
G2B
C
B
A
Y7
Y6
Y5
Y4
Y3
Y2
Y1
Y0
0
X
X
X
X
X
1
1
1
1
1
1
1
1
X
1
X
X
X
X
1
1
1
1
1
1
1
1
X
X
1
X
X
X
1
1
1
1
1
1
1
1
1
0
0
0
0
0
1
1
1
1
1
1
1
0
1
0
0
0
0
1
1
1
1
1
1
1
0
1
1
0
0
0
1
0
1
1
1
1
1
0
1
1
1
0
0
0
1
1
1
1
1
1
0
1
1
1
1
0
0
1
0
0
1
1
1
0
1
1
1
1
1
0
0
1
0
1
1
1
0
1
1
1
1
1
1
0
0
1
1
0
1
0
1
1
1
1
1
1
1
0
0
1
1
1
0
1
1
1
1
1
1
1
(二)、设计一个60进制计数器,采用BCD码输出。
1)BCD码:用4位二进制数编码表示1位十进制数
2)一个十进制计数器即为一个4位二进制计数器,若将两个 4 位二进制计数器连接起来就可构成100进制以内的计数器。
实验程序
1、3-8译码器
library IEEE;
use Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use T138 is
port(A,B,C,G1,G2A,G2B:in std_logic;
Y:out std_logic_vector(7 downto 0));
end T138;
architecture Behavioral of T138 is
signal D_IN:std_logic_vector(2 downto 0);
begin
D_IN<=C&B&A;
process(D_IN,G1,G2A,G2B)
begin
if(G1='1'and G2A='0'and G2B='0') then
case D_IN is
when"000"=>Y<=;
when"001"=>Y<=;
when"010"=>Y<=;
when"011"=>Y<=;
when"100"=>Y<=;
when"101"=>Y<=;
when"110"=>Y<=;
when"111"=>Y<="";
when others=>null;
end case;
else Y<="";
end if;
end process;
end Behavioral;
仿真结果:
2. 60进制计数器
实验程序:
library IEEE;
use Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use jishuqi is
port(clk:in std_logic;
e