新手VHDL编程求助!为什么我的时序仿真没有输出!

tianyewai 2013-04-15 03:49:34
这是我的第一个程序,有很多用的不合适地方也请各位大神指出
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity div is
port(clk: in std_logic;
d: in std_logic_vector(7 downto 0);
fout:out std_logic);
end;
architecture one of div is
signal addcnt1:std_logic_vector(7 downto 0);
signal addcnt2:std_logic_vector(7 downto 0);
signal addcnt:std_logic_vector(7 downto 0);
signal qq:std_logic;
signal cen:std_logic;

begin
jj_one:process(clk)
begin
if d(0)='1' then
if clk'event and clk='1' then
if qq='0'then
addcnt1<=addcnt1+1;
else addcnt1<="00000000";
end if;
end if;
end if;
end process jj_one;

jj_two:process(clk)
begin
if d(0)='1' then
if clk'event and clk='0' then
if qq='0' then
addcnt2<=addcnt2+1;
else addcnt2<="00000000";
end if;
end if;
end if;
end process jj_two;

jj:process(clk)
begin
if d(0)='1' then
if addcnt=d then
cen<=not cen;
qq<='1';
else qq<='0';
end if;
end if;
end process jj;
addcnt<=addcnt1+addcnt2;
fout<=cen;
end one;
时序仿真没有输出,下图:
...全文
827 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tianyewai 2013-04-17
  • 打赏
  • 举报
回复
引用 1 楼 falloutmx 的回复:
你是时序逻辑,那么最大的那个if-else必须是跟clk相关的,不能把if d(0)='1'放最外面。 你的信号很多都没有初始值, ”cen<=not cen“cen没规定初值,编译器不知道not cen是1还是0,所以只能出x了。 看波形图多拖点信号
搞定了,你帮了我大忙了,谢谢哈!!
falloutmx 2013-04-16
  • 打赏
  • 举报
回复
你是时序逻辑,那么最大的那个if-else必须是跟clk相关的,不能把if d(0)='1'放最外面。 你的信号很多都没有初始值, ”cen<=not cen“cen没规定初值,编译器不知道not cen是1还是0,所以只能出x了。 看波形图多拖点信号
derk黄 2013-04-16
  • 打赏
  • 举报
回复
没初始值。 d(0)='1' 没有翻转

6,127

社区成员

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

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