整理LCD计数显示程序Word下载.docx
《整理LCD计数显示程序Word下载.docx》由会员分享,可在线阅读,更多相关《整理LCD计数显示程序Word下载.docx(15页珍藏版)》请在冰豆网上搜索。
![整理LCD计数显示程序Word下载.docx](https://file1.bdocx.com/fileroot1/2022-10/27/8504c896-adb8-4821-8161-3b25aeddbda3/8504c896-adb8-4821-8161-3b25aeddbda31.gif)
lcd_rw:
outstd_logic);
endcounter;
architectureBehavioralofcounteris
componentcounter60is
resetn:
outstd_logic_vector(7downto0));
endcomponent;
componentdecoderis
Port(din:
instd_logic_vector(3downto0);
dout:
outstd_logic_vector(8downto0));
componentlcd_interfaceis
port(
clk:
dout_s10:
instd_logic_vector(8downto0);
dout_s1:
lcd_data:
outstd_logic_vector(7downto0);
outstd_logic
);
signalddout_s10:
std_logic_vector(8downto0);
signalddout_s1:
signalddout:
std_logic_vector(7downto0);
begin
u1:
counter60portmap(clk,resetn,ddout);
u2:
decoderportmap(ddout(7downto4),ddout_s10);
u3:
decoderportmap(ddout(3downto0),ddout_s1);
u4:
lcd_interfaceportmap(clk,resetn,ddout_s10,ddout_s1,dout,lcd_en,lcd_rs,lcd_rw);
endBehavioral;
--------------------------------------------------------------------------------
--Company:
--Engineer:
--
--CreateDate:
13:
36:
1003/30/06
--DesignName:
--ModuleName:
count60-Behavioral
--ProjectName:
--TargetDevice:
--Toolversions:
--Description:
--Dependencies:
--
--Revision:
--Revision0.01-FileCreated
--AdditionalComments:
entitycounter60is
endcounter60;
architectureBehavioralofcounter60is
signalcount:
std_logic_vector(7downto0);
signalcount_div:
std_logic_vector(25downto0);
dout<
=count;
process(clk)
begin
if(clk'
eventandclk='
1'
)then
if(resetn='
0'
count_div<
=(others=>
'
);
elseif(count_div(25)='
)then
count_div<
'
);
else
=count_div+1;
endif;
endprocess;
process(clk,resetn)
ifresetn='
then
count<
elsifrising_edge(clk)then
if(count_div(25)='
ifcount(3downto0)="
1001"
count(3downto0)<
="
0000"
;
count(7downto4)<
=count(7downto4)+1;
else
=count(3downto0)+1;
ifcount="
01011001"
count<
00000000"
endif;
25:
3703/30/06
decoder-Behavioral
entitydecoderis
Port(din:
--四位二进制码输入
dout:
--输出LED七段码
enddecoder;
architectureBehavioralofdecoderis
process(din)
casedinis
when"
=>
dout<
100110000"
--30
0001"
100110001"
--31
0010"
100110010"
--32
0011"
100110011"
--33
0100"
100110100"
--34
0101"
100110101"
--35
0110"
100110110"
--36
0111"
100110111"
--37
1000"
100111000"
--38
100111001"
--39
whenothers=>
100100000"
;
endcase;
endprocess;
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_arith.all;
useieee.std_logic_unsigned.all;
entitylcd_interfaceis
endlcd_interface;
architecturelcd_interface_archoflcd_interfaceis
signallcd_we_n:
std_logic;
signallcd_en_int:
signal