EDA16x16点阵滚动+动画显示.docx
- 文档编号:11046354
- 上传时间:2023-02-24
- 格式:DOCX
- 页数:21
- 大小:61.49KB
EDA16x16点阵滚动+动画显示.docx
《EDA16x16点阵滚动+动画显示.docx》由会员分享,可在线阅读,更多相关《EDA16x16点阵滚动+动画显示.docx(21页珍藏版)》请在冰豆网上搜索。
EDA16x16点阵滚动+动画显示
四、课程设计的总体步骤
1、单个字符的显示(如:
黄):
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityxianshiis
port(clk2:
instd_logic;
rck,sck:
outstd_logic;
si:
outstd_logic);
end;
architectureoneofxianshiis
signalsel:
std_logic_vector(3downto0);
signalq:
std_logic_vector(31downto0);
signali:
integerrange0to31;
signalcoi:
std_logic;
begin
process(sel,clk1)
begin
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="0111";
when"1101"=>q<="1011";
when"1110"=>q<="1101";
when"1111"=>q<="1110";
whenothers=>null;
endcase;
ifclk1'eventandclk1='1'then
si<=q(i);i<=i+1;coi<='0';
ifi=31theni<=0;coi<='1';sel<=sel+'1';
endif;
rck<=notcoi;
endif;
endprocess;
sck<=clk1;
end;
时序仿真:
从图中可以看出,当clk1在第32个上升沿rck变为低电频,sck与clk1是同一电频,故此程序满足要求。
2、多个字符的跳动显示(如:
黄小红):
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityxianshiis
port(clk1:
instd_logic;
clk2:
instd_logic;
rck,sck:
outstd_logic;
si:
outstd_logic);
end;
architectureoneofxianshiis
signallie:
std_logic_vector(3downto0);
signalsel:
std_logic_vector(3downto0);
signalq:
std_logic_vector(31downto0);
signali:
integerrange0to31;
signalcoi:
std_logic;
begin
process(sel,clk1,clk2)
begin
ifclk2'eventandclk2='1'then
lie<=lie+'1';
endif;
caselieis
when"0000"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="0111";
when"1101"=>q<="1011";
when"1110"=>q<="1101";
when"1111"=>q<="1110";
whenothers=>null;
endcase;
when"0001"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="0111";
when"1101"=>q<="1011";
when"1110"=>q<="1101";
when"1111"=>q<="1110";
whenothers=>null;
endcase;
when"0010"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="0111";
when"1101"=>q<="1011";
when"1110"=>q<="1101";
when"1111"=>q<="1110";
whenothers=>null;
endcase;
whenothers=>null;
endcase;
ifclk1'eventandclk1='1'then
si<=q(i);i<=i+1;coi<='0';
ifi=31theni<=0;coi<='1';sel<=sel+'1';
endif;
rck<=notcoi;
endif;
endprocess;
sck<=clk1;
end;
时序仿真:
从上图看出,当clk1在第32个上升沿rck变为低电频,sck与clk1是同一电频,故此程序满足要求。
3、汉字的滚动和动画显示(如:
黄小红+笑脸):
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityxianshiis
port(clk1:
instd_logic;
clk2:
instd_logic;
rck,sck:
outstd_logic;
si:
outstd_logic);
end;
architectureoneofxianshiis
signallie:
std_logic_vector(3downto0);
signalsel:
std_logic_vector(3downto0);
signalq:
std_logic_vector(31downto0);
signali:
integerrange0to31;
signalcoi:
std_logic;
begin
process(sel,clk1,clk2)
begin
ifclk2'eventandclk2='1'then
lie<=lie+'1';
endif;
caselieis
when"0000"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="0111";
when"1101"=>q<="1011";
when"1110"=>q<="1101";
when"1111"=>q<="1110";
whenothers=>null;
endcase;
when"0001"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="0111";
when"1010"=>q<="1011";
when"1011"=>q<="1101";
when"1100"=>q<="1110";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"0010"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="0111";
when"0111"=>q<="1011";
when"1000"=>q<="1101";
when"1001"=>q<="1110";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"0011"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="0111";
when"0100"=>q<="1011";
when"0101"=>q<="1101";
when"0110"=>q<="1110";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"0100"=>
caseselis
when"0000"=>q<="0111";
when"0001"=>q<="1011";
when"0010"=>q<="1101";
when"0011"=>q<="1110";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"0101"=>
caseselis
when"0000"=>q<="1110";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="0111";
when"1110"=>q<="1011";
when"1111"=>q<="1101";
whenothers=>null;
endcase;
when"0110"=>
caseselis
when"0000"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="0111";
when"1100"=>q<="1011";
when"1101"=>q<="1101";
when"1110"=>q<="1110";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"0111"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="0111";
when"1000"=>q<="1011";
when"1001"=>q<="1101";
when"1010"=>q<="1110";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"1000"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="0111";
when"0101"=>q<="1011";
when"0110"=>q<="1101";
when"0111"=>q<="1110";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"1001"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="0111";
when"0010"=>q<="1011";
when"0011"=>q<="1101";
when"0100"=>q<="1110";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="1111";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"1010"=>
caseselis
when"0000"=>q<="1101";
when"0001"=>q<="1110";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="1111";
when"1101"=>q<="1111";
when"1110"=>q<="0111";
when"1111"=>q<="1011";
whenothers=>null;
endcase;
when"1011"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="0111";
when"1100"=>q<="1011";
when"1101"=>q<="1101";
when"1110"=>q<="1110";
when"1111"=>q<="1111";
whenothers=>null;
endcase;
when"1100"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"0011"=>q<="1111";
when"0100"=>q<="1111";
when"0101"=>q<="1111";
when"0110"=>q<="1111";
when"0111"=>q<="1111";
when"1000"=>q<="1111";
when"1001"=>q<="1111";
when"1010"=>q<="1111";
when"1011"=>q<="1111";
when"1100"=>q<="0111";
when"1101"=>q<="1011";
when"1110"=>q<="1101";
when"1111"=>q<="1110";
whenothers=>null;
endcase;
when"1101"=>
caseselis
when"0000"=>q<="1111";
when"0001"=>q<="1111";
when"0010"=>q<="1111";
when"
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA16x16 点阵 滚动 动画 显示