点阵显示程序.docx
- 文档编号:30131871
- 上传时间:2023-08-05
- 格式:DOCX
- 页数:16
- 大小:15.54KB
点阵显示程序.docx
《点阵显示程序.docx》由会员分享,可在线阅读,更多相关《点阵显示程序.docx(16页珍藏版)》请在冰豆网上搜索。
点阵显示程序
16*16点阵显示程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
--------------------------------------------------------------------
entitydotis
port(data_in:
instd_logic_vector(7downto0);--databus
clk:
instd_logic;--时钟输入
dotc:
outstd_logic_vector(15downto0);--点阵列控制
dotr:
outstd_logic_vector(15downto0)--点阵行显示
);
enddot;
--------------------------------------------------------------------
architecturebehaveofdotis
signalcdount:
std_logic_vector(3downto0);
begin
process(clk)--显示时序控制
begin
ifclk'eventandclk='1'then
ifcdount<15then
cdount<=cdount+1;
else
cdount<="0000";
endif;
endif;
endprocess;
process(cdount)
begin
casecdountis
when"0000"=>dotc<="0000000000000001";--列选择(lg7088Ah)
when"0001"=>dotc<="0000000000000010";
when"0010"=>dotc<="0000000000000100";
when"0011"=>dotc<="0000000000001000";
when"0100"=>dotc<="0000000000010000";
when"0101"=>dotc<="0000000000100000";
when"0110"=>dotc<="0000000001000000";
when"0111"=>dotc<="0000000010000000";
when"1000"=>dotc<="0000000100000000";
when"1001"=>dotc<="0000001000000000";
when"1010"=>dotc<="0000010000000000";
when"1011"=>dotc<="0000100000000000";
when"1100"=>dotc<="0001000000000000";
when"1101"=>dotc<="0010000000000000";
when"1110"=>dotc<="0100000000000000";
when"1111"=>dotc<="1000000000000000";
whenothers=>dotc<="0000000000000000";
endcase;
ifdata_in="01101001"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示1
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111111111111111";
when"0110"=>dotr<="0111111111111101";
when"0111"=>dotr<="0000000000000000";
when"1000"=>dotr<="0111111111111111";
when"1001"=>dotr<="1111111111111111";
when"1010"=>dotr<="1111111111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in="01110010"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示2
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111111111110111";
when"0110"=>dotr<="1111001111111011";
when"0111"=>dotr<="1111010000011101";
when"1000"=>dotr<="1111011111101011";
when"1001"=>dotr<="1111011111110111";
when"1010"=>dotr<="1111011111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in="01111010"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示3
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111011111110111";
when"0110"=>dotr<="1111011110110111";
when"0111"=>dotr<="1111101101011011";
when"1000"=>dotr<="1111110011100011";
when"1001"=>dotr<="1111111111111111";
when"1010"=>dotr<="1111111111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=107then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示4
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111001111";
when"0100"=>dotr<="1111111111010111";
when"0101"=>dotr<="1111111111011011";
when"0110"=>dotr<="1111111111011101";
when"0111"=>dotr<="1000000000000000";
when"1000"=>dotr<="1111111111011111";
when"1001"=>dotr<="1111111111011111";
when"1010"=>dotr<="1111111111011111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=115then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示5
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111111111000001";
when"0110"=>dotr<="1011111110111101";
when"0111"=>dotr<="1101111101111101";
when"1000"=>dotr<="1110111011111101";
when"1001"=>dotr<="1111010111111101";
when"1010"=>dotr<="1111101111111101";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=116then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示6
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111111111111111";
when"0110"=>dotr<="1111000000000111";
when"0111"=>dotr<="1110110111111011";
when"1000"=>dotr<="1101110111111101";
when"1001"=>dotr<="1101110111111111";
when"1010"=>dotr<="1110001111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=x"6c"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示7
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111101";
when"0100"=>dotr<="1111111111111101";
when"0101"=>dotr<="1111111111111101";
when"0110"=>dotr<="1111111111111101";
when"0111"=>dotr<="1111111111111101";
when"1000"=>dotr<="1111111111111101";
when"1001"=>dotr<="1000000000000001";
when"1010"=>dotr<="1111111111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=x"75"then
casecdountis
when"0000"=>dotr<="111111*********1";--列显示显示8
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111110111110111";
when"0101"=>dotr<="1111101011101011";
when"0110"=>dotr<="1111011101011101";
when"0111"=>dotr<="1110111100111110";
when"1000"=>dotr<="1111011011011101";
when"1001"=>dotr<="1111110111101011";
when"1010"=>dotr<="1111111111110111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=x"7d"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示9
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111100111";
when"0101"=>dotr<="1111111111011011";
when"0110"=>dotr<="1110111110111101";
when"0111"=>dotr<="1111011111011011";
when"1000"=>dotr<="1111100000000111";
when"1001"=>dotr<="1111111111111111";
when"1010"=>dotr<="1111111111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=x"70"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示0
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111110000111111";
when"0110"=>dotr<="1111011111011111";
when"0111"=>dotr<="1110111111101111";
when"1000"=>dotr<="1101111111110111";
when"1001"=>dotr<="1110111111110111";
when"1010"=>dotr<="1111011111101111";
when"1011"=>dotr<="1111101111011111";
when"1100"=>dotr<="1111110000111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="111111*********1";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=x"71"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示.
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111111111111";
when"0101"=>dotr<="1111111111111111";
when"0110"=>dotr<="1111111000011111";
when"0111"=>dotr<="1111111000011111";
when"1000"=>dotr<="1111111000011111";
when"1001"=>dotr<="1111111111111111";
when"1010"=>dotr<="1111111111111111";
when"1011"=>dotr<="1111111111111111";
when"1100"=>dotr<="1111111111111111";
when"1101"=>dotr<="1111111111111111";
when"1110"=>dotr<="1111111111111111";
when"1111"=>dotr<="1111111111111111";
whenothers=>dotr<="1111111111111111";
endcase;
elsifdata_in=x"79"then
casecdountis
when"0000"=>dotr<="1111111111111111";--列显示显示+
when"0001"=>dotr<="1111111111111111";
when"0010"=>dotr<="1111111111111111";
when"0011"=>dotr<="1111111111111111";
when"0100"=>dotr<="1111111101111111";
when"0101"=>dotr<="1111111101111111
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 点阵 显示 程序
![提示](https://static.bdocx.com/images/bang_tan.gif)