正交解码器布尔方程

时间:2016-06-09 03:04:31

标签: vhdl encoder quartus

为了从正交输入实现位置计数器,我使用了以下真值表:

Similar Image

方向和计数/运动的我的布尔方程(Ap和Bp分别是A的前一个值和B的前一个值)可​​以在下面看到

Count <= (not Ap and not Bp and not A and B) or (not Ap and not Bp and A and not B) or 
     (not Ap and Bp and not A and not B) or (not Ap and Bp and A and B) or 
        (Ap and Bp and not A and B) or (Ap and Bp and A and not B) or 
     (Ap and not Bp and not A and not B) or (Ap and not Bp and A and B); -- complete boolean on conditions for a count value of 1

Direction <= (not Bp and A) or (Bp and not A); -- complete boolean on conditions for forward direction

只要B领先A

,人们就会期望结果能够统计

但我得到的只是:

Simulation result

有什么可能出错的建议吗?如果我的布尔方程式与您的布尔方程式不同,请发布它。

0 个答案:

没有答案