views:

34

answers:

1

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

+1  A: 

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.

ablaeul