版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 数字逻辑与数字系统课程设计 2013-12-15一、功能简介: 该课程设计的内容为数字时钟,能显示秒、分、时,且能在整点报时。时钟的变化在数码显像管中显示,因为时钟设计成60秒=1分,60分=1时,在整点报时时,过程太麻烦就做成15秒=1分,15=1时,这样在一会就回出现现象,更容易检查出对错。逢整点蜂鸣器在“15分钟的第11、13、秒发频率为512Hz的低音,在“15分钟的第15秒发频率为1024Hz的高音。 二、总体结构框图: 三、各模块框图:1、动态显示:八选一:library ieee; use ieee.std_logic_1164.all;ENTITY mux8_1 ISPORT
2、(d0,d1,d2,d3,d4,d5,d6,d7 : IN STD_LOGIC_VECTOR(3 DOWNTO 0); sel : IN STD_LOGIC_VECTOR(2 DOWNTO 0); y : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);END mux8_1;ARCHITECTURE rtl OF mux8_1 ISBEGIN PROCESS ( sel) BEGINCASE sel ISWHEN "000" =>y<=d0;WHEN "001" =>y<=d1;WHEN "010&qu
3、ot; =>y<=d2;WHEN "011" =>y<=d3;WHEN "100" =>y<=d4;WHEN "101" =>y<=d5;WHEN "110" =>y<=d6;WHEN "111" =>y<=d7; WHEN OTHERS =>y<="XXXX"END CASE; END PROCESS;END rtl;模八计数器library ieee; use ieee.std_logic
4、_1164.all;use ieee.std_logic_unsigned.all;entity count_8 is port(clk,clr: in std_logic; en : in std_logic; - '1'-count '0' -keep ql: out std_logic_vector(2 downto 0); c8 : out std_logic);end count_8;architecture rtl of count_8 issignal qcl :std_logic_vector(2 downto 0);begin process(
5、clk) begin if (clr='0') then qcl<="000" elsif (clk'event and clk='1') then if(en='1') then if(qcl="111") then qcl<="000"c8<='1' else qcl<=qcl+'1'c8<='0' end if; end if; end if; end process; ql<=qcl;en
6、d rtl;2、时钟控制模块:模16计数器:- count_16.vhd -library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count_16 isport(clk,clr: in std_logic; en : in std_logic; - '1'-count,'0' -keep ql, qh : out std_logic_vector(3 downto 0); c16: out std_logic);end count_16;architectu
7、re behav of count_16 issignal qcl: std_logic_vector(3 downto 0);signal qch: std_logic_vector(3 downto 0);begin process(clk) begin if(clr='0') then qcl<="0000"qch<="0000" elsif(clk'event and clk='1') then c16<='0' if(en='1' and qch=&quo
8、t;0001" and qcl="0101") then qcl<="0000"qch<="0000"c16<='1' else if(en='1' and qcl<"1001") then qcl<=qcl+'1' elsif(en='1' and qcl="1001") then qch<=qch+'1'qcl<="0000" end if;
9、 end if; end if; qh<=qch; ql<=qcl; end process;end behav;模12计数器;- count_12.vhd -library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count_12 isport(clk,clr: in std_logic; en : in std_logic; - '1'-count,'0' -keep ql, qh : out std_logic_vector(3 downto
10、 0); c12: out std_logic);end count_12;architecture behav of count_12 issignal qcl: std_logic_vector(3 downto 0);signal qch: std_logic_vector(3 downto 0);begin process(clk) begin if(clr='0') then qcl<="0000"qch<="0000" elsif(clk'event and clk='1') then c1
11、2<='0' if(en='1' and qch="0001" and qcl="0001") then qcl<="0000"qch<="0000"c12<='1' else if(en='1' and qcl<"1001") then qcl<=qcl+'1' elsif(en='1' and qcl="1001") then qch<
12、=qch+'1'qcl<="0000" end if; end if; end if; qh<=qch; ql<=qcl; end process;end behav;3、报时library ieee; use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count is port(clk1,clk2: in std_logic; m1,m2,s1,s2 : in std_logic_vector(3 downto 0); cout : out std_log
13、ic);end count;architecture rtl of count isbegin process(clk1,clk2) begin if(m1="0001" and m2="0101") then if(s1="0001")then if(s2="0001")then cout<=clk1; elsif(s2="0011")then cout<=clk1; elsif(s2="0101")then cout<=clk2; end if; end
14、 if; end if; end process;end rtl;4、分频:用的模8计数器:模8计数器:library ieee; use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity count_8 is port(clk,clr: in std_logic; en : in std_logic; - '1'-count '0' -keep ql: out std_logic_vector(2 downto 0); c8 : out std_logic);end count_8;architecture rtl of count_8 issignal qcl :std_logic_vector(2 downto 0);begin process(clk) begin if (clr='0') then qcl<="000" elsif (clk'event
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025江西上饶市属国有企业第一批次招聘105人笔试历年参考题库附带答案详解
- 2025浙江金华开发区国有企业招聘拟录用人员(第四批)笔试历年参考题库附带答案详解
- 2025 年中药药理学专升本真题及答案(人民卫生版)
- 四川省金太阳2026届高三上学期12月联考历史试卷(含答案详解)
- 林学行业职业发展新机遇
- 2025年海洋经济开发规划可行性研究报告及总结分析
- 2025年佳木斯市公安局面向社会公开招聘警务辅助人员政治考察备考题库及答案详解参考
- 2025中国邮政储蓄银行安徽省分行社会招聘备考题库含答案详解(达标题)
- 2025年宁波市鄞州区云龙镇招聘编外人员1人备考题库及完整答案详解1套
- 江苏银行2026届校园招聘备考题库有完整答案详解
- 2025年瑜伽行业市场发展可行性研究报告及总结分析
- 2025云南昆明国际会展中心有限公司社会招聘8人备考题库及答案详解(历年真题)
- DB5206∕T 128-2020 梵净抹茶 加工技术规程
- 人工智能在医学影像分析中的应用
- 皖2015s209 混凝土砌块式排水检查井
- 反刍动物饲料利用
- 《胆囊结石的护理》PPT
- 寿宁蒲洋水电站工程竣工验收鉴定书
- JJG 52-2013弹性元件式一般压力表、压力真空表和真空表
- 精装房验收交付表
- 汽车加油加气站安全生产风险分级管控实施细则
评论
0/150
提交评论