CPLD实验报告(2)

2018-12-17 12:58

实验三 数码管静态显示设计

1.实验要求

利用VHDL设计一数码管静态显示程序并仿真,再利用实验箱进行效果检验,使在脉冲的作用下数码管从0到7循环显示。

2.实验目的

了解数码管静态显示的原理,学会设计需要用到的一些基本芯片。

3.设计方案分析

此功能实现可用一八进制计数器和一显示译码器组成。在1Hz 脉

冲的作用下计数器循环计数,每次计数后,显示译码器都会进行译码输出,输出结果接到数码管让其显示。

4.程序设计 library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity sample is

port(clk,rst,en:in std_logic; count:out std_logic;

y:out std_logic_vector(7 downto 0)); end sample;

architecture one of sample is

signal cq:std_logic_vector(2 downto 0); begin

process(clk,rst) begin

if rst='1' then cq<=\

elsif clk'event and clk='1' then if en='1' then cq<=cq+'1'; else cq<=cq;

end if; end if; end process; process(cq) begin

if cq=\ else count<='0'; end if;

end process; process(cq) begin case cq is

when \ when \ when \ when \ when \ when \ when \ when \ end case; end process; end one;

5.仿真结果

实验四

数码管动态显示设计

1.实验要求

利用VHDL设计一数码管动态显示程序并仿真,再利用实验箱进行效果检验,使数码管从左往右依次显示1~8。

2.实验目的

了解数码管动态显示的原理,学会设计需要用到的一些基本芯片。

3.设计方案分析

此功能实现仍可用一八进制计数器和一显示译码器组成。但比起

静态显示时需要考虑数码管的位选端,所以需要在程序中多一输出量。

4.程序设计

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity sample2 is

port(clk,rst,en:in std_logic; count:out std_logic;

y:out std_logic_vector(7 downto 0); wela:out std_logic_vector(2 downto 0)); end sample2;

architecture one of sample2 is

signal cq:std_logic_vector(2 downto 0); begin

process(clk,rst) begin

if rst='1' then cq<=\elsif clk'event and clk='1' then if en='1' then cq<=cq+'1'; else cq<=cq;

end if; end if;

end process; process(cq) begin

if cq=\ else count<='0'; end if; end process; process(cq) begin case cq is

when \ wela<=\when \ wela<=\when \ wela<=\when \ wela<=\when \ wela<=\when \ wela<=\when \ wela<=\when \ wela<=\end case; end process; end one;

5.仿真结果

6.实验结果图


CPLD实验报告(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:精品小学教学楼施工组织设计方案2017年修订版

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: