欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    pld高级工技师参考学习笔记中级程序.docx

    • 资源ID:13132780       资源大小:270.39KB        全文页数:17页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

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

    pld高级工技师参考学习笔记中级程序.docx

    1、pld高级工技师参考学习笔记中级程序max+plus 秒表电路设计程序:cnt10.vhd程序library ieee;-打开 ieee库use ieee.std_logic_1164.all;-调用std_logic_1164程序包use ieee.std_logic_unsigned.all; -调用程序包(无符号重载函数)entity cnt10 is-实体port ( -端口 clk,ena,rst:in std_logic; -时钟、起停、清零(标准逻辑位类型)q:out std_logic_vector (3 downto 0);-q3.0标准逻辑位向量类型 cout:out st

    2、d_logic -进位标志位);end cnt10;architecture one of cnt10 is -结构体signal cqi:std_logic_vector (3 downto 0);-定义中间信号beginprocess(clk,ena,rst)-进程(敏感变量)beginif (rst=1) then -清零 cqi=”0000”; -输出为零 cout=0; -进位零elsif (clkevent and clk=1) then -当时钟上升沿来临时 if ena=1 then -启动 if cqi=”1001” then -判断计数是否为9,到9回0并进位。 cqi=”

    3、0000”; cout=1; else -计数不为9,cqi的值加一,无进位。 cqi=cqi+1; cout=0;end if;end if;end if;q=cqi; -将中间信号的输出值赋值给q。end process; -结束进程end one; -结束结构体程序:Cnt6.vhd程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt6 isport ( clk,ena,rst:in std_logic; q:out std_logic_vector (3 downto

    4、0); cout:out std_logic);end cnt6;architecture one of cnt6 issignal cqi:std_logic_vector (3 downto 0);beginprocess(clk,ena,rst)beginif (rst=1) then cqi=”0000”; cout=0;elsif (clkevent and clk=1) then if ena=1 then if cqi=”0101” then-判断计数是否为5,到5回0并进位。 cqi=”0000”; cout=1; else cqi=cqi+1; cout=0;end if;e

    5、nd if;end if;q=cqi;end process;end one;max+plus 频率计电路设计程序:cnt10.vhd程序library ieee;-打开 ieee库use ieee.std_logic_1164.all;-调用std_logic_1164程序包use ieee.std_logic_unsigned.all; -调用程序包(无符号重载函数)entity cnt10 is-实体port ( -端口 clk,ena,rst:in std_logic; -时钟、起停、清零(标准逻辑位类型)q:out std_logic_vector (3 downto 0);-q3.

    6、0标准逻辑位向量类型 cout:out std_logic -进位标志位);end cnt10;architecture one of cnt10 is -结构体signal cqi:std_logic_vector (3 downto 0);-定义中间信号beginprocess(clk,ena,rst)-进程(敏感变量)beginif (rst=1) then -清零 cqi=”0000”; -输出为零 cout=0; -进位零elsif (clkevent and clk=1) then -当时钟上升沿来临时 if ena=1 then -启动 if cqi=”1001” then -判

    7、断计数是否为9,到9回0并进位。 cqi=”0000”; cout=1; else -计数不为9,cqi的值加一,无进位。 cqi=cqi+1; cout=0;end if;end if;end if;q=cqi; -将中间信号的输出值赋值给q。end process; -结束进程end one; -结束结构体程序:tesctl.vhd程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity tesctl isport ( clkk:in std_logic; -1Hz cnt_en:ou

    8、t std_logic; -计数器时钟起停 cnt_rst:out std_logic; -计数器清零 load: out std_logic输出锁存信号);end tesctl;architecture one of tesctl issignal div2clk:std_logic; -定义中间信号div2clkbeginprocess(clkk)beginif (clkkevent and clkk=1) then1Hz时钟2分频div2clk=not div2clk;end if;end process;process(clkk,div2clk)beginif (clkk=0 and

    9、div2clk=0) then cnt_rst=1; -产生计数器清零信号else cnt_rst=0;end if;load=not div2clk; cnt_en=div2clk;end process;end one;程序:reg4b.vhd程序library ieee;use ieee.std_logic_1164.all;entity reg4b isport ( load:in std_logic; -锁存信号 din:in std_logic_vector(3 downto 0); -cout端输出的信号 dout: out std_logic_vector(3 downto 0

    10、) 输出);end reg4b;architecture one of reg4b isbeginprocess(load)beginif (loadevent and load=1) thenload信号上升沿来临时dout=din; -din的值赋给dout作为输出end if;end process;end one;max+plus ADC0809电路设计程序:adc.vhd程序library ieee;-打开 ieee库use ieee.std_logic_1164.all;-调用std_logic_1164程序包entity adc is-实体port ( -端口 din:in st

    11、d_logic_vector(7 downto 0); -0809的8位输出数据clk:in std_logic; -状态机时钟(标准逻辑位类型)q:out std_logic_vector (7 downto 0);-q7.08位输出数据 eoc: in std_logic转换结束标志信号 clock: out std_logicACD0809时钟 start: out std_logic启动ADC0809oe:out std_logic -输出允许控制信号);end adc;architecture one of adc is -结构体type st_type is(st0,st1,st2

    12、,st3,st4); -定义状态的子类型signal lock:std_logic;-定义中间信号数据输出锁存时钟信号signal current_state,next_state:st_stype:=st0;-定义两状态beginclock=clk; -将状态机时钟赋给adc0809-process(clk)-进程(敏感变量)beginif (clkevent and clk=1) then -当时钟上升沿来临时 current_state=next_state;end if;end process;-process(lock)-进程(敏感变量)beginif (lockevent and

    13、lock=1) then -当lock信号上升沿来临时 q -0809初始化start=0;oe=0;lock=0;next_state -启动采样start=1;oe=0;lock=0;next_state start=0;oe=0;lock=0;if eoc=1 then -eoc=1表明转换结束,调至下一个状态next_state=st3;else next_state -开启oe输出转换好的数据start=0;oe=1;lock=0;next_state -锁存信号start=0;oe=1;lock=1;next_state start=0;oe=0;lock=0;next_state

    14、=st0;end case;end process;end one;max+plus 交通灯电路设计程序:counter.vhd程序library ieee;-打开 ieee库use ieee.std_logic_1164.all;-调用std_logic_1164程序包use ieee.std_logic_unsigned.all;-调用程序包(无符号重载函数)entity counter is-实体port ( -端口 hold,reset,clk:in std_logic; -紧急信号、恢复、时钟counternum:buffer integer range 0 to 49 -双向输入)

    15、;end counter;architecture one of counter is -结构体beginprocess(hold,reset,clk)-进程(敏感变量)beginif (reset=1) then -清零 counternum=0;elsif (clkevent and clk=0) then if hold=1 then counternum= counternum; else if counternum=49 then counternum=0;else counternum=20) then -当输入值大于20时,高位为2,低位为输入值减20 numa=2;numb=1

    16、0) then -当输入值大于10时,高位为1,低位为输入值减10 numa=1;numb=numin-10;else numa=0;numb=numin;end if;end process;end one;程序:controller.vhd程序library ieee;-打开 ieee库use ieee.std_logic_1164.all;-调用std_logic_1164程序包entity controller is-实体port ( -端口 clk,hold,:in std_logic; countnum:in integer range 0 to 49; reda,greena,y

    17、ellowa:out std_logic; -redb,greenb,yellowb:out std_logic;flash: out std_logic);end controller;architecture one of controller is -结构体beginprocess(clk)-进程(敏感变量)beginif (clkevent and clk=0) then -当时钟下降沿来临时 if hold=1 thenreda=1;greena=0;yellowa=0;redb=1;greenb=0;yellowb=0;flash=1;else flash=0;-if countn

    18、um=19 then numa=20-countum;reda=0;greena=1;yellowa=0;elsif countnum=24 then numa=25-countum;reda=0;greena=0;yellowa=1;else numa=50-countum;reda=1;greena=0;yellowa=0;end if;-if countnum=24 then numb=25-countum;redb=1;greenb=0;yellowb=0;elsif countnum=44 then numb=45-countum;redb=0;greenb=1;yellowb=0;

    19、else numb=50-countum;redb=0;greenb=0;yellowb=1;end if;end if;end if;end process;end one;PLD学习总结可编程逻辑器件(programmable logic device),简称PLD。通过系统的学习:能够了解Altera公司Max+plus 10.0软件平台的常用菜单及命令的使用,能够较熟练的掌握EDA6000集成软件的调试。1、软件的了解: 利用Max+plus 10.0软件,进行对PLD程序的编写,主要通过两种方式:图形输入;VHDL语言输入。能够掌握两种语言编写的方式。利用EDA6000集成调试软件,

    20、对编写好的PLD软件进行调试仿真。2、硬件的了解:利用伟福EDA2000实验系统对PLD程序进行硬件仿真,能较为熟练的掌握硬件试验箱的连线及程序下载。3、实验内容: 1.利用图形输入法对38译码器进行波形的仿真,检查其波形的正确后,验证其逻辑功能。熟练掌握图形输入法的文件创建、文件名、器件选择、器件之间的连线、选择设计使用的器件,加入信号接点,编译设计项目,进行波形仿真,将信号锁定到芯片的管脚等。 2.利用VHDL语言(超高速硬件描述语言)进行对与门或门电路进行波形仿真,能够熟练理解程序的结构及其在Max+plus 10.0软件下的调试编译仿真。 3.通过VHDL语言编写半加器程序,输出生成的

    21、新元件,利用生成的新元件实现全加器的功能仿真。 4.利用伟福EDA2000实验箱,创建模式,并连接数据通信线路,管脚设置,实现硬件电路的仿真。4、考核内容: 1.秒表利用VHDL语言编写CNT10及CNT6,生成新器件,连接器件之间的关系实现秒表电路的仿真。 2.四位十进制频率计利用VHDL语言编写CNT10、TESCTL及REG4B,生成新器件,连接器件之间的关系实现四位十进制频率计电路的仿真。 3.ADC0809控制器利用VHDL语言编写ADC.vhd实现adc电路的仿真。 4.交通灯控制器利用VHDL语言编写COUNTER、CONTROLLER及FENWEI,生成新器件,连接器件之间的关

    22、系实现交通灯控制器电路的仿真。通过以上的学习能够初步了解PLD编程的应用,为即将学习的单片机做好一个铺垫。陆志刚2012.09.29项目:CNT10程序:Cnt10.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt10 isport( clk,ena,rst:in std_logic; q:out std_logic_vector(3 downto 0); cout:out std_logic);end cnt10;architecture one of cnt10 issignal cqi:std_logic_vector(3 downto 0);beginprocess(clk,ena,rst)begin if(rst=1)thencqi=0000;cout=0;elsif(clkevent and clk=1)thenif ena=1thenif cqi=1001thencqi=0000;cout=1;elsecqi=cqi+1;cout=0;end if;end if;end if;q=cqi;end process;end one;波形图仿真EDA6000集成软件模式:生成CNT10新元件


    注意事项

    本文(pld高级工技师参考学习笔记中级程序.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

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




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开