VHDL中多个if递进的问题 10
我需要的代码作用是:如果cin=0那么yout2=yout2,否则yout2=yout2+1。接着判断yout2,如果yout2<10,则yout3=yout3,否则yo...
我需要的代码作用是:如果cin=0那么yout2=yout2,否则yout2=yout2+1。接着判断yout2,如果yout2<10,则yout3=yout3,否则yout3=yout3+1。接着判断yout3,如果yout3<10,则yout4=yout4,否则yout4=yout4+1.
我的代码是这样的,一直仿真不成功,求解释:
begin
yout<="0000000000000000";
if cin='0' then
yout1<=youtin;
else
yout1<=youtin;
yout2<=yout2+1;
end if;
if yout2<10 then
yout3<=yout3;
else
yout2<=yout2-10;
yout3<=yout3+1;
end if;
if yout3<10 then
yout4<=yout4;
else
yout3<=yout3-10;
yout4<=yout4+1;
end if;
if yout4>10 then
yout4<=yout4-10;
end if; 展开
我的代码是这样的,一直仿真不成功,求解释:
begin
yout<="0000000000000000";
if cin='0' then
yout1<=youtin;
else
yout1<=youtin;
yout2<=yout2+1;
end if;
if yout2<10 then
yout3<=yout3;
else
yout2<=yout2-10;
yout3<=yout3+1;
end if;
if yout3<10 then
yout4<=yout4;
else
yout3<=yout3-10;
yout4<=yout4+1;
end if;
if yout4>10 then
yout4<=yout4-10;
end if; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询