How can I compare two numbers in the form of Redundant binary representation RBR ?
Any Idea ?
How can I compare two numbers in the form of Redundant binary representation RBR
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.