版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、中北大学课 程 设 计 说 明 书学生姓名:学 院:专 业: 学 号: 08060441 电子与计算机科学技术学院 电子科学与技术题 目: 利用键盘控制点阵进行ASIC字符显示指导教师: 张会新 职称: 讲师2011 年 6月 23 日目录目录21、 课程设计目的32、课程设计内容和要求 32.1、设计内容32.2、设计要求33、设计方案及实现情况 33.1、设计思路33.2、工作原理及框图33.3、各模块功能描述3.4、仿真结果3.5、实验箱验证情况4、课程设计总结5、参考文献1、课程设计目的1.学习操作数字电路设计实验开发系统,掌握矩阵键盘输入模块和点阵显示模块的工作原理及应用。2.掌握组
2、合逻辑电路、时序逻辑电路的设计方法。3.学习掌握可编程器件设计的全过程。2、课程设计内容和要求:2.1、设计内容利用键盘控制点阵进行26个字母的显示2.2、设计要求1学习掌握键盘控制模块、点阵显示模块的工作原理及应用;2. 熟练掌握VHDL编程语言,编写键盘控制模块的控制逻辑;3. 仿真所编写的程序,模拟验证所编写的模块功能;4. 下载程序到芯片中,硬件验证所设置的功能,能够实现ASIC字符显示;5. 整理设计内容,编写设计说明书。3、 设计方案及实现情况3.1、设计思路根据题目设计要求,本系统拟采用自顶向下设计方法,顶层采用原理图设计方法,将整个系统分为键盘控制16×16点阵显示(
3、key)一个模块,通过模块编写程序实现模块功能,最后将模块进行综合实现整个系统的功能,通过键盘控制点阵进行ASIC字符的显示。3.2、工作原理及框图图1 系统整体设计原理图系统的输入信号有:系统时钟信号CLK,按键信号(KININ3.0)。系统的输出信号有:点阵行驱动输出信号(LEDOUT0.15),点阵列选和键盘扫描公用信号(SEL3.0)。系统工作过程为:键盘上按下一个键,扫描信号扫描到按键按下时,在点阵上显示对应的字母。如键盘上按下“0”键时,点阵显示字母“48”;按下键“1”,点阵显示字母“49”如此,键盘上前16个键就分别对应了16个ASIC字符。3.3、各模块功能描述实验箱中4
4、215;8矩阵键盘的电路原理图如图2所示。图2 4×8矩阵键盘电路原理图该矩阵键盘的工作原理为:扫描信号为BCOM8.1,在BCOM8.1前已接有一个3-8译码器,3-8译码器的输入为SEL0SEL2。当3-8译码器的输入为000时,即BCOM1为0,其他位为1,我们按下第一排第一键,此时KIN0输出0,KIN1KIN3输出全为1,按下第二排第二键时,KIN1输出0,其他输出1;当3-8译码器输入为001时,即BCOM2为0,我们按下第一排第二键,此时KIN0输出0,KIN1KIN3输出全为1,同理其他键依此类推。键盘上的每个按键就是一个开关,当某键被按下时,该按键的接点会呈现0状态
5、,反之为1。扫描信号为SEL2.0进入3-8译码器,再从译码器输出到键盘,所以第一次只能扫描一排,依此周而复始。若从KIN3.0输出的皆为1时,表示没有按键按下,代表该列没有按键被按下,则不进行按键编码的操作,反之,如果有被按下时,则应将KIN3.0读出的值送到译码电路进行编码。按键位置与数码的关系如下表所示:3.4、仿真结果1、VHDL语言源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity key isarchitecture rtl of key isbeginprocess(
6、clk)variable tmp: std_logic_vector(3 downto 0); variable sel: std_logic_vector(3 downto 0); variable dat: std_logic_vector(3 downto 0); beginif clk'event and clk='1' thenif tmp="1111" thentmp:="0000"elsetmp:=tmp+1;end if;end if;if kin = "1111" then sel:=tmp;
7、 dat := "1111" else end if; selout <= tmp; if (sel="0000" or sel="1000") and kin="1110" then dat := "0000" dat := "0001" - 0 - 1 elsif (sel="0001" or sel="1001") and kin="1110" then elsif (sel="0010&quo
8、t; or sel="1010") and kin="1110" then port(clk:in std_logic; ledout:out std_logic_vector(15 downto 0); selout:out std_logic_vector(3 downto 0); kin:in std_logic_vector(3 downto 0); end key; -dat := "0010" dat := "0011" dat := "0100" dat := "0101
9、" dat := "0110"- 2 - 3 - 4 - 5 - 6elsif (sel="0011" or sel="1011") and kin="1110" then elsif (sel="0110" or sel="1110") and kin="1110" then elsif (sel="0111" or sel="1111") and kin="1110" then el
10、sif (sel="0000" or sel="1000") and kin="1101" then elsif (sel="0001" or sel="1001") and kin="1101" thendat := "0111" - 7 dat := "1000" - 8 dat := "1001" - 9 dat := "1010" - A dat := "1011"-
11、Belsif (sel="0100" or sel="1100") and kin="1101" then elsif (sel="0101" or sel="1101") and kin="1101" then elsif (sel="0110" or sel="1110") and kin="1101" then elsif (sel="0111" or sel="1111"
12、;) and kin="1101" then elsif (sel="0010" or sel="1010") and kin="1011" thendat := "1100" - C dat := "1101" - D dat := "1110" - E dat := "1111" - Felsif (sel="0011" or sel="1011") and kin="1011&qu
13、ot; then elsif (sel="0100" or sel="1100") and kin="1011" then elsif (sel="0101" or sel="1101") and kin="1011" then end if;- if kin = "1111" thencase dat iswhen"0000"=> -0 zhongcase tmp iswhen "0001" => le
14、dout<="0000000000000000" when "0010" => ledout<="0011111000110000" when "0011" => ledout<="0110001100111000" when "0100" => ledout<="0110001100111100" when "0101" => ledout<="0110001100110
15、110" when "0110" => ledout<="0011111000110011" when "0111" => ledout<="0110001101111111" when "1000" => ledout<="0110001100110000" when "1010" => ledout<="0110001100110000"when "0000&quo
16、t; => ledout<="0000000000000000" -0when "1001" => ledout<="0110001100110000"when "1011" => ledout<="0011111001111000" when "1100" => ledout<="0000000000000000" when "1101" => ledout<="0
17、000000000000000" when "1111" => ledout<="0000000000000000" when others => null; when "0001" => -1 end case; case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000"
18、; when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0011111000110000" when "0100" => ledout<="0110001100111000" when "0101" => ledout<="0110001100111100" when "0110" =>
19、; ledout<="0110001100110110" when "0111" => ledout<="0111111000110011" when "1000" => ledout<="0110000001111111" when "1001" => ledout<="0110000000110000" when "1010" => ledout<="011000000
20、0110000" when "1011" => ledout<="0011000000110000" when "1100" => ledout<="0001111001111000" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "111
21、1" => ledout<="0000000000000000" when others => null; when "0010" => -2 when "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000
22、000000" when "0011" => ledout<="0001110001111111" when "0100" => ledout<="0011011000000011" when "0101" => ledout<="0110001100000011" when "0110" => ledout<="0110000110000011" when "0111
23、" => ledout<="0110101100111111" when "1000" => ledout<="0110101101100000" when "1001" => ledout<="0110001101100000" when "1010" => ledout<="0110001101100000" when "1011" => ledout<=&quo
24、t;0011011001100011" when "1100" => ledout<="0001110000111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" end
25、 case; case tmp iswhen others => null; when "0011" => -3 end case;case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" whe
26、n "0011" => ledout<="0001100001111111" when "0100" => ledout<="0001110000000011" when "0101" => ledout<="0001111000000011" when "0110" => ledout<="0001100000000011" when "0111" => led
27、out<="0001100000111111" when "1000" => ledout<="0001100001100000" when "1001" => ledout<="0001100001100000" when "1010" => ledout<="0001100001100000" when "1011" => ledout<="00011000011000
28、11" when "1100" => ledout<="0111111000111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => n
29、ull;end case;when "0100" => -4 52 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<
30、="0011111001111111" when "0100" => ledout<="0110001100000011" when "0101" => ledout<="0110000000000011" when "0110" => ledout<="0011000000000011" when "0111" => ledout<="0001100000111111"
31、; when "1000" => ledout<="0000110001100000" when "1001" => ledout<="0000011001100000" when "1010" => ledout<="0000001101100000" when "1011" => ledout<="0110001101100011" when "1100" =>
32、; ledout<="0111111100111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => null;end case;when "0101"
33、=> -5 53 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0011111001111111" when
34、"0100" => ledout<="0110001100000011" when "0101" => ledout<="0110000000000011" when "0110" => ledout<="0110000000000011" when "0111" => ledout<="0011110000111111" when "1000" => ledou
35、t<="0110000001100000" when "1001" => ledout<="0110000001100000" when "1010" => ledout<="0110000001100000" when "1011" => ledout<="0110001101100011" when "1100" => ledout<="0011111000111110
36、" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => null;end case;when "0110" => -6 54 case tmp iswhen "0
37、000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0011000001111111" when "0100" => ledout<=&
38、quot;0011100000000011" when "0101" => ledout<="0011110000000011" when "0110" => ledout<="0011011000000011" when "0111" => ledout<="0011001100111111" when "1000" => ledout<="0111111101100000"
39、when "1001" => ledout<="0011000001100000" when "1010" => ledout<="0011000001100000" when "1011" => ledout<="0011000001100011" when "1100" => ledout<="0111100000111110" when "1101" =>
40、ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => null;end case;when "0111" => -7 55 case tmp iswhen "0000" => ledout<="00
41、00000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0111111101111111"when "0100" => ledout<="0000001100000011" when &qu
42、ot;0101" => ledout<="0000001100000011" when "0110" => ledout<="0000001100000011" when "0111" => ledout<="0011111100111111" when "1000" => ledout<="0110000001100000" when "1001" => ledout&l
43、t;="0110000001100000" when "1010" => ledout<="0110000001100000" when "1011" => ledout<="0110001101100011" when "1100" => ledout<="0011111000111110" when "1101" => ledout<="0000000000000000&qu
44、ot; when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => null;end case;when "1000" => -8 56 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001
45、" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0001110001111111" when "0100" => ledout<="0000011000000011" when "0101" => ledout<=&quo
46、t;0000001100000011" when "0110" => ledout<="0000001100000011" when "0111" => ledout<="0011111100111111" when "1000" => ledout<="0110001101100000" when "1001" => ledout<="0110001101100000" whe
47、n "1010" => ledout<="0110001101100000" when "1011" => ledout<="0110001101100011" when "1100" => ledout<="0011111000111110" when "1101" => ledout<="0000000000000000" when "1110" => led
48、out<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => null;end case;when "1001" => -9 57 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="00000
49、00000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0111111101111111" when "0100" => ledout<="0110001100000011" when "0101" => ledout<="0110000000000011" when "
50、;0110" => ledout<="0110000000000011" when "0111" => ledout<="0011000000111111"when "1000" => ledout<="0001100001100000" when "1001" => ledout<="0000110001100000" when "1010" => ledout<=
51、"0000110001100000" when "1011" => ledout<="0000110001100000" when "1100" => ledout<="0000110000111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000"
52、 when "1111" => ledout<="0000000000000000" when others => null;end case;when "1010" => -A 65 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010&qu
53、ot; => ledout<="0000000000000000" when "0011" => ledout<="0111111100011100" when "0100" => ledout<="0000001100000110" when "0101" => ledout<="0000001100000011" when "0110" => ledout<="0
54、000001100000011" when "0111" => ledout<="0011111100111111" when "1000" => ledout<="0110000001100011" when "1001" => ledout<="0110000001100011" when "1010" => ledout<="0110000001100011" when &
55、quot;1011" => ledout<="0110001101100011" when "1100" => ledout<="0011111000111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout
56、<="0000000000000000" when others => null;end case;when "1011" => -B 66 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="00000000
57、00000000" when "0011" => ledout<="0001110000011100" when "0100" => ledout<="0000011000000110" when "0101" => ledout<="0000001100000011" when "0110" => ledout<="0000001100000011" when "01
58、11" => ledout<="0011111100111111" when "1000" => ledout<="0110001101100011" when "1001" => ledout<="0110001101100011" when "1010" => ledout<="0110001101100011" when "1011" => ledout<=&q
59、uot;0110001101100011"when "1100" => ledout<="0011111000111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" wh
60、en others => null;end case; when "1100" => -c 67 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011"
61、; => ledout<="0111111100011100" when "0100" => ledout<="0110001100000110" when "0101" => ledout<="0110000000000011" when "0110" => ledout<="0110000000000011" when "0111" => ledout<="001
62、1000000111111" when "1000" => ledout<="0001100001100011" when "1001" => ledout<="0000110001100011" when "1010" => ledout<="0000110001100011" when "1011" => ledout<="0000110001100011" when &qu
63、ot;1100" => ledout<="0000110001111111" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000" when others => null;end case;when
64、 "1101" => -D 68 case tmp iswhen "0000" => ledout<="0000000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0011111000
65、011100" when "0100" => ledout<="0110001100000110" when "0101" => ledout<="0110001100000011" when "0110" => ledout<="0110001100000011" when "0111" => ledout<="0011111000111111" when "1000
66、" => ledout<="0110001101100011" when "1001" => ledout<="0110001101100011" when "1010" => ledout<="0110001101100011" when "1011" => ledout<="0110001101100011" when "1100" => ledout<=&quo
67、t;0011111000111110" when "1101" => ledout<="0000000000000000" when "1110" => ledout<="0000000000000000" when "1111" => ledout<="0000000000000000"when others => null;when "0000" => ledout<="0000
68、000000000000" when "0001" => ledout<="0000000000000000" when "0010" => ledout<="0000000000000000" when "0011" => ledout<="0011111000011100" when "0100" => ledout<="0110001100000110" when &quo
69、t;0101" => ledout<="0110001100000011" when "0110" => ledout<="0110001100000011" when "0111" => ledout<="0111111000111111" when "1000" => ledout<="0110000001100011" when "1001" => ledout<="0110000001100011" when "1010" => ledout<="0110000001100011" when "1011" => ledout<="0011000001100011" when "1100" => ledout<="0001111000111110"
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 安装工程合同的工程质量保修3篇
- 文明迟到保证书样本3篇
- 房屋买卖合同英文版深度解析3篇
- 房屋买卖合同被判无效后的维权途径3篇
- 教育培训行业教育咨询师聘用协议3篇
- 污水处理厂泵站维护合同
- 征收土地补偿协议书
- 重庆市户外广告租赁合同
- 重庆川菜火锅店装修施工合同
- 体育馆楼面信息化施工协议
- 2023年德化城建集团有限公司招聘笔试题库及答案解析
- 一年级语文上册百词竞赛(含答案)
- 集成电路板维修方法
- 小升初小学数学几何图形应用题专题练习《巧算周长》
- 旅游学概论最新复习题库与答案
- 水电站调速器系统最权威讲义课件
- 胶合板生产工艺
- 课程设计--高位自卸汽车的设计
- 初中数学八年级上《整式的乘法及因式分解》知识点及经典题型
- 天罡仪表CR40系列数据集中器用户手册
- 威尼斯狂欢节长笛钢琴伴奏谱PierreAgricolaGeninC
评论
0/150
提交评论