共1条
1/1 1 跳转至页
请教大虾

architecture behav of test1 is
type my_state is(state1,state2);
signal p_state,n_state:my_state;
signal n:integer range 0 to 10;
begin
process(p_state,hf1)
begin
case p_state is
when state1 =>
n<=0;
dataout<="00000000";
if(hf1='0') then
n_state<=state2;
else
n_state<=state1;
end if;
when state2 =>
dataout<=datain1;
n<= n + 1;
if(n = 10) then
n_state<=state1;
else
n_state<=state2;
end if;
when others =>
null;
end case;
end process;
process(rst,clk)
begin
if(rst='1') then
p_state<=state1;
elsif(clk='1' and clk'event) then
p_state<=n_state;
end if;
end process;
end behav;
本意想在状态为state2时,把10个输入送给输出,然后又回到state1
结果仿真的时候,发现在state2情况下,n并不是在每个时钟
的上升沿递增,而是一系列很乱的数字,象毛刺似的,状态也就一直
处于state2下,但小弟我实在看不出程序哪儿有问题,请教大虾
我用的是max+plus2 10.0版本
谢谢
关键词: 请教 大虾
共1条
1/1 1 跳转至页
回复
打赏帖 | |
---|---|
【Zephyr】使用Zephyr外设初始化过程解析被打赏30分 | |
【S32K146】S32DS watchdog 配置使用被打赏20分 | |
【Zephyr】使用 IAR 调试 Zephyr 镜像被打赏20分 | |
赚取电动螺丝刀+电源电路理论知识分享1被打赏5分 | |
我想要一部加热台+分享常见运算放大器电路的应用被打赏5分 | |
【Zephyr】MCXN947 Zephyr 开发入门适配shell被打赏20分 | |
我想要一部加热台+常见的MOS管驱动电路被打赏5分 | |
【我要开发板】6.联合MATLAB记录数据被打赏50分 | |
【换取手持数字示波器】MicrochipMPLABHarmony框架下串口调试printf输出记录被打赏29分 | |
【瑞萨RA2E1开发板】:使用ADC功能实现位移传感器采集方案被打赏20分 |