VHDL中出现的五种if语句的使用

圈1:if 条件 then
顺序语句;
end if; —满足单一条件即可
圈2: if 条件 then
if 条件 then
顺序语句;
end if;
end if; —嵌套使用,下一个if是建立在上一个if正确的情况下
圈3:if 条件 then
顺序语句;
elsif 条件 then
顺序语句;
elsif 条件 then
顺序语句;

end if; —嵌套使用,elsif是建立在上一个If或elsif不正确的情况下,反映出优先级的先后。
圈4:if 条件 then
顺序语句;
else
顺序语句;
end if; —是一个比较器,即只有两种情况
圈5:if 条件 then
顺序语句;
end if;
if 条件 then
顺序语句;
end if; ----两个if并列,但都要放在process中顺序执行,注意这里是每一if完之后紧跟着一个end if

猜你喜欢

转载自blog.csdn.net/weixin_44404722/article/details/88424597