




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
简易时钟的设计1. 分频电路的设计-实体名:fen100-功 能:对输入时钟进行24000分频,得到100hz信号,- 作为数码显示管位扫描信号-接 口:clk -时钟输入- qout-100hz输出信号-library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fen100 isport(clk:in std_logic; rst:in std_logic; qout:out std_logic);end fen100;architecture behave of fen100 isconstant counter_len:integer:=23999;begin process(clk,rst) variable cnt:integer range 0 to counter_len; begin if(rst=0)then cnt:=0; elsif clkevent and clk=1 then if cnt=counter_len then cnt:=0; else cnt:=cnt+1; end if; case cnt is when 0 to counter_len/2=qoutqoutqoutqout=1; end case; end if; end process;end behave;2.60进制-功 能:60进制计数器-接 口:clk -时钟输入- qout1-个位bcd输出- qout2-十位bcd输出- carry-进位信号输出-library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fen60 is port(clk : in std_logic; rst : in std_logic; qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0); carry : out std_logic);end fen60;architecture behave of fen60 issignal tem1:std_logic_vector(3 downto 0);signal tem2:std_logic_vector(3 downto 0);begin process(clk,rst) begin if(rst=0)then tem1=0000; tem2=0000; elsif clkevent and clk=1 then if tem1=1001 then tem1=0000; if tem2=0101 then tem2=0000; carry=1; else tem2=tem2+1; carry=0; end if; else tem1=tem1+1; end if; end if; qout1=tem1; qout2=tem2; end process;end behave; 3.24进制的设计library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fen24 is port(clk : in std_logic; rst : in std_logic; qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0); carry : out std_logic);end fen24;architecture behave of fen24 issignal tem1:std_logic_vector(3 downto 0);signal tem2:std_logic_vector(3 downto 0);begin process(clk,rst) begin if(rst=0)then tem1=0010; tem2=0001; elsif clkevent and clk=1 then if (tem2=0010 and tem1=0011) then tem1=0000; tem2=0000; carry=1; else carry=0; if tem1=1001 then tem1=0000; if tem2=1001 then tem2=0000; else tem2=tem2+1; end if; else tem1=tem1+1; end if; end if; end if; qout1=tem1; qout2=tem2; end process;end behave; 4.数码管显示library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fen24 is port(clk : in std_logic; rst : in std_logic; qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0); carry : out std_logic);end fen24;architecture behave of fen24 issignal tem1:std_logic_vector(3 downto 0);signal tem2:std_logic_vector(3 downto 0);begin process(clk,rst) begin if(rst=0)then tem1=0010; tem2=0001; elsif clkevent and clk=1 then if (tem2=0010 and tem1=0011) then tem1=0000; tem2=0000; carry=1; else carry=0; if tem1=1001 then tem1=0000; if tem2=1001 then tem2=0000; else tem2=tem2+1; end if; else tem1=tem1+1; end if; end if; end if; qout1=tem1; qout2=tem2; end process;end behave; 5.数码管显示编码library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity fen24 is port(clk : in std_logic; rst : in std_logic; qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0); carry : out std_logic);end fen24;architecture behave of fen24 issignal tem1:std_logic_vector(3 downto 0);signal tem2:std_logic_vector(3 downto 0);begin process(clk,rst) begin if(rst=0)then tem1=0010; tem2=0001; elsif clkevent and clk=1 then if (tem2=0010 and tem1=0011) then tem1=0000; tem2=0000; carry=1; else carry=0; i
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 离婚协议书-房屋装修与家具购置协议
- 物联网企业股东个人股权转让及网络安全协议
- 离婚协议书模板:复杂股权分割及企业继承协议
- 物业管理公司劳动合同范本与员工培训与晋升机制
- 离婚协议书车辆分割及共同财产分割及子女抚养协议
- 跨境电商零售进口市场税收政策与合规性报告
- 离婚协议书范本:离婚后财产分割及共同债务偿还方案
- 离婚财产分割协议书:房产、车辆、存款及股权
- 离婚协议书范本:夫妻共同财产分割及赡养费支付
- 蒙城县采煤塌陷区应急预案
- 酒店明住宿清单(水单)
- 《中国儿童维生素A、维生素D临床应用专家共识》解读
- 应用技术推广中心 报告1212
- 一级烟草专卖管理师理论考试题库(含答案)
- 小学数学《分数除法》50道应用题包含答案
- 教学第七章-无机材料的介电性能课件
- 应急值班值守管理制度
- 外国文学史-总课件
- 《中小企业划型标准规定》补充说明
- 房屋租赁信息登记表
- 六年级上册数学课件-1.6 长方体和正方体的体积计算丨苏教版 (共15张PPT)
评论
0/150
提交评论