为了从正交输入实现位置计数器,我使用了以下真值表:
方向和计数/运动的我的布尔方程(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
,人们就会期望结果能够统计但我得到的只是:
有什么可能出错的建议吗?如果我的布尔方程式与您的布尔方程式不同,请发布它。