冗余二进制表示 RBR 的比较

发布于 2024-09-01 12:11:22 字数 141 浏览 2 评论 0原文

如何比较 冗余二进制表示 RBR 形式的两个数字? 有什么想法吗?

How can I compare two numbers in the form of Redundant binary representation RBR ?
Any Idea ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

西瓜 2024-09-08 12:11:22

此页面有一些有关 RBR 的信息。这还包括减法器和转换器。要确定两个 RBR 数字是否相等,您要做的就是将两个数字相减,然后检查结果是否与零的表示形式之一匹配。

找出一个数字是否小于零有点困难:您必须从最高有效数字开始找到第一个不为零的 RBR 数字(本文中的 r_k 和 s_k)。如果为负数,则减法结果为负数。否则该数字为正数。总而言之,找到第一对“00”或“11”。如果它是“00”,则该数字为负数,否则为正数。

This page has some information about RBR. This also includes a subtractor and a converter. What you do to find out, if two RBR numbers are equal is to subtract both numbers and then check, if the result matches one of the representations of zero.

Finding out, if a number is smaller than zero is a little bit harder: You have to find the first RBR digit (r_k and s_k in the article), which is not zero, starting from the most significant digit. If it is negative the result of the subtraction is negative. Otherwise the number is positive. So to sum it up, find the first pair that is either "00" or "11". If it is "00" the number is negative, positive otherwise.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文