EDA技术试验怎么在16*16格子中显示自己的名字 我要程序!

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/07 18:36:47

EDA技术试验怎么在16*16格子中显示自己的名字 我要程序!
EDA技术试验怎么在16*16格子中显示自己的名字 我要程序!

EDA技术试验怎么在16*16格子中显示自己的名字 我要程序!
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY LED IS
PORT(CLK :IN STD_LOGIC;
--DIN :IN STD_LOGIC_VECTOR(3 DOWNTO 0);
DOTOUT :OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
SELOUT:OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END LED;
ARCHITECTURE A OF LED IS
SIGNAL Q:STD_LOGIC_VECTOR(7 DOWNTO 0);
SIGNAL SO:STD_LOGIC_VECTOR(1 DOWNTO 0);
SIGNAL CP:STD_LOGIC;
SIGNAL S:STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN
K1:PROCESS(CLK)
BEGIN
IFRISING_EDGE(CLK) THEN
IF S="1111" THEN
S<="0000";
IF Q="11111111"THEN
Q<="00000000";CP<='1';
ELSE Q<=Q+1;CP<='0';
END IF;
ELSE S<=S+1;
END IF;
END IF;
END PROCESS K1;
K2:PROCESS(CP)
BEGIN
IF RISING_EDGE(CP) THEN
IF SO="11"THEN
SO<="00";
ELSE SO<=SO+1;
END IF;
END IF;
END PROCESS K2;
K3:PROCESS(S,SO)
BEGIN
IF SO="00"THEN
CASE S IS --yang
WHEN"0000"=>SELOUT<="0000";DOTOUT<="0000000000000000";
WHEN"0001"=>SELOUT<="0001";DOTOUT<="0000010000001000";
WHEN"0010"=>SELOUT<="0010";DOTOUT<="0000001100001000";
WHEN"0011"=>SELOUT<="0011";DOTOUT<="0000000011001000";
WHEN"0100"=>SELOUT<="0100";DOTOUT<="1111111111111111";
WHEN"0101"=>SELOUT<="0101";DOTOUT<="0000000001001000";
WHEN"0110"=>SELOUT<="0110";DOTOUT<="0000000110001000";
WHEN"0111"=>SELOUT<="0111";DOTOUT<="0000100000001010";
WHEN"1000"=>SELOUT<="1000";DOTOUT<="0010010001000010";
WHEN"1001"=>SELOUT<="1001";DOTOUT<="0001001101100010";
WHEN"1010"=>SELOUT<="1010";DOTOUT<="0000100011010010";
WHEN"1011"=>SELOUT<="1011";DOTOUT<="0000011001001010";
WHEN"1100"=>SELOUT<="1100";DOTOUT<="0100000111000110";
WHEN"1101"=>SELOUT<="1101";DOTOUT<="1000000001000010";
WHEN"1110"=>SELOUT<="1110";DOTOUT<="0111111111000000";
WHEN"1111"=>SELOUT<="1111";DOTOUT<="0000000000000000";
--WHEN OTHERS =>NULL;
END CASE;
ELSIF SO="01"THEN
CASE S IS --hao
WHEN"0000"=>SELOUT<="0000";DOTOUT<="0000000000000000";
WHEN"0001"=>SELOUT<="0001";DOTOUT<="0000010000010000";  
WHEN"0010"=>SELOUT<="0010";DOTOUT<="0000010001100000";
WHEN"0011"=>SELOUT<="0011";DOTOUT<="1111111000000001";
WHEN"0100"=>SELOUT<="0100";DOTOUT<="0000000111000110";
WHEN"0101"=>SELOUT<="0101";DOTOUT<="0000000000110000";
WHEN"0110"=>SELOUT<="0110";DOTOUT<="0000000010100000";
WHEN"0111"=>SELOUT<="0111";DOTOUT<="1111110010011100";
WHEN"1000"=>SELOUT<="1000";DOTOUT<="0100010010001000";
WHEN"1001"=>SELOUT<="1001";DOTOUT<="0100010010001000";
WHEN"1010"=>SELOUT<="1010";DOTOUT<="0100010011111111";
WHEN"1011"=>SELOUT<="1011";DOTOUT<="0100010010001000";
WHEN"1100"=>SELOUT<="1100";DOTOUT<="0100010010001000";
WHEN"1101"=>SELOUT<="1101";DOTOUT<="0100010010001000";
WHEN"1110"=>SELOUT<="1110";DOTOUT<="1111110010001000";
WHEN"1111"=>SELOUT<="1111";DOTOUT<="0000000010000000";
--WHEN OTHERS =>NULL;
END CASE;
ELSE SELOUT<="ZZZZ";DOTOUT<="ZZZZZZZZZZZZZZZZ";
END IF;
END PROCESS K3;
END A;