第一范文网 - 专业文章范例文档资料分享平台

数电实验 - 图文

来源:用户分享 时间:2025/6/1 3:40:44 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

juzhenxianshi:process(clk) begin

if(clk='1' and clk'event)then --逐行扫描显示图形

if saomiao(7 downto 0)=\or saomiao(7 downto 0)=\then saomiao(7 downto 0)<=\;g_data<= g_matrix0;r_data<= r_matrix0; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix1;r_data<= r_matrix1; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix2;r_data<= r_matrix2; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix3;r_data<= r_matrix3; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix4;r_data<= r_matrix4; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix5;r_data<= r_matrix5; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix6;r_data<= r_matrix6; elsif saomiao(7 downto 0)=\then

saomiao(7 downto 0)<=\;g_data<= g_matrix7;r_data<= r_matrix7; end if; end if;

end process juzhenxianshi; end a;

2.分频模块

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity div is

Port ( clkin:in STD_LOGIC; clkout_kb:out STD_LOGIC; clkout_dianzhen:out STD_LOGIC; clkout_controller:out STD_LOGIC; clkout_static:out STD_LOGIC

); end div;

architecture one of div is

signal clk1:std_logic:='0';----keyboard fenpin

signal counter1:integer range 0 to 16666; --分频计数信号 signal clk2:std_logic:='0';----dianzhen fenpin signal counter2:integer range 0 to 49999;--500HZ分频

signal clk3:std_logic:='0';----controller

signal counter3:integer range 0 to 2499999;--2499999 10HZ分频 1666666 15HZ分频

signal clk4:std_logic:='0';----static

signal counter4:integer range 0 to 24999;--2499999 10HZ分频 1666666 15HZ分频 begin

process(clkin)---kb begin

if clkin'event and clkin='1'then if counter1=16666 then clk1<=not clk1; counter1<=0; else

counter1<=counter1+1; --加计数 end if; end if; end process;

process(clkin)---dianzhen begin

if clkin'event and clkin='1'then if counter2=49999 then clk2<=not clk2; counter2<=0; else

counter2<=counter2+1; end if;

end if; end process;

process(clkin)---controller begin

if clkin'event and clkin='1'then if counter3=2499999 then clk3<=not clk3; counter3<=0; else

counter3<=counter3+1; end if; end if; end process;

process(clkin)---static begin

if clkin'event and clkin='1'then if counter4=24999 then clk4<=not clk4; counter4<=0; else

counter4<=counter4+1; end if; end if; end process;

clkout_kb<=clk1;

clkout_dianzhen<=clk2; clkout_controller<=clk3;

clkout_static<=clk4; 将分得的时钟信号分别赋给不同模块 end one;

3.数码管显示模块

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_Unsigned.all;

use ieee.std_logic_ARITH.all;

entity static is port(

clear,clk_in:in std_logic;

num:out std_logic_vector( 6 downto 0); --七段数码管控制型号 cat:out std_logic_vector(5 downto 0); --数码管选通信号 to_display:in std_logic_vector(41 downto 0) —-数据信号 ); end entity;

architecture one of static is

signal status:integer range 0 to 6; begin

process(clk_in) begin

if(clk_in'event and clk_in='1') then if status=6 then status<=1;

else status<=status+1; --加计数实现状态切换依次扫描数码管 end if; end if; end process;

process(status) begin

case status is

when 1=> num<=to_display(41 downto 35);cat<=\; when 2=> num<=to_display(34 downto 28);cat<=\; when 3=> num<=to_display(27 downto 21);cat<=\; when 4=> num<=to_display(20 downto 14);cat<=\; when 5=> num<=to_display(13 downto 7);cat<= \;

when 6=> num<=to_display(6 downto 0);cat<= \; --根据数据控制数码管选通

when others => num<=\;cat<=\; end case; end process; end one;

搜索更多关于: 数电实验 - 图文 的文档
数电实验 - 图文.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2xope90f1v3j4le875p3_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top