文档详情

eda第8章 VHDL与原理图层次型混合设计.ppt

发布:2018-01-11约5.42千字共52页下载文档
文本预览下载声明
第8章 VHDL与原理图层次型混合设计 【学习目标】 通过本章学习应掌握EDA技术中的模块化设计方法、利用VHDL与原理图自底向上和自顶向下混合设计方法。 8.1 自底向上混合设计 简易时钟计数电路设计 1. 时钟计数电路结构图 时钟电路的组成由两个模为60的计数器和一个模为12的计数器构成 2.模块电路的VHDL描述 采用混合设计输入方法,先建立两个VHDL文本文件,分别将模为60的8421BCD计数器和模为12的计数器代码输入,然后再建立顶层原理图文件。 (1)模为60的BCD计数器的VHDL设计代码如下: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity counter_60 is port( en:in std_logic; clear:in std_logic; clk:in std_logic; count:out std_logic; qh:buffer std_logic_vector(3 downto 0); ql:buffer std_logic_vector(3 downto 0)); end; if(en=1)then if(ql=9)then ql=0000; if(qh=5)then qh=0000; ql=“0000”; else qh=qh+1; end if; else ql=ql+1; end if; end if; end if; end process; end; library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity counter_12 is port( en:in std_logic; clear:in std_logic; clk:in std_logic; count:out std_logic; qh:buffer std_logic_vector(3 downto 0); ql:buffer std_logic_vector(3 downto 0)); end; architecture str of counter_12 is begin count=1 when(qh=0001 and ql=0010 and en=1) else 0; process(clk,clear) begin if(clear=0)then qh=0000; ql=0000; elsif(clkevent and clk=1) then if(en=1)then if(ql=9) then ql=0000; qh=“0001”; else ql=ql+1; end if; if(qh=1)then if(ql=2)then qh=0000; ql=0000; else ql=ql+1; end if; end if; end if; end if; end process; end; (3)顶层原理图设计 4.编译和仿真 编译工程文件,建立仿真波形文件后完成仿真 思考 如何用8段LED数码管显示? 8.2
显示全部
相似文档