已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
信号与变量,区别useIEEE.STD_LOGIC_1164.ALL;entitycount_onesisport(din:instd_logic_vector(7downto0);ones:outintegerrange0to8);endcount_ones;architecturenot_okofcount_onesissignaltemp:integerrange0to8;beginprocess(din)begintemp=0;foriin0to7loopif(din(i)=1)thentemp=temp+1;endif;endloop;ones=temp;endprocess;endarchitecturenot_ok;,libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entitycount_onesisport(din:instd_logic_vector(7downto0);ones:outintegerrange0to8);endcount_ones;architectureokofcount_onesisbeginprocess(din)variabletemp:integerrange0to8;begintemp:=0;foriin0to7loopif(din(i)=1)thentemp:=temp+1;endif;endloop;ones=temp;endprocess;endarchitectureok;,8,分频器设计,libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entityfreq_dividerisport(clk,clr:instd_logic;out1,out2:bufferstd_logic);endfreq_divider;architectureBehavioraloffreq_dividerissignalcount1:integerrange0to7;begin,process(clk,clr)variablecount2:integerrange0to7;beginif(clr=1)thencount1=0;count2:=0;out1=0;out2=0;elseif(clkeventandclk=1)thencount1=count1+1;count2:=count2+1;if(count1=?)thenout1=notout1;count1=0;endif;if(count2=?)thenout2=notout2;count2:=0;endif;endif;endif;endprocess;endBehavioral;,10,Cnt1:sigCnt2:var2,2,2,3,4,4,11,触发器设计,libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entitydffisport(d,clk:instd_logic;q:bufferstd_logic;qbar:outstd_logic);enddff;architecturenot_okofdffisbeginprocess(clk)beginif(clkeventandclk=1)thenq=d;-进程结束后才生效qbar=notq;-进程结束后才生效,q的值此时还没更新!endif;endprocess;endarchitecturenot_ok;,12,qbar延迟了一个周期,13,改进的设计,libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entitydffisport(d,clk:instd_logic;q:bufferstd_logic;qbar:outstd_logic);enddff;architectureokofdffisbeginprocess(clk)beginif(clkeventandclk=1)thenq=d;endif;endprocess;qbar=notq;endarchitectureok;,14,qbar赋值与进程并发,q变化,qbar立即更新,15,寄存器数量,一个信号的赋值是以另一个信号的跳变为条件时(即发生同步赋值时),编译后产生寄存器。(process、function、procedure中)如果一个变量在还没有进行赋值操作时已被使用,那么综合后就好产生寄存器。一个变量在一个信号跳变时赋值,并且该值最终又被赋给了另外的信号,则综合后会产生寄存器。如果变量的值没有被进程(函数或过程)以外的代码调用,那么不一定产生寄存器。,16,17,18,libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entitydffisport(d,clk:instd_logic;q:bufferstd_logic;qbar:outstd_logic);enddff;architecturenot_okofdffisbeginprocess(clk)beginif(clkeventandclk=1)thenq=d;-进程结束后才生效qbar=notq;-进程结束后才生效,q的值此时还没更新!endif;endprocess;endarchitecturenot_ok;,19,改进的设计,libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;entitydffisport(d,clk:instd_logic;q:bufferstd_logic;qbar:outstd_logic);enddff;architectureokofdffisbeginprocess(clk)beginif(clkeventandclk=1)thenq=d;endif;endprocess;qbar=notq;endarchitectureok;,20,移位寄存器,entityshiftisport(din,clk:inbit;dout:outbit);endshift;architectureshiftofshiftisbeginprocess(clk)variablea,b,c:bit;beginif(clkeventandclk=1)thendout=c;c:=b;b:=a;a:=din;endif;endprocess;endarchitectureshift;,entityshiftisport(din,clk:inbit;dout:outbit);endshift;architectureshiftofshiftisbeginprocess(clk)variablea,b,c:bit;beginif(clkeventandclk=1)thena:=din;b:=a;c:=b;dout=c;endif;endprocess;endarchitectureshift;,entityshiftisport(din,clk:inbit;dout:outbit);ends
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025重庆荣昌区古昌镇人民政府招聘公益岗1人备考题库含答案详解(达标题)
- 2025福建龙岩市永定区消防救援大队消防文员招聘1人备考题库有完整答案详解
- 2026中国农业银行宁夏回族自治区分行校园招聘146人备考题库带答案详解(完整版)
- 人工智能通识(基础、技术、前沿、伦理与实践)-课件-第1章 人工智能概述
- 2025中铁高质量发展科学研究院有限责任公司招聘4人备考题库附答案详解(巩固)
- 2025西部证券投资业务岗位招聘笔试考试参考试题及答案解析
- 医疗设备绿色制造与环保材料选择策略
- 2025泗泾镇公开招聘镇属企业、城运中心合同制人员8人笔试考试备考试题及答案解析
- 2025福建中晶科技有限公司招聘35人备考题库完整答案详解
- 2025年湖南岳阳湘阴县纪委监委面向全市选调4人笔试考试备考试题及答案解析
- 海上风电场的保险创新
- MAM6090空压 机微电脑控制器说明书
- 精神病监护权责书
- 凌云公司简介
- 新生儿静脉治疗护理课件
- 施工现场临水临电标准化图册图文并茂
- 东西协作 新华出版社出版
- 蒂森克虏伯扶梯电气原理图
- 全国物业管理示范住宅小区大厦工业区标准及评分细则全套
- 群众文化副高答辩问题及答案
- SB/T 10468.2-2012轮胎理赔技术规范
评论
0/150
提交评论