欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > PPT文档下载  

    EDA信号与变量.ppt

    • 资源ID:5428617       资源大小:341.49KB        全文页数:22页
    • 资源格式: PPT        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    EDA信号与变量.ppt

    信号与变量,区别&联系,2,非静态与静态数据对象,非静态数据处理signal,variable静态数据处理constant,generic常量和信号是全局的,用于顺序代码及并行代码变量是局部的,只用于顺序代码(process,function,procedure)且值不能直接向外传递。,3,常量,常量可以在包集、实体或结构中声明。包集调用包集的所有实体使用实体对该实体的所有结构体可用结构仅在结构体中使用,4,信号,代表逻辑电路的“硬”连线,用作输入/出端口、内部连接所有端口默认为信号定义的地方同常量当信号用在顺序描述语句(如process)内部,其值不立刻更新,信号值是在相应的进程、函数或过程完成后才进行更新对同一个信号进行多重赋值:编译器可能给出警告并退出综合过程或仅认为最后一次赋值是有效的。(Maxplus II给出警告),5,计数向量中1的个数,信号不立即更新变量立即更新,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity count_ones isport(din:in std_logic_vector(7 downto 0);ones:out integer range 0 to 8);end count_ones;architecture not_ok of count_ones issignal temp:integer range 0 to 8;beginprocess(din)begintemp=0;for i in 0 to 7 loopif(din(i)=1)thentemp=temp+1;end if;end loop;ones=temp;end process;end architecture not_ok;,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity count_ones isport(din:in std_logic_vector(7 downto 0);ones:out integer range 0 to 8);end count_ones;architecture ok of count_ones isbeginprocess(din)variable temp:integer range 0 to 8;begintemp:=0;for i in 0 to 7 loopif(din(i)=1)thentemp:=temp+1;end if;end loop;ones=temp;end process;end architecture ok;,8,分频器设计,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity freq_divider isport(clk,clr:in std_logic;out1,out2:buffer std_logic);end freq_divider;architecture Behavioral of freq_divider issignal count1:integer range 0 to 7;begin,process(clk,clr)variable count2:integer range 0 to 7;beginif(clr=1)thencount1=0;count2:=0;out1=0;out2=0;elseif(clkevent and clk=1)thencount1=count1+1;count2:=count2+1;if(count1=?)thenout1=not out1;count1=0;end if;if(count2=?)thenout2=not out2;count2:=0;end if;end if;end if;end process;end Behavioral;,10,Cnt1:sigCnt2:var 2,2,2,3,4,4,11,触发器设计,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity dff isport(d,clk:in std_logic;q:buffer std_logic;qbar:out std_logic);end dff;architecture not_ok of dff isbeginprocess(clk)beginif(clkevent and clk=1)thenq=d;-进程结束后才生效qbar=not q;-进程结束后才生效,q的值此时还没更新!end if;end process;end architecture not_ok;,12,qbar延迟了一个周期,13,改进的设计,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity dff isport(d,clk:in std_logic;q:buffer std_logic;qbar:out std_logic);end dff;architecture ok of dff isbeginprocess(clk)beginif(clkevent and clk=1)thenq=d;end if;end process;qbar=not q;end architecture ok;,14,qbar赋值与进程并发,q变化,qbar立即更新,15,寄存器数量,一个信号的赋值是以另一个信号的跳变为条件时(即发生同步赋值时),编译后产生寄存器。(process、function、procedure中)如果一个变量在还没有进行赋值操作时已被使用,那么综合后就好产生寄存器。一个变量在一个信号跳变时赋值,并且该值最终又被赋给了另外的信号,则综合后会产生寄存器。如果变量的值没有被进程(函数或过程)以外的代码调用,那么不一定产生寄存器。,16,17,18,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity dff isport(d,clk:in std_logic;q:buffer std_logic;qbar:out std_logic);end dff;architecture not_ok of dff isbeginprocess(clk)beginif(clkevent and clk=1)thenq=d;-进程结束后才生效qbar=not q;-进程结束后才生效,q的值此时还没更新!end if;end process;end architecture not_ok;,19,改进的设计,library IEEE;use IEEE.STD_LOGIC_1164.ALL;entity dff isport(d,clk:in std_logic;q:buffer std_logic;qbar:out std_logic);end dff;architecture ok of dff isbeginprocess(clk)beginif(clkevent and clk=1)thenq=d;end if;end process;qbar=not q;end architecture ok;,20,移位寄存器,entity shift isport(din,clk:in bit;dout:out bit);end shift;architecture shift of shift isbeginprocess(clk)variable a,b,c:bit;beginif(clkevent and clk=1)thendout=c;c:=b;b:=a;a:=din;end if;end process;end architecture shift;,entity shift isport(din,clk:in bit;dout:out bit);end shift;architecture shift of shift isbeginprocess(clk)variable a,b,c:bit;beginif(clkevent and clk=1)thena:=din;b:=a;c:=b;dout=c;end if;end process;end architecture shift;,entity shift isport(din,clk:in bit;dout:out bit);end shift;architecture shift of shift issignal a,b,c:bit;beginprocess(clk)beginif(clkevent and clk=1)thena=din;b=a;c=b;dout=c;end if;end process;end architecture shift;,

    注意事项

    本文(EDA信号与变量.ppt)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开