- 1、本文档共2页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
动态扫描数码管显示VHDL
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY SAOMIAO IS
PORT(CLK: IN STD_LOGIC;
S1, S2, S3, S4, S5, S6: IN STD_LOGIC_VECTOR(3 DOWNTO 0);
WEI: OUT STD_LOGIC_VECTOR(5 DOWNTO 0);
LED: OUT STD_LOGIC_VECTOR(6 DOWNTO 0));
END ENTITY;
ARCHITECTURE behave OF SAOMIAO IS
SIGNAL CNT6 : INTEGER RANGE 0 TO 5 := 0;
SIGNAL SHUJU: STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN
PRO1:PROCESS(CLK)
BEGIN
IF CLKEVENT AND CLK = 1 THEN
CNT6 = CNT6 + 1;
CASE CNT6 IS
WHEN 0 = WEI = 000001; SHUJU = S1;
WHEN 1 = WEI = 000010; SHUJU = S2;
WHEN 2 = WEI = 000100; SHUJU = S3;
WHEN 3 = WEI = 001000; SHUJU = S4;
WHEN 4 = WEI = 010000; SHUJU = S5;
WHEN 5 = WEI = 100000; SHUJU = S6;
WHEN OTHERS = NULL;
END CASE;
END IF;
END PROCESS;
PRO2: PROCESS(SHUJU)
BEGIN
CASE SHUJU IS
WHEN 0000 = LED= 1111110 ; --- 0
WHEN 0001 = LED= 0110000 ; --- 1
WHEN 0010 = LED= 1101101 ; --- 2
WHEN 0011 = LED= 1111001 ; --- 3
WHEN 0100 = LED= 0110011 ; --- 4
WHEN 0101 = LED= 1011011 ; --- 5
WHEN 0110 = LED= 1011111 ; --- 6
WHEN 0111 = LED= 1110000 ; --- 7
WHEN 1000 = LED= 1111111 ; --- 8
WHEN 1001 = LED= 1111011 ; --- 9
WHEN others= LED= 0000000 ;
END CASE;
END PROCESS;
END ;
文档评论(0)