EDA 实验报告实验一:译码器及计数器设计实验 1 、实验目的 1 )复习二进制译码器的功能。 2 )学习 VHDL 语言源程序输入方法。 3) 学习 VHDL 语言源程序检查和修改。 4 )掌握用 VHDL 语言设计一个 3线-8 线译码器和六十进制计数器的方法。 5 )掌握 VHDL 语言编辑器的基本操作。 2 、实验内容 1 )本实验给出了有错误的 3线—8 线译码器的 VHDL 程序,请采用 VHDL 编辑器,修改调试程序。 2) 采用 VHDL 设计方法, 设计一个 60 进制计数器, 采用 BCD 码输出。 3、实验步骤(一)、3—8 译码器 1、分析 3—8 译码器原理, 设计相应端口以及信号输入输出变量等。 2、其中 A、B、C 为三位二进制代码输人端。 Y0-Y7 是八个输出端, G1 、 G2A 、 G2B 为三个输入控制端。只有当 G1 =1, G2A = 0,G2B =0时, 译译码器才处于工作状态。否则、译码器将处在禁止状态,所有输出端全为高电平。 3、输入输出 G1 G2 CBAY7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 0XXXXX11111111 X1XXXX11111111 XX1XXX11111111 10000011111110 10000111111101 10001011111011 10001111110111 100********** 100********** 100********** 100********** (二)、设计一个 60 进制计数器,采用 BCD 码输出。 1) BCD 码:用 4 位二进制数编码表示 1 位十进制数 2) 一个十进制计数器即为一个 4 位二进制计数器, 若将两个 4 位二进制计数器连接起来就可构成 100 进制以内的计数器。实验程序 1、 3-8 译码器 library IEEE ;use IEEE .STD_LOGIC_1164 .ALL ; use IEEE .STD_LOGIC_ARITH .ALL ; use IEEE .STD_LOGIC_UNSIGNED .ALL ; -- ment the following lines to use the declarations that are -- provided for instantiating Xilinx ponents. --library UNISIM; --use ; entity 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<= "00000001" ; when "001" =>Y<= "00000010" ; when "010" =>Y<= "00000100" ; when "011" =>Y<= "00001000" ; when "100" =>Y<= "00010000" ; when "101" =>Y<= "00100000" ; when "110" =>Y<= "01000000" ; when "111" =>Y<= "10000000" ; when others => null ; end case ;else Y<= "11111111" ; end if ;end process ;end Behavioral; 仿真结果: 2. 60 进制计数器实验程序: library IEEE; use ; use ; use ; -- ment the following lines to use the declarations that are -- provided for instantiating Xilinx ponents. --library UNISIM; --use ; entity jishuqi is port(clk:in std_logic
EDA实验报告 来自淘豆网m.daumloan.com转载请标明出处.