WOLFRAM NOTEBOOK

WOLFRAM|DEMONSTRATIONS PROJECT

Negabinary Numbers to Decimal

number
2010
The negabinary representation of a number is its representation using base
-2
. Similarly, as with the ordinary binary number base, negabinary uses the digits 0 and 1, the difference being in its use of powers of
-2
to convert a negabinary number to its decimal equivalent. This Demonstration illustrates the steps of the conversion of a negabinary number into decimal. You choose a decimal number; the program converts it to negabinary and back to decimal.
Here is how to do this. First, powers of
-2
are selected according to the positions of the 1 digits, increasing from 0 in unit steps from right to left. Then the powers are computed and finally, adding all results gives the desired decimal equivalent. Some numbers have the same representation in binary and negabinary bases. Can you tell how we can recognize those from, say, their binary representation?
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.