An introduction to binary – Part 2

14 10 2008

* This post is a continuation for: An introduction to binary – Part 1

Continuing our introduction to binary, let’s think about how could we express numbers using an alphabet with only 2 elements:

The first two numbers are quite obvious:

But how can we go any further? Well, in decimal, when our alphabet is not enough to write a number, we increment the leftmost number and “reset” any number on its right side; so: 00, 01, ..., 09, 10, .., 19, 20, ..., 099, 100, ..., 199, 200, ...

In binary we just do the same:

00, 01, 10, 11, 100, 101, 110, 111, 1000, ...

If it’s not clear enough, think about the numbers as a car’s odometer (click to learn more about it):

When a digit reaches 9 then it becomes 0 and the next digit is incremented. If you bring this to the binary world, when a digit reaches 1, it becomes 0 and the next digit is incremented.

So, we might say that:

00000 = 0, \\ 00001 = 1, \\ 00010 = 2, \\ 00011= 3, \\ 00100 = 4, \\ 00101 = 5, \\ 00110 = 6, \\ 00111 = 7, \\ 01000 = 8, \\ 01001 = 9, \\ 01010 = 10, \\ 01011 = 11, \\ 01100 = 12,\\ 01101 = 13, \\ 01110 = 14, \\ 01111 = 15, \\ 10000 = 16...

Looking at those numbers, we can find a pattern: some of them have only one “1″ and some zeros: 1, 10, 100, 1000, 10000. If we look at their values, we’ll be able to notice that they are, respecively, 1, 2, 4, 8 and 16. All those numbers are powers of 2:

What if we replace the number 2 from the base of the multipliers for its binary notation?

To represent other numbers, we can work in an analogue fashion:

In other words: binary is just the same as decimal!

If we generalize the concept, we might say that:

Do I need to explain how to proceed for base 8 (octal) and base 16 (hexadecimal)?

Stay tuned and wait for An introduction to binary – Part 3 (I didn’t know how to sum).

* This post is a continuation for: An introduction to binary – Part 1

CodeCogs - An Open Source Numerical Library


Actions

Information

One response

14 10 2008
An introduction to binary - Part 1 « leonardopires.net

[...] Want to know more? See An introduction to binary – Part 2 [...]

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 )

Connecting to %s




Follow

Get every new post delivered to your Inbox.