集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 2913|回复: 3

哪位高手可帮我上传一个VHDL语言编的8*8点阵显示器

[复制链接]
HANG 发表于 2010-6-28 00:37:14 | 显示全部楼层 |阅读模式
哪位高手可帮我上传一个VHDL语言编的8*8点阵显示器 可显示0到9,和a到z及其大写。
interige 发表于 2010-6-28 02:01:03 | 显示全部楼层
library IEEE;<br>
use IEEE.STD_LOGIC_1164.ALL;<br>
use IEEE.STD_LOGIC_ARITH.ALL;<br>
use IEEE.STD_LOGIC_UNSIGNED.ALL;<br>
<br>
--&nbsp;&nbsp;Uncomment the following lines to use the declarations that are<br>
--&nbsp;&nbsp;provided for instantiating Xilinx primitive components.<br>
--&nbsp;&nbsp;library UNISIM;<br>
--&nbsp;&nbsp;use UNISIM.VComponents.all;<br>
<br>
entity lcd913 is<br>
&nbsp; &nbsp; Port ( clk: in std_logic;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs : out std_logic;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rw : out std_logic;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Enable: out std_logic;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; s: out std_logic_vector(7 downto 0));<br>
end lcd913;<br>
architecture Behavioral of lcd913 is<br>
TYPE AD_STATES IS(S0,S1,S2,S3,S4,S5,S8,S9,S10,S11,s12,s13);<br>
SIGNAL CURRENT_STATE,NEXT_STATE:AD_STATES; <br>
signal newclk: std_logic; <br>
--subtype state_type is std_logic_vector(3 downto 0);<br>
--signal current_state:state_type;<br>
--signal next_state:state_type;<br>
--constant s0:state_type:="0000";<br>
--constant s1:state_type:="0001";<br>
--constant s2:state_type:="0010";<br>
--constant s3:state_type:="0011";<br>
--constant s4:state_type:="0100";<br>
--constant s5:state_type:="0101";<br>
--constant s6:state_type:="0110";<br>
--constant s7:state_type:="0111";<br>
--constant s8:state_type:="1000";<br>
--constant s9:state_type:="1001";<br>
--constant s10:state_type:="1010";<br>
--constant s11:state_type:="1011";<br>
begin<br>
<br>
process(clk)<br>
&nbsp; &nbsp; &nbsp; &nbsp; variable count: integer;<br>
begin<br>
&nbsp; &nbsp; &nbsp; &nbsp; if(clk'event and clk='1' )then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count:=count+1;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; if count=45000 then <br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; current_state&lt;=next_state;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; count:=0;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; end if;&nbsp;&nbsp;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end if;<br>
<br>
end process;<br>
<br>
process(current_state)<br>
begin <br>
case current_state is<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s0=&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00110000";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next_state&lt;=s1;<br>
<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s1=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00110000";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='0';<br>
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; next_state&lt;=s2;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when s2=&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00110000";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next_state&lt;=s3;<br>
<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s3=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00110000";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='0';<br>
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; next_state&lt;=s4;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when s4=&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00001100";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next_state&lt;=s5;<br>
<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s5=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00001100";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next_state&lt;=s8;<br>
<br>
&nbsp; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; when s8=&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00000110";<br>
&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s9;<br>
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;when s9=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00000110";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='0';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s10;<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s10=&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00100000";<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s11;<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s11=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00100000";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='0';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s12;<br>
&nbsp; &nbsp;&nbsp;&nbsp;when s12=&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00110001";<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s13;<br>
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;when s13=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;rs&lt;='1';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rw&lt;='0';<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s&lt;="00110001";<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enable&lt;='0';<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s0;<br>
&nbsp; &nbsp;&nbsp;&nbsp;when others=&gt;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;next_state&lt;=s0;<br>
end case;<br>
end process;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
end Behavioral;<br>
<br>
<br>
不知这个合适不..
shifenglian 发表于 2010-7-28 12:49:35 | 显示全部楼层
路过,支持,学习学习
huanggua89 发表于 2010-8-16 15:22:06 | 显示全部楼层
恩,不错,看啊看
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2024-11-16 04:36 , Processed in 0.067468 second(s), 24 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表