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

利用键盘控制点阵进行十进制加法计算显示 - 图文

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

when \ when \ when \ when \ when \

when others => null;

end case;

case sel is

when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \ when \

when others => null;

end case;

case sel is

20

显示加号

when \

when \

when \when \when \when \when \when \when \when \when \when \when \when \when \when \when \when \when others => null;

end case;

when others=>null; end case;

end process;

end leddisp_arc; 加法计算模块:

该模块实现对点阵显示方式的控制,控制模块的引脚功能如图5所示,其中:CLK为时钟输入端;RST为复位端,低电平有效;Q[1..0]为功能方式输入端,用来识别按下键的类型;DATAIN[4..0]接收来自KEYBOARD模块送来的键值;DATAOUT[4..0]输出键值码;当按下ENTER键输出键码值大于9时,进位输出CO为高电平,点亮一个发光二极管。

21

图5 加法计算模块图

源程序: library ieee;

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

entity control is port(

rst,clk : in std_logic;

q : in std_logic_vector(1 downto 0); datain : in std_logic_vector(4 downto 0); dataout : out std_logic_vector(4 downto 0); co : out std_logic ); end control;

architecture control_arc of control is signal s : std_logic_vector(4 downto 0); signal temp1 : std_logic_vector(4 downto 0); begin

process(q,rst,clk,datain) begin

if(rst='0')then

dataout<=\

co<='0';

22

elsif (clk'event and clk='1') then

if (q=\

co<='0'; dataout<=datain;

elsif (q=\

s<=datain; dataout<=\

elsif (q=\

temp1<=datain+s;

if(temp1>\

co<='1';

temp1<=temp1-\ dataout<=temp1; else dataout<=temp1;

end if;

elsif (q=\

dataout<=\

end if;

end if;

end process; end control_arc;

3.4、仿真结果:

(1)键盘扫描模块仿真图:

图6 键盘扫描模块仿真图

(2)点阵显示模块仿真图:

23

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