第6章VHDL设计进阶报告.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
第6章VHDL设计进阶报告

第6章VHDL设计进阶 山东师范大学传播学院 秦绍华 数据对象 常数 变量 信号 常数 为了使程序易于阅读和修改 全局性 Constant 常数名:数据类型:=表达式; 定义位置: 实体、结构体、程序包、块、进程和子程序 可视性原则 变量 暂存数据 局部量 Variable 变量名:数据类型:=表达式; 定义位置: 进程和子程序 综合器不支持初值 不可以列入敏感信号表 赋值无延时 信号 连接线作用,并行模块间的信息传递 全局性 Signal 信号名:数据类型:=初值 定义位置: 实体、结构体、程序包 综合器不支持初值 可以列入敏感信号表 赋值有延时 多个驱动源 并行赋值语句中不允许同一个信号有多个驱动源 进程中允许同一个信号有多个驱动源,但只有最后一个被启动 Signal a,b,c,y,z: integer; …… Process(a,b,c) Begin Y=a+b; Z=c-a; Y=b; End process 进程中的信号和变量 信号 变量 基本用法 电路中的连线 进程中的数据存储 适用范围 结构体内 进程 行为特征 延时 立即 例6-1,6-2 Library ieee; Use ieee.std_logic_1164.all; Entity dff3 is Port(clk,d1: in std_logic; q1:out std_logic); End entity dff3; Architecture bhv of dff3 is Signal qq: std_logic; Begin Process(clk) Variable qq: std_logic; Begin If clk’event and clk=‘1’ then qq=d1; End if; q1=qq; End process; End bhv; 例6-3,6-4 Signal a ,b :std_logic; Begin Process(clk) Begin If clk’event and clk=‘1’ then a=d1; b=a; q1=b; End if; End process; Begin Process(clk) Variable a, b :std_logic; Begin If clk’event and clk=‘1’ then a:=d1; b:=a; q1=b; End if; End process; 例6-3,6-4 例6-5 Signal in1,in2:std_logic; Signal e1 :std_logic_vector(3 downto 0); Process(in1,in2) Variable c1:std_logic_vector(3 downto 0); Begin If in1=‘1’ then e1=“1010”; ….. If in2=‘1’ then c1:=“0011”; …….. End if; End process; 例6-6 Library ieee; Use ieee.std_logic_1164.all; Entity mux4 is Port(i0,i1,i2,i3,a,b: in std_logic q: out std_logic); End mux4; Architecture body of mux4 is Signal muxval:integer range 7 downto 0; Begin Rpocess(i0,i1,i2,i3,a,b) begin Muxval=0; If (a=‘1’) then mucval=muxval+1; end if; If (b=‘1’) then mucval=muxval+2; end if; Case muxval is When 0 =q=i0; When 1 =q=i1; When 2 =q=i2; When 3 =q=i3; When others =null; End …….. 例6-7 Library ieee; Use ieee.std_logic_1164.all; Entity mux4 is Port(i0,i1,i2,i3,a,b: in std_logic

文档评论(0)

ee88870 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档