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

    FPGA实验报告.docx

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

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

    FPGA实验报告.docx

    1、FPGA实验报告FPGA实验 一、实验目的1. 熟悉Quartus 软件基本使用方法;2. 掌握电路的基本设计方法;3. 掌握电路的基本仿真方法;4. 掌握电路的基本下载方法;5. 学习状态机的设计技巧;6. 掌握CASE 语句的使用;7. 掌握时钟分频电路的HDL 设计;8. 掌握CASE 语句的使用;9. 掌握VHDL 模块化程序设计方式;10. 学习VHDL 程序的设计技巧;11. 掌握VHDL 语言译码电路的设计;12. 掌握选择信号赋值语句的设计方法;二、实验器材1. KH-310 下载板;2. KH-310 LED 显示模块;3. KH-310 时钟模块;5KH-310 七段数码管

    2、模块。4. 计算机。三、实验原理乒乓球机:乒乓球游戏机是用816 个发光二极管代表乒乓球台,中间两个发光二极管兼作乒乓球网,用点亮的发光二极管按一定方向移动来表示球的运动。另外设置发球开关:Af、Bf;和接球开关Aj、Bj。利用若干七段数码管作为计分牌。甲乙双方按乒乓球比赛规则来操作开关。当甲方按动发球开关Af 时,靠近甲方的第一个灯亮,然后顺序向乙方移动。当球过网后,乙方可以接球,接球后灯反方向运动,双方继续比赛,如果一方提前击球(过网击球)或未击到球,则判失分,对方加分。重新发球后继续比赛。译码器: 状态机:状态机的一个常用的用处是构成控制步进电机的逻辑电路。表1给出了用于顺时针和逆时针驱

    3、动步进电机的二进制码。状态机的设计中我们需要提到一些称为常态和次态的状态,表2列举了步进电机的状态转换顺序。 时钟:图3.27 四、实验内容1.用VHDL 语言和原理图分别完成设计、仿真和下载基本逻辑门电路半加器的过程:输入:a,b; 输出:求和sum,进位c;2. 控制8 个LED 进行花式显示,设计四种显示模式:1. 从左到右逐个点亮LED;2. 从右到左逐个点亮LED;3. 从两边到中间逐个点亮LED;4. 从中间到两边逐个点亮LED。四种模式循环切换,由复位键rst 控制系统的运行与停止。3. 设计一个乒乓球游戏机,模拟乒乓球比赛基本过程和规则,并能自动裁判和计分。4. 设计一个简单的

    4、指令译码器,按指定的要求,对两个逻辑变量进行运算,并将运算的结果在发光二极管上显示。5.使用VHDL语言,编制一个4相步进电机控制程序,由发光二极管指示步进电机的相序,要求正反转控制,通过改变时钟频率实现调速。6. 设计一个电子钟,要求可以显示时、分、秒,用户可以设置时间且需要设置的时间显示要求闪烁。五、实验连线跑马灯:输入信号:时钟clk 接10Hz 输入(SW7) P152;复位rst 接拨动开关I01(拨码开关SW3 左1)P1 ;输出信号:8 位输出信号接LED 模块O25O32。P43P50;乒乓球:输入信号:控制时钟CLK:可调时钟SW7 输入;接发球输入Af,Aj,Bf,Bj:脉

    5、冲发生器EPI0EPI3(Pin236 Pin238 Pin237 Pin239);系统复位Clr:拨码开关I01;输出信号:乒乓球信号shift15.0:LED 显示模块O25O40;计分输出q6.0:七段数码管O56O50(Pin79Pin73)(JP1);Sellread3.0:数码管选择SO61SO58(Pin86Pin83)(数码管跳线接左侧扫描方式)。译码器:输入信号:译码器输入开关c、b、a 接拨动开关I01(拨码开关SW3 左1 P1) 、I02(拨码开关SW3 左2 P2)、I03(拨码开关SW3 左3 P3),输入数据data1、data2接IO9(拨码开关SW4 左1 P

    6、11)、 IO10(拨码开关SW3 左2 P12)输出信号: LED 模块O25 P43;步进机:输入信号:时钟clk 接10Hz 输入(SW7) P152;方向dir接拨动开关I01(拨码开关SW3 左1)P1 ;输出信号:4 位输出信号接LED 模块O25O28。P43P46;电子钟:输入信号:时钟clk:接开发板可调时钟SW7(P152),选择100KHz 频率; 模式选择mode:接脉冲发生器模块EPI0;P236时间设定set:接脉冲发生模块EPI1;P238输出信号:Seg77. 0接数码管段扫描信号O50O56、SO57;P73、74、75、76、77、78、79、82Segct

    7、r7.0接数码管位选显示信号SO58SO65;P83、84、85、86、87、88、93、94CLR ;P1 清零信号六、实验步骤1. 新建文本文件2. 建立工程项目3. 编译并综合4. 设计仿真5. 管脚的分配与定位6. 硬件连接7. 器件下载编程与硬件实现七、实验操作1. 跑马灯:下载程序,将SW7 拨至第二段(10Hz),拨码开关SW3 的IO1 拨至ON 的位置,此时,LED 灯的前8 位会有规律的闪烁。2. 乒乓球:下载程序 ,将SW3 的IO1 拨到ON 后可进行比赛,PULS1 为甲方发球,PULS2 为甲方接球,PULS3 为乙方发球,PULS4 为乙方接球。LED 灯中,始终

    8、点亮的代表球网,将SW7 拨至第四段的位置。点击发球之后,双方可进行比赛,比赛规则参照实验原理部分。3. 译码器:改变译码器的输入值(a、b、c)和输入数据值(data1、data2),输出数据按设计值输出4. 步进机:下载程序,将SW7 拨至第二段(10Hz),此时,LED 灯的前1 位会有规律的闪烁。改变方向开关的电平信号,指示灯的移动方向立即改变。5. 电子钟:下载程序 ,按PULSE1 可进行时、分、秒的切换,按PULSE2 可以对时,分,秒进行设置,I01为系统的使能,I01 为off 时开始计时。八、实验程序1.半加器 library ieee;use ieee.std_logic

    9、_1164.all; use ieee.std_logic_unsigned.all; entity halfadd is port(a:in std_logic; b:in std_logic; sum:out std_logic; c,d:out std_logic); end;architecture main of halfadd isbeginc=a and b;sum=a xor b; end;2.跑马灯library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity led isport

    10、(clk:in std_logic; rst:in std_logic; q :out std_logic_vector(7 downto 0);end;architecture led of led isconstant s0:std_logic_vector(1 downto 0):=00; -模式1constant s1:std_logic_vector(1 downto 0):=01; -模式2constant s2:std_logic_vector(1 downto 0):=10; -模式3constant s3:std_logic_vector(1 downto 0):=11; -

    11、模式4signal present:std_logic_vector(1 downto 0); - 当前模式signal q1:std_logic_vector(7 downto 0);signal count:std_logic_vector(3 downto 0);beginprocess(rst,clk)beginif(rst=0)then - 系统初始化 present=s0; q10);elsif(clkevent and clk=1)then case present is when s0 = if(q1=00000000)then -S0模式:从左到右逐个点亮LED q1=100

    12、00000; else if(count=0111)then count0); q1=00000001; present=s1; else q1=q1(0) & q1(7 downto 1); count=count+1; present if(count=0111)then -S1模式:从右到左逐个点亮LED count0); q1=10000001; present=s2; else q1=q1(6 downto 0) & q1(7); count=count+1; present if(count=0011)then -S2模式:从两边到中间逐个点亮LED count0); q1=000

    13、11000; present=s3; else q1(7 downto 4)=q1(4) & q1(7 downto 5); q1(3 downto 0)=q1(2 downto 0) & q1(3); count=count+1; present if(count=0011)then -S3模式:从中间到两边逐个点亮LED count0); q1=10000000; present=s0; else q1(7 downto 4)=q1(6 downto 4) & q1(7); q1(3 downto 0)=q1(0) & q1(3 downto 1); count=count+1; pres

    14、ent=s3; end if; end case;end if;end process;q=q1;end;3.乒乓球Library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity corna is port ( clr,af,aj,bf,bj,clk:in std_logic; shift:out std_logic_vector(15 downto 0); ah,al,bh,bl: out std_logic_vector(3 downto 0) );end corna;architecture

    15、corna_arc of corna issignal amark,bmark : integer;signal clk1:std_logic;signal fen:std_logic_vector(9 downto 0);begin process begin wait until clk=1; fen=fen+1; clk1=fen(7); end process; process(clr,clk1) variable a,b : std_logic; variable she: std_logic_vector(15 downto 0); begin if clr=0 then a:=0

    16、; b:=0; she:=0000000000000000; amark=0; bmark128 then if bj=1 then amark=amark+1; a:=0; b:=0; she:=0000000000000000; else she:=0&she(15 downto 1); end if; elsif she=0 then amark=amark+1; a:=0; b:=0; else if bj=1 then a:=0; b:=1; else she:=0& she(15 downto 1); end if; end if; elsif a=0 and b=1 then i

    17、f she256 and she/=0 then if aj=1 then bmark=bmark+1; a:=0; b:=0; she:=0000000000000000; else she:=she(14 downto 0)&0; end if; elsif she=0 then bmark=bmark+1; a:=0; b:=0; else if aj=1 then a:=1; b:=0; else she:=she(14 downto 0)&0; end if; end if; end if; end if; shifttmp1 then if ala=1001 then ala:=0

    18、000; aha:=aha+1; tmp1:=tmp1+1; else ala:=ala+1; tmp1:=tmp1+1; end if ; end if; if bmarktmp2 then if bla=1001 then bla:=0000; bha:=bha+1; tmp2:=tmp2+1; else bla:=bla+1; tmp2:=tmp2+1; end if ; end if; end if; al=ala; bl=bla; ah=aha; bhqqqq=d1; end case; end process;end ch41_arc;Library ieee;use ieee.s

    19、td_logic_1164.all;use ieee.std_logic_unsigned.all;entity sel is port ( clk:in std_logic; sell:out std_logic_vector(2 downto 0) );end sel;architecture sel_arc of sel isbegin process(clk) variable tmp: std_logic_vector(2 downto 0); begin if clkevent and clk=1 then if tmp=000 then tmp:=001; elsif tmp=0

    20、01 then tmp:=100; elsif tmp=100 then tmp:=101; elsif tmp=101 then tmp:=000; end if; end if; sellqqqqqqqqqq=1101111; end case; end process;end disp_arc;Library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity pingpong is port ( clr,af,aj,bf,bj,clk:in std_logic; shift:out std_lo

    21、gic_vector(15 downto 0); q: out std_logic_vector(6 downto 0); net: out std_logic_vector(1 downto 0); sellread:out std_logic_vector(3 downto 0) );end pingpong;architecture pingpong of pingpong iscomponent corna is port ( clr,af,aj,bf,bj,clk:in std_logic; shift:out std_logic_vector(15 downto 0); ah,al

    22、,bh,bl: out std_logic_vector(3 downto 0) );end component;component ch41a is port( sel:in std_logic_vector(2 downto 0); d0,d1,d2,d3: in std_logic_vector(3 downto 0); q: out std_logic_vector(3 downto 0) );end component;component sel is port ( clk:in std_logic; sell:out std_logic_vector(2 downto 0) );e

    23、nd component;component disp is port ( d:in std_logic_vector(3 downto 0); q:out std_logic_vector(6 downto 0) );end component;signal i1,i2,i3,i4,i5: std_logic_vector(3 downto 0);signal i6:std_logic_vector(2 downto 0);beginu1:corna port map(clr,af,aj,bf,bj,clk,shift,i1,i2,i3,i4);u2:ch41a port map(i6,i2

    24、,i1,i4,i3,i5);u3:sel port map(clk,i6);u4:disp port map(i5,q);net = 11;-with i6 select -sellread=1000 when 000 -0100 when 001 - 0010 when 100 - 0001 when others;sellread=1000 when i6=000 else 0100 when i6=001 else 0010 when i6=100 else 0001 ;-sellread=i6;end pingpong;4.指令译码器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity decoder isport(a,b,c:in std_logic; data1,data2:in std_logic; dataout:out std_logic);end decoder;


    注意事项

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

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




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

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

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


    收起
    展开