找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1077|回复: 0
打印 上一主题 下一主题
收起左侧

这个FPGA程序错误什么意思?尽力了,弄不出来

[复制链接]
跳转到指定楼层
楼主
ID:711481 发表于 2020-5-14 00:30 来自手机 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity 111 is
port(clk50m:in std_logic;
rst :in std_logic;
d:out std_logic_vector(3 downto 0);
s:out std_logic_vector(7 downto 0));
end 111;
architecture ab of 111 is
signal t:std_logic_vector(24 downto 0):="0000000000000000000000000";
signal clk:std_logic:='0';
signal cn:integer range 0 to 9;
begin
process(clk50m)
begin
if rising_edge(clk50m) then
if t="10111110101111100000111111"then
t<="0000000000000000000000000";
clk<= not clk;
else t<=t+1;
  end if;
  end if;
  end process;
process(clk,rst,cn)
begin
if rst='0'then cn<=0;
elsif clk'event and clk='1' then
if cn<9 then cn<=cn+1;
else cn <=0;
end if;
end if;
end process;
process(cn)
begin
case cn is
when 0=>d<="1110";s<="00000011";
when 1=>d<="1110";s<="10011111";
when 2=>d<="1110";s<="00100101";
when 3=>d<="1110";s<="00001101";
when 4=>d<="1110";s<="10011001";
when 5=>d<="1110";s<="01001001";
when 6=>d<="1110";s<="11000001";
when 7=>d<="1110";s<="00011111";
when 8=>d<="1110";s<="00000001";
when 9=>d<="1110";s<="00011001";
when others =>null;
end case;
end process;
end architecture ab;

Screenshot_20200514_003000.jpg (54.72 KB, 下载次数: 24)

Screenshot_20200514_003000.jpg
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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