版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fen_pin isport( clk:in std_logic; clk_1ms:out std_logic; clk_10ms:out std_logic);end fen_pin;architecture FF2 of fen_pin issignal Q0:std_logic_vector(16 downto 0);signal Q1:std_logic_vector(17 downto 0);signal c0:std_log
2、ic;signal c1:std_logic;beginprocess(clk) begin if clk'event and clk='1' then if Q0=50000 then -1ms Q0<="00000000000000000" c0<=not c0; else Q0<=Q0+1; end if; if Q1=250000 then c1<=not c1; -10ms Q1<="000000000000000000" else Q1<=Q1+1; end if; end if;
3、end process;clk_1ms<=c0;clk_10ms<=c1;end FF2;-FEN PINlibrary ieee;use ieee.std_logic_1164.all;entity an_jian isport(clk_10ms:in std_logic;-时钟 col:in std_logic_vector(3 downto 0);-列扫描输入 row:out std_logic_vector(3 downto 0);-行扫描输出 keyout:out std_logic_vector(3 downto 0);-编码输出end an_jian;architec
4、ture FF1 of an_jian issignal rowreg: std_logic_vector(3 downto 0);signal con : std_logic_vector(7 downto 0);beginprocess(clk_10ms) begin if clk_10ms'event and clk_10ms= '1' then case rowreg is when "0111" => rowreg<= "1011" when "1011" => rowreg<
5、= "1101" when "1101" => rowreg<= "1110" when "1110" => rowreg<= "0111" when others => rowreg<= "0111" end case; end if;end process;row <= rowreg; -输出行扫描信号con <= rowreg & col;-合并行列信号process(clk_10ms) begin if clk_
6、10ms'event and clk_10ms= '1' then case con is when "11100111" => keyout<= "0001"-1 when "11101011" => keyout<= "0010"-2 when "11101101" => keyout<= "0011"-3 when "11101110" => keyout<= "010
7、0" -4 when "11010111" => keyout<= "0101"-5 when "11011011" => keyout<= "0110"-6 when "11011101" => keyout<= "0111"-7 when "11011110" => keyout<= "1000"-8 when "10110111" => keyou
8、t<= "1001"-9 when "10111011" => keyout<= "0000"-0 when "10111101" => keyout<= "1010"-10 when "10111110" => keyout<= "1011" -11 when "01110111" => keyout<= "1100"-12 when others =>
9、keyout<="1111"end case; end if; end process;end FF1;-AN JIANlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity an_jian_chu_li2 isport( clk_1ms:in std_logic; keyin:in std_logic_vector(3 downto 0); clk_key:out std_logic);end an_jian_chu_li2;architecture FF3 of
10、 an_jian_chu_li2 is signal key_temp:std_logic_vector(3 downto 0);signal count:std_logic_vector(9 downto 0);signal qq:std_logic;begin process(clk_1ms,count,key_temp,keyin) begin if keyin/="1111" then if clk_1ms'event and clk_1ms='0' then if key_temp=keyin then if count<1000 t
11、hen count<=count+1; else key_temp<="1111" end if; else key_temp<=keyin; count<="0000000000" end if; end if; end if; end process;qq<='1' when count>15 and count <30 else '0'clk_key<=qq;end FF3;-AN JIAN CHU LIlibrary ieee;use ieee.std_logic_1
12、164.all;use ieee.std_logic_unsigned.all;entity bi_jiao isport(clk_key:in std_logic; keyin:in std_logic_vector(3 downto 0); led_r,led_b:out std_logic);end bi_jiao;architecture FF4 of bi_jiao issignal key_temp:std_logic_vector(3 downto 0);signal count:std_logic_vector(1 downto 0);signal mi:std_logic_v
13、ector(11 downto 0);signal reg:std_logic_vector(11 downto 0);begin process(clk_key,keyin) begin if keyin/="1111" then if clk_key'event and clk_key='1' then if keyin=12 then count<="00"mi<="000000000000" led_r<='1'led_b<='1' else if
14、 count=0 then mi(11 downto 8)<=keyin; count<=count+1; elsif count=1 then mi(7 downto 4)<=keyin; count<=count+1; elsif count=2 then mi(3 downto 0)<=keyin; count<=count+1;else null; if count=3 and keyin=10 then reg<=mi; led_r<='0'led_b<='0' elsif keyin=11 the
15、n if reg=mi then led_r<='0'led_b<='1' else led_r<='1'led_b<='0' if mi="001100010100" then -密码314 led_r<='0'led_b<='1' end if; end if;end if; end if;end if;end if;end if; end process;end FF4;-BI JIAOlibrary IEEE;use IEEE.std_
16、logic_1164.all;use IEEE.std_logic_unsigned.all; entity MMS isport( clk:in std_logic; col:in std_logic_vector(3 downto 0);-列扫描输入 row:out std_logic_vector(3 downto 0);-行扫描输出 led_b,led_r:out std_logic);end MMS;architecture one of MMS iscomponent fen_pinport( clk:in std_logic; clk_1ms:out std_logic; clk
17、_10ms:out std_logic);end component;component an_jian port(clk_10ms:in std_logic;-时钟 col:in std_logic_vector(3 downto 0);-列扫描输入 row:out std_logic_vector(3 downto 0);-行扫描输出 keyout:out std_logic_vector(3 downto 0);-编码输出end component;component an_jian_chu_li2port(clk_1ms:in std_logic; keyin:in std_logic_vector(3 downto 0); clk_key:out std_logic);end component;component bi_jiao port(clk_key:in std_logic; keyin:in std_logic_vector(3 downto 0); led_r,led_b:out std_logic);end component;signal a,b,d:std_logic;signal c,f:std_logic_vector(3 downto 0);beginG1:fen_pin port map(clk
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 职业卫生评价考试题库及答案
- 预防接种人员技能测试题及答案
- 社区预防与保健测试题(有答案)
- 辽宁经济管理干部学院单招职业技能考试题库及答案
- 黑龙江民族职业学院单招职业适应性测试题库及答案
- 安徽省高职单招职业适应性测试考试题库及答案
- 2026年信阳职业技术学院单招职业适应性测试模拟试题及答案
- 2026年江苏省高职单招职业技能考试题库及答案
- 冲裁课程设计6
- 城轨专业形体课程设计
- 2026年文物保护工程从业资格考试(责任工程师近现代重要史迹及代表性建筑)经典试题及答案
- 雨课堂学堂在线学堂云《人工智能安全与伦理(北京航空航天)》单元测试考核答案
- 房屋安全鉴定服务投标方案(技术标)
- 中医特色护理在肾内科的应用
- 新能源项目典型案件争议解决实务-笔记
- 实习协议书模板设计
- 新人教版七年级上册英语全册课件(2024年新版教材)
- 2022年全国职业院校技能大赛赛项-ZZ-2022002农机维修赛项正式赛卷-植保无人机维修评分标准
- 呼吸道感染的抗病毒药物合理应用
- GB 40161-2021过滤机安全要求
- 北师大版七年级上册数学课件第五章 一元一次方程
评论
0/150
提交评论