哪位能告诉下这段VHDL程序的错误

wohu007 2011-05-25 11:46:56

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


entity store is
port( q4,q3,q2,q1:in std_logic_vector(3 downto 0);
d3,d2,d1:out std_logic_vector(3 downto 0);
c,k:in std_logic;
ygreen,yred,alert:out std_logic);

end store;

architecture rtl of store is
signal x3,x2,x1:std_logic_vector(3 downto 0);
begin
process(k,q4,c)
begin
if k='0' then
ygreen<='1';
yred<='0';
x3<=q3;
x2<=q2;
x1<=q1;
if q4='1'then alert<='1';
end if;
else
ygreen<='0';
yred<='1';
x3<=q4;
x2<=q3;
x1<=q2;

if c='1' then
alert<='1';
end if;
end if;
d3<=x3;
d2<=x2;
d1<=x1;
end process;
end rtl;
当K=0时,为1∼999Hz量程档,
...全文
156 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Bateagle 2011-05-28
  • 打赏
  • 举报
回复
else
ygreen<='0';
yred<='1';
x3<=q4;
x2<=q3;
x1<=q2;

if c='1' then
alert<='1';
这个顺序貌似有问题
应该是
else
if c='1' then
alert<='1';
else
ygreen<='0';
yred<='1';
x3<=q4;
x2<=q3;
x1<=q2;

quartusfas 2011-05-27
  • 打赏
  • 举报
回复
看了,感觉很乱,你最后的文字是设计的要求吗?你的K的值是外界给予的吗?Q1-Q4是单独给的数据是1位的还是全部都是4位?
chinadragon007 2011-05-27
  • 打赏
  • 举报
回复
用VHDL的人越来越少,你还是换换吧!
wohu007 2011-05-26
  • 打赏
  • 举报
回复
没人回复吗 帮忙啊 看下是哪里的错误
wohu007 2011-05-26
  • 打赏
  • 举报
回复
没人回复吗 帮忙啊 看下是哪里的错误
冰凝 2011-05-26
  • 打赏
  • 举报
回复
不懂,但是帮你顶顶让会的人来答,还好?
wohu007 2011-05-26
  • 打赏
  • 举报
回复
没人回复吗 帮忙啊 看下是哪里的错误
Great_Bug 2011-05-26
  • 打赏
  • 举报
回复
你先用个工具编译一下,把低级错误清除了再来....

6,125

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 硬件设计
社区管理员
  • 硬件设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧