




已阅读5页,还剩20页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
数字电路实验报告双色点阵显示控制器 班级: 学号: 姓名: 2013年11月12号目录一、 设计任务要求二、 系统设计三、 仿真波形及分析四、 源程序五、 功能说明六、 元器件清单及资源利用情况七、故障及问题分析八、总结和结论一、设计任务要求1、基本要求:1.固定红色显示一个汉字或图形,显示亮度4级可调,用一个btn按钮实现亮度调节,亮度变化视觉效果要尽量明显。2.用从红到绿8级渐变色显示一个固定汉字或图形。3.分别用单字循环显示、左右滚动显示、上下滚动显示三种显示方式单色显示四个汉字或图形,显示过程中,显示方式用一个btn按键进行切换。4,。显示的图形或汉字要尽量饱满美观。 2、提高要求:1.滚动显示过程中实现四种显示颜色的自动变换,颜色变化视觉效果要尽量明显。2.自拟其它功能。二、系统设计1、设计框图1、 系统结构框图本系统主要由三个模块组成,其中控制器用于控制程序运行、储存当前状态并控制输出显示,点阵用于显示游戏界面,按钮输入用于输入控制信息。2、逻辑划分方框图3、系统流程图4、mds图 游戏运行状态的具体状态转移图三、仿真波形及波形分析逐行扫描,并点亮红灯,改变红灯的占空比可以得到不同亮度的显示。逐行扫描,并点亮红绿灯,改变红绿灯的占空比可以得到不同颜色的显示。上下及左右滚动显示,因为显示变化时延过长,波形过密,不方便显示。按一次键,只产生一个脉冲,脉冲宽度为防抖动时钟的脉宽。四、源程序及注释library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity dianzhen isport( clk:in std_logic; dtn1:in std_logic; dtn2:in std_logic; dtn3:in std_logic;row:out std_logic_vector (7 downto 0); listr:out std_logic_vector (7 downto 0);listg:out std_logic_vector (7 downto 0);end dianzhen ;architecture a of dianzhen issignal temp:integer range 0 to 99:=0;signal temp1:integer range 0 to 9:=0;signal temp2:integer range 0 to 9:=0;signal temp3:integer range 0 to 49:=0;signal temp4:integer range 0 to 9:=0;signal temp5:integer range 0 to 99:=0;signal clk_500k:std_logic;signal clk_50k:std_logic;signal clk_5k:std_logic;signal clk_1k:std_logic;signal clk_100:std_logic;signal clk_1:std_logic;signal num:std_logic_vector (2 downto 0):=000; signal num1:integer range 0 to 1119;signal num2:integer range 0 to 31:=0;signal num3:std_logic_vector (2 downto 0):=000;signal count:integer range 0 to 499;signal count1:integer range 0 to 49; signal j:integer range 0 to 499;signal i:integer range 0 to 31:=0; signal kind:std_logic_vector (1 downto 0):=00;signal color:std_logic_vector (1 downto 0):=00;signal sel:std_logic_vector (2 downto 0); signal sel1:std_logic:=0;signal sel2:std_logic:=0;signal sel3:std_logic:=0;signal resetmp1,resetmp2:std_logic:=0;signal resetmp3,resetmp4:std_logic:=0;signal resetmp5,resetmp6:std_logic:=0;signal flag:std_logic:=0;signal flag2:std_logic:=0;signal flag3:std_logic:=0;type vol_type is array(38 downto 0)of std_logic_vector(7 downto 0);type sol_type is array(31 downto 0)of std_logic;signal vol:vol_type:=( -luck字库 01111110, 01000000,01000000, 01000000, 01000000,01000000,00000000, 00000000, 01001100,01010000,01100000,01100000,01010000,01001100,00000000,00000000,00111100,01000010,01000000,01000000,01000010, 00111100,00000000,00000000,00111100,01000010,01000010,01000010,01000010,01000010,00000000,00000000,01111110,01000000,01000000,01000000,01000000,01000000, 00000000);signal sol0:sol_type:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0); -good字库 用于水平滚动显示signal sol1:sol_type:=(0,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0, 0,0,1,1,1,1,0,0, 0,0,1,1,1,0,0,0);signal sol2:sol_type:=(0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0, 0,1,0,0,0,0,1,0, 0,1,0,0,0,1,0,0);signal sol3:sol_type:=(0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0, 0,1,0,0,0,0,1,0, 0,1,0,0,0,0,0,0);signal sol4:sol_type:=(0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0, 0,1,0,0,0,0,1,0, 0,1,0,0,1,1,1,0);signal sol5:sol_type:=(0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0, 0,1,0,0,0,0,1,0, 0,1,0,0,0,1,0,0);signal sol6:sol_type:=(0,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0, 0,0,1,1,1,0,0,0);signal sol7:sol_type:=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0);beginprocess(clk) -分频器 500k beginif clkevent and clk=1 then if temp=99 then temp=0; else temp=temp+1;end if; if temp50 then clk_500k=1; else clk_500k=0; end if;end if;end process;process(clk_500k) -分频器 50k beginif clk_500kevent and clk_500k=1 then if temp1=9 then temp1=0; else temp1=temp1+1;end if; if temp15 then clk_50k=1; else clk_50k=0; end if;end if;end process;process(clk_50k) -分频器 5k beginif clk_50kevent and clk_50k=1 then if temp2=9 then temp2=0; else temp2=temp2+1;end if; if temp25 then clk_5k=1; else clk_5k=0; end if;end if;end process;process(clk_50k) -分频器 1k beginif clk_50kevent and clk_50k=1 then if temp3=49 then temp3=0; else temp3=temp3+1;end if; if temp325 then clk_1k=1; else clk_1k=0; end if;end if;end process;process(clk_1k) -分频器 100 beginif clk_1kevent and clk_1k=1 then if temp4=9 then temp4=0; else temp4=temp4+1;end if; if temp45 then clk_100=1; else clk_100=0; end if;end if;end process;process(clk_100)-分频器 1 beginif clk_100event and clk_100=1 then if temp5=99 then temp5=0; else temp5=temp5+1;end if; if temp550 then clk_1=1; else clk_1=0; end if;end if;end process;process(clk_500k) -显示红字beginif clk_500kevent and clk_500k=1 thenif sel3=1 then if count=499 then count=0; else count=count+1; end if; if num=111 then num=000; else num jjjjnull; end case; if countrow=01111111; listr=10011001;listgrow=10111111; listr=01011010;listgrow=11011111; listr=00111100;listgrow=11101111; listr=11111111;listgrow=11110111; listr=11111111;listgrow=11111011; listr=00111100;listgrow=11111101; listr=01011010;listgrow=11111110; listr=10011001;listgrow=11111111;listr=00000000;listg=00000000; end case; else row=11111111; end if; end if; if sel1=1 then -显示彩色字 if num1=1119 then num1=0; else num1row=01111111; listr=10011001;listgrow=10111111; listr=01011010;listglistglistrrow=11011111; listr=00111100;listglistglistrrow=11101111; listr=11111111;listglistglistrrow=11110111; listr=11111111;listglistrlistgrow=11111011; listr=00111100;listglistrlistgrow=11111101; listr=01011010;listglistrlistgrow=11111110; listr=00000000;listgnull; end case;end if; if sel2=1 then -三种循环显示模式 if count1=49 then if num3=111 then num3=000; else num3 = num3+1; end if; count1=0; else count1=count1+1;end if; if kind=00 then -分屏显示 if (0=num2)and(num2=5) then i=0; elsif (6=num2)and(num2=11) then i=8; elsif (12=num2)and(num2=17) then i=16; elsif (18=num2)and(num2=23) then irow=01111111; listr=vol(i);listgrow=10111111; listr=vol(i+1);listgrow=11011111; listr=vol(i+2);listgrow=11101111; listr=vol(i+3);listgrow=11110111; listr=vol(i+4);listgrow=11111011; listr=vol(i+5);listgrow=11111101; listr=vol(i+6);listgrow=11111110; listr=vol(i+7);listgrow=11111111;listr=00000000; end case; end if; if kind=01 then -上下滚动显示 i case num3 iswhen000=row=01111111; listr=vol(i);listgrow=10111111; listr=vol(i+1);listgrow=11011111; listr=vol(i+2);listgrow=11101111; listr=vol(i+3);listgrow=11110111; listr=vol(i+4);listgrow=11111011; listr=vol(i+5);listgrow=11111101; listr=vol(i+6);listgrow=11111110; listr=vol(i+7);listgrow=11111111;listr case num3 iswhen000=row=01111111; listr=vol(i);if count125 then listg=vol(i);else listgrow=10111111; listr=vol(i+1); if count125 then listg=vol(i+1);else listgrow=11011111; listr=vol(i+2); if count125 then listg=vol(i+2); else listgrow=11101111; listr=vol(i+3); if count125 then listg=vol(i+3); else listgrow=11110111; listr=vol(i+4); if count125 then listg=vol(i+4);else listgrow=11111011; listr=vol(i+5); if count125 then listg=vol(i+5); else listgrow=11111101; listr=vol(i+6); if count125 then listg=vol(i+6); else listgrow=11111110; listr=vol(i+7); if count125 then listg=vol(i+7); else listgrow=11111111;listr case num3 iswhen000=row=01111111; listg=vol(i);if count125 then listr=vol(i);else listrrow=10111111; listg=vol(i+1);if count125 then listr=vol(i+1);else listrrow=11011111; listg=vol(i+2);if count125 then listr=vol(i+2);else listrrow=11101111; listg=vol(i+3);if count125 then listr=vol(i+3); else listrrow=11110111; listg=vol(i+4);if count125 then listr=vol(i+4);else listrrow=11111011; listg=vol(i+5);if count125 then listr=vol(i+5); else listrrow=11111101; listg=vol(i+6);if count125 then listr=vol(i+6); else listrrow=11111110; listg=vol(i+7);if count125 then listr=vol(i+7); else listrrow=11111111;listg case num3 iswhen000=row=01111111; listgrow=10111111; listgrow=11011111; listgrow=11101111; listgrow=11110111; listgrow=11111011; listgrow=11111101; listgrow=11111110; listgrow=11111111;listgrow=11111111;listg=00000000;end case;end if; if kind=10 then -左右滚动显示 listg=00000000; irow=01111111; listr(0)=sol0(i);listr(1)=sol0(i+1);listr(2)=sol0(i+2);listr(3)=sol0(i+3); listr(4)=sol0(i+4);listr(5)=sol0(i+5);listr(6)=sol0(i+6);listr(7)row=10111111; listr(0)=sol1(i);listr(1)=sol1(i+1);listr(2)=sol1(i+2);listr(3)=sol1(i+3);listr(4)=sol1(i+4);listr(5)=sol1(i+5);listr(6)=sol1(i+6);listr(7)row=11011111; listr(0)=sol2(i);listr(1)=sol2(i+1);listr(2)=sol2(i+2);listr(3)=sol2(i+3);listr(4)=sol2(i+4);listr(5)=sol2(i+5);listr(6)=sol2(i+6);listr(7)row=11101111;listr(0)=sol3(i);listr(1)=sol3(i+1);listr(2)=sol3(i+2);listr(3)=sol3(i+3); listr(4)=sol3(i+4);listr(5)=sol3(i+5);listr(6)=sol3(i+6);listr(7)row=11110111;listr(0)=sol4(i);listr(1)=sol4(i+1);listr(2)=sol4(i+2);listr(3)=sol4(i+3);listr(4)=sol4(i+4);listr(5)=sol4(i+5);listr(6)=sol4(i+6);listr(7)row=11111011; listr(0)=sol5(i);listr(1)=sol5(i+1);listr(2)=sol5(i+2);listr(3)=sol5(i+3); listr(4)=sol5(i+4);listr(5)=sol5(i+5);listr(6)=sol5(i+6);listr(7)row=11111101; listr(0)=sol6(i);listr(1)=sol6(i+1);listr(2)=sol6(i+2);listr(3)=sol6(i+3);listr(4)=sol6(i+4);listr(5)=sol6(i+5);listr(6)=sol6(i+6);listr(7)row=11111110; listr(0)=sol7(i);listr(1)=sol7(i+1);listr(2)=sol7(i+2);listr(3)=sol7(i+3);listr(4)=sol7(i+4);listr(5)=sol7(i+5);listr(6)=sol7(i+6);listr(7)row=11111111;listr=00000000; end case; end if;end if;end if; end process;process(clk_1k) -按键防抖beginif clk_1kevent and clk_1k=1 then if flag=1 then flag=0;end if;if flag2=1 then flag2=0;end if;if flag3=1 then flag3=0;end if; resetmp2=resetmp1;resetmp1=dtn1;resetmp4=resetmp3;resetmp3=dtn2;resetmp6=resetmp5;resetmp5=dtn3;end if; flag=(not dtn1) and resetmp1 and resetmp2; flag2=(not dtn2) and resetmp3 and resetmp4; flag3=(not dtn3) and resetmp5 and resetmp6;end process;process(clk_1)beginif clk_1event and clk_1=1 then if color=11 then color=00; else color=color+1;end if; if num2=31 then num2=0; else num2=num2+1;end if;end if;end process;process(clk,flag,flag2,flag3) beginif clkevent and clk=1 thenif flag=1 then -调节亮度 if sel=011 then sel=000;else sel = sel+1;end if;sel1=0;sel2=0;sel3=1;end if;if flag2=1 then -彩色切换 sel=111; sel1=1; sel2=0;sel3=0;end if;if flag3=1 then -显示模式切换 if kind=10 then kind=00; else kind = kind+1; end if; sel=111; sel1=0; sel2=1;sel3=0;end if;end if;end process;end a;五、实现功能说明通过三个按键btn1,btn2,btn3 完成对双色点阵显示的操作。通电起始后,点阵不显示,随意按键后进入相对应的模式。btn1对应切换亮度模式,按下后显示米字,再按下米字改变颜色,总共对应四种颜色。btn2对应八色显示,按下后显示逐行不同色彩的米字。btn3对应显示切换,一共有三种不同模式显示,分别是:1、 分屏显示,点阵中依次显示luck的英文字样。2、 上下滚动显示,点阵中自下而上滚动显示luck字样,同时每次变换后改变一次屏幕中显示的色彩。3、 左右滚动显示,点阵中自左往右滚动显示good字样。六、元器件清单及资源利用情况1、使用的元器件芯片epm1270t144c5按键3个led点阵8*8个单元2、资源利用七、 故障及问题分析1、故障:防抖模块不灵敏,按下按键后可能发生了不止一次跳变。问题分析:设计防抖的时候按照老师给出的代码并经过了自己的修改,在前期使用的时候只注意了有效性,没注意灵敏的问
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 ISO/IEC TR 14496-24:2025 EN Information technology - Coding of audio-visual objects - Part 24: Audio and systems interaction
- 【正版授权】 ISO/IEC 14763-5:2025 EN Information technology - Implementation and operation of customer premises cabling - Part 5: Sustainability
- 【正版授权】 ISO 7176-21:2025 EN Wheelchairs - Part 21: Requirements and test methods for electromagnetic compatibility of electrically powered wheelchairs and scooters,and battery char
- 【正版授权】 IEC 61084-1:1991/AMD1:1993 EN-D Amendment 1 - Cable trunking and ducting systems for electrical installations - Part 1: General requirements
- 通管局考试试题及答案
- 测量初级考试试题及答案
- 智能驾校模拟考试试题及答案
- 华大基因面试题及答案
- 四川土壤试题及答案
- 军人专升本考试题及答案
- 助产专业介绍
- 工程项目招投标流程及风险防控措施
- 《电机与拖动基础》课件(共十一章)
- 民宿合伙协议书范本
- 新学期教学工作会议上校长讲话:把功夫下在课堂里把心思放在学生上把质量落到细节中
- GB/T 2794-2022胶黏剂黏度的测定
- GB/T 41365-2022中药材种子(种苗)白术
- GB/T 31717-2015病媒生物综合管理技术规范环境治理蚊虫
- 水利工程设计变更表格
- 上海交通大学学生生存手册
- 收益还原法课件
评论
0/150
提交评论