云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 利用键盘控制点阵进行十进制加法计算显示 - 图文

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

  • 62 次阅读
  • 3 次下载
  • 2025/6/22 13:51:06

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

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

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 显示加号

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com