77范文网 - 专业文章范例文档资料分享平台

数字逻辑电路课程设计报告江苏大学(2)

来源:网络收集 时间:2020-02-21 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

3. 二路选择器的设计: VHDL语言描述:

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all;

entity dex2 is

port(panduan,wubai,yiqian:instd_logic; shuchu:outstd_logic); end entity dex2;

architecture behave of dex2 is begin

process(panduan,wubai,yiqian) begin

if(panduan='0') then shuchu<=wubai;

//当panduan为0时,输出wubai端口的输入

else shuchu<=yiqian;//否则shuchu端口输出yiqian的端口输入 end if; end process; end behave;

4. 分频器的设计: VHDL语言描述:

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fenpin is

port(clk:instd_logic;

hz1,hz4,hz64,hz512:out std_logic); end entity fenpin;

architecture behavior of fenpin is

signal q:std_logic_vector(9 downto 0); begin process(clk) begin

if(rising_edge(clk)) then q<=q+1;

6

end if;

end process; hz1<=q(9); hz4<=q(7); hz64<=q(3); hz512<=q(0);

end behavior;//将1KHz分为1Hz、4Hz、64Hz、512Hz输出

5. 动态扫描的设计: VHDL语言描述:

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;

entity dtsm is

port( clk:instd_logic;

s:in std_logic_vector(7 downto 0); m:in std_logic_vector(7 downto 0); h:in std_logic_vector(7 downto 0); ledag:outstd_logic_vector(6 downto 0); sel:outstd_logic_vector(2 downto 0)); end dtsm;

architecture behave of dtsm is

signal out1:std_logic_vector(3 downto 0);

signal sel1:std_logic_vector(2 downto 0); begin

p1:process(clk) begin

if rising_edge(clk) then //当有一个上升沿脉冲 sel1<=sel1+1;//sel自增1 end if; sel<=sel1;

end process p1;

p2:process(sel1,s,h,m)

begin

7

case sel1 is

when \//扫描数码管的第二位,即h的十位 when \//扫描数码管的第一位,即h的十位 when \//扫描数码管第四位,即m的个位 when \ //扫描数码管第三位,即m的十位 when \ //扫描数码管第七位,即s的个位 when \//扫描数码管第六位,即s的十位 when others=>out1<=\ end case;

end process p2;

p3:process(out1)

begin

case out1 is

when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \;

//将0~9翻译显示在七段数码管上

when others=>ledag<=\;

//当不是0~9时,不显示

end case;

end process p3; end behave;

6. 整点报时功能的设计: VHDL语言描述:

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;

8

entity zdbs is

port( s:in std_logic_vector(7 downto 0); m:in std_logic_vector(7 downto 0); shuchu,panduan:outstd_logic); end entity zdbs;

architecture behave of zdbs is begin

p1:process(s,m) begin

if(((\downto 0))and(\downto 4))and(\downto 4))and s(3 downto 0)=\

((\downto 0))and(\downto 4))and(\downto 4))and s(3 downto 0)=\

((\downto 0))and(\downto 4))and(\downto 4))and s(3 downto 0)=\

((\downto 0))and(\downto 4))and(\downto 4))and s(3 downto 0)=\

((\downto 0))and(\downto 4))and(\downto 4))and s(3 downto 0)=\

//当分钟为59分,且秒钟为50秒、52秒、54秒、56秒、58秒时, panduan输出1,shuchu输出0(即低音报时)

elsif((\downto 0))and(\downto 4))and(\downto 4))and s(3 downto 0)=\//当分钟和秒钟都为0,即整点时,panduan输出1, shuchu输出1(即高音报时)

else panduan<='0';//否则panduan输出0,即不报时 end if;

end process; end behave;

7. 选择显示与闹钟设置的设计: VHDL语言描述:

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;

entity nz is

port( shuru:instd_logic;

ndm:instd_logic_vector(7 downto 0); ndh:instd_logic_vector(7 downto 0);

9

m:in std_logic_vector(7 downto 0); h:in std_logic_vector(7 downto 0); outh:outstd_logic_vector(7 downto 0); outm:outstd_logic_vector(7 downto 0); shuchu:outstd_logic); end nz;

architecture behave of nz is begin

process(shuru,ndm,ndh,m,h) begin

if(shuru='0')then outm(7 downto 0)<=m(7 downto 0);outh(7 downto 0)<=h(7 downto 0);

//如果shuru等于0,则输出显示现在时间

if(ndm(7 downto 0)=m(7 downto 0)and ndh(7 downto 0)=h(7 downto 0))then shuchu<='1';

//如果现在时间和设定的闹钟时间相等,则shuchu输出1(闹钟响) else shuchu<='0'; //否则shuchu输出0(闹钟不响) end if;

else outm(7 downto 0)<=ndm(7 downto 0);outh(7 downto 0)<=ndh(7 downto0);shuchu<='0';

//如果shuru等于1,则输出显示闹钟的时间 end if; end process; end behave;

四、顶层图

10

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库数字逻辑电路课程设计报告江苏大学(2)在线全文阅读。

数字逻辑电路课程设计报告江苏大学(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/jiaoyu/769757.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: