Miscellaneous

Negabinary

I recently came across this term. I’m liking this term! 😛

So here is one blog post dedicated to this.

Negabinary representation of a number n is it’s representation in base -2. So how do we convert X in negabinary?

Let’s take X = 41

The process is as follows:

41 = -2 * -20 + 1

-20 = -2 * 10 + 0

10 = -2 * -5 + 0

-5 = -2 * 3 + 1

3 = -2 * -1 + 1

-1 = -2 * 1 + 1

1 = -2 * 0 + 1

Now let’s trace back the remainders (in red) and you will get the Negabinary of 41 which is : 1111001

Here is a useful link to know more.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s