Binary Numbers What the heck are binary numbers?

The numbers you see in everyday life are "base 10" numbers. In other words, we have 10 different number symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9), that are the basis of every other number you can write.

Every number you see in base 10 is some combination of these 10 symbols.

The binary number system is the set of "base 2" numbers. In binary numbers, every numerical value can be written using only two symbols, 0 and 1.

Therefore, binary numbers look like: 1, 10, 101, 1010, and 11011101010.

Why do we care?

We as humans don't really care, since binary numbers look really strange to us. (For example, "100" in binary is really what we think of as "4"). However, we should care, because binary numbers don't look strange to computers. In fact, computers actually operate in binary. We'll get to "why" later, but if you want to know computers inside and out, you need to know how binary numbers work.

What do I have to do to understand them?

If you have an understanding of how base 10 numbers work, figuring out base 2 numbers isn't much of a stretch. To do this, we will need to know some basic exponent rules.

What am I going to do in this module?

Basically, you're going to learn how different number systems work. We'll discuss binary, base 10, and some other systems of numbers.

Most importantly, you'll learn how to convert binary numbers into base 10 numbers, and base 10 numbers into binary numbers. In other words, you're going to be able to translate human number symbols into computer number symbols.

Basically, the base ten number system works like this: certain human beings came up with ten distict number symbols (0-9), and started counting....

0, 1, 2, 3, 4, 5, 6, 7, 8, 9....Oops!

When they got to the last symbol, they needed to figure out how to write the number for the value that comes after 9. So, they started over at 0, and tacked on a number to the left that helped keep track the number of times we got past "9". So, that's where the tens place comes in...

...1, 2, 3, 4, 5, 6,7 , 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, (hey! we got to 9 again, so we have to bump that tens place up one), 20, 21, 22......and so on, and so on....

Once the tens place gets past 9, you have to add another number that counts up the number of times you get to one hundred.

 97, 98, 99, 100, 101, 102, ....

 So, this is where you get the ones place, the tens place, the hundreds place, the thousands place, and all the other places you tack on as your numbers get bigger and bigger.


Take the number 1,234:

1

2

3

4

1000s place

100s Place

10s place

1s place

You could rewrite 1,234 as:

1*1000 + 2*100+ 3*10 + 4*1


Why would we want to?


Note that these "places" are powers of "10" . You know, 100=1, 101=10, 102=100, 103=1000, 104=10000, etc, etc.

(remember: any number other than 0 to the power "0" equals one!)

Of course! We're in a base 10 system. All the places are powers of 10.

Question 1: Why do you think that we came up with a base ten number system? Why not base eight, or base sixteen? What's so special about the number ten?

_______________________________________________

II.

and number systems OTHER THAN base 10:

Okay, so what's so special about the number 10? That's for you to figure out, but here's a hint:

Let's just say that The Simpsons might just have a very different number system. In fact, they might have a base 8 system. (Maybe this is why Bart has such trouble with math...)

Yeah, the answer to why we operate in a base 10 system probably has to do with the number of digits we have (and I'm not talking about numbers here).


Let's suppose that we operated in the world of the Simpsons, a base eight system.


Question 2: How many numeric symbols would we have to use? What would they be?

___________________________________________


Maybe one way to get the idea of different systems of numbers would be to think about your car's odometer.

As the miles increase (in base 10), whenever any number rotates past "9", the odometer "turns over". In other words, the "9" returns to "0" and the number immediately to the left increases by one.

Now, think of an odometer that turns over after only eight digits, 0-7.


The number on the Simpson's car odometer might look something like this:

Simpsons' Odometer (base eight)

Our odometer (base ten)

0

0

1

1

2

2

3

3

4

4

5

5

6

6

7

7

10 <-It turns over here! D'oh!

8

11

9

12

10

13

11

14

12

15

13

16

14

17

15

20 <-It turns over again!

16

21

17

22

18

And so on, and so on....

The same pattern happens when you get bigger and bigger numbers:

Simpsons' Odometer (base eight)

Our odometer (base ten)

...

...

74

60

75

61

76

62

77

63

100 <- Here's where the first two numbers turn over to "0"

64

101

65

102

66

103

67

And so on, and so on.....

So, you can see that numbers in a different number system mean very different things.Maybe those outrageous prices in the Kwikee-Mart aren't so bad!.

After all, when Apu charges Homer $10 for a burrito, that's only $8 of our money! (well, that's still pretty bad, I guess.)


Question 3:

Fill in the blanks! What would the Simpsons' odometer look like here?

Simpsons' Odometer (base eight)

Our odometer (base ten)

...

...

174

204

?

205

?

206

?

207

?

208

?

209

?

210

?

211

?

212

?

213

?

214

?

215

?

216

The last section was to get you used to counting in a different system of numbers.

 Let's take a look at how base eight compares to base ten.

Remember when we looked at the number 1,234 in base ten? We noticed that you could rewrite 1,234 as:

1*1000 + 2*100+ 3*10 + 4*1

2

4

1000s place

100s place

10s place

1s place


In base eight, however,1,234 has an entirely different meaning.

In base eight, you have

1

2

3

4

512s place

64s place

8s place

1s place

This turns over after eight groups of eight groups of eight! This place tells us how many groups of 512 there are.

This turns over after eight groups of eight! This place tells us how many groups of 64 there are.

Since we turn over after "7", this place tells us how many groups of 8 we have!

This stays the same.

Or: 83=512

Or: 82=64

Or: 81=8

Or: 80=1

Important!

The only difference between base ten numbers and any numbers of any other base is that the "places" are just powers of different numbers.


So, if we want to translate "1, 234" (base 8) into base 10, we could rewrite 1,234 as:

1*512 + 2*64 + 3*8 +1*1

=512 + 128 + 24 +1

=665


Here's another example:

Translate 943 (base eight) into its base ten equivalent.

Step1: multiply down

9

4

3

64s place

8s place

1s place


9*64=576


4*8=32


3*1=3

Step two: add across:

576 + 32 + 3 = 611.


576+32+3=611 in base ten.


Question 4:

Using the above as an example, translate these base eight numbers into base 10 numbers!

a) 62 in base eight equals _________ in base ten.

b) 146 in base eight equals _________ in base ten.

c) 2405 in base eight equals _________ in base ten.

d) 24134 in base eight equals _________ in base ten.

!

Okay, enough of this base eight stuff. What we're really interested in is base 2 numbers, also called binary numbers. But, if you understood how base ten and base eight numbers are connected, binary is EASY.

Question 5:

Why do computers use binary numbers? (In other words, why do we care about learing binary?)

To answer this, search through the "links" that you can get to via the menu to your left.

_______________________________________


So, hopefully, you've answered the above question one way or another and now understand the importance of knowing binary. It sort of makes sense, right?. As smart as we sometimes think computers are, they really only understand two things: on and off.


Okay, let's get a feel for binary numbers using a binary odometer.

Remember, we're in base 2, which means we only have two numbers: 0 and 1.

Once an odometer number reaches "1", it next turns over to "0", and the number immediately to its left increases by one (and if that's already "1", THAT number turns over to "0", and the next number increases by one, and so on...).

Binary Odometer (base eight)

Our odometer (base ten)

0

0

1

1

10<-It turns over here!

2

11

3

100 <-It turned over again!

4

101

5

110

6

111

7

1000

8

1001

9

1010

10

1011

11

1100

12

1101

13

1110

14

1111

15

10000

16

10001

17

10010

18

Question 6:

Take a look at the binary numbers 1, 10, 100, 1000, and 10000, along with their base 10 equivalents.

What pattern do you notice? Why does this seem like a pretty natural pattern for BInary numbers?

_______________________________________

_______________________________________


Question 7:

Fill in the blanks of this binary odometer:

Binary Odometer (base two)

Our odometer (base ten)

...

...

11001100

204

?

205

?

206

?

207

?

208

?

209

?

210

?

211

?

212

?

213

?

214

?

215

?

216

More Number Bases!!

Alright, this is the name of the game. We have to be able to take a binary number, like 110111, and convert it to a base ten number that we can understand.

It's the same process as converting a base eight number to base ten, except that the "places" are different.

Here, 110111 means a different value in different number systems:

Base


1

1

0

1

1

1

10

105=100000

104=10000

103=1000

102=100

101=10

100=1

8

85=32768

84=4096

83=512

82=64

81=8

80=1

2

25=32

24=16

23=8

22=4

21=2

20=1

Places for the different bases!


Of course, 110111 just means "one hundred and ten thousand, one hundred and eleven" in base ten.


In base eight, we can use the "multiply down, add across" method to convert it to base ten:

1*32768 + 1*4096 + 0*512 + 1*64 + 1*8 + 1*1= 36937 in base ten!


In base 2, we use the same method, except that we will mulitply by different numbers, the powers of 2!

Step1: multiply down

1

1

0

1

1

1

32s place

16s place

8s place

4s place

2s place

1s place


1*32=32


1*16=16


0*8=0


1*4=4


1*2=2


1*1=1

Step two: add across


32 + 16 + 0 + 4 + 2 + 1 =55 in base ten.


Hey! Look!

Actually, the fact that we're using 1's and 0's makes the base2/base 10 calculations really easy! Multiplying any number by "1" is always that number, and multiplying by "0" is always "0".

So, if we want to convert 100011 (base 2) to base ten, we know that we have ones in the 1's place, the 2's place, and the 32's place.

100011 = 32 + 0 + 0 + 0 + 2 + 1 =35 in base 10


Question 8:

Convert these base 2 numbers to base 10!

a) 1 is equal to ____________ in base 10.

b) 1101 is equal to ____________ in base 10.

c) 111110 is equal to ____________ in base 10.

d) 10101010101 is equal to ____________ in base 10.

Okay,the conversion from binary to base 10 isn't so bad. You just have to keep track of the places, which are just the powers of 2!

256

128

64

32

16

8

4

2

1

As you get more places, they just keep doubling!


Just as review, if you have a binary number like

110101100

you just match up the ones and zeroes with the corresponing power of 2, and add!

1

1

0

1

0

1

1

0

0

256

128

64

32

16

8

4

2

1

256

128

32

8

4

256 + 128 + 32+ 8 + 4 = 428 in base 10!


Now, to convert from base two to base 10 is kind of like reversing this process.

The idea is to first split up your base 10 number into a sum of powers of two,
(like 256 + 128 + 32+ 8 + 4 = 428)

 


Let's take an example:

Suppose we want to convert the number 39 into binary.

We want to split it up into a sum of powers of two (1, 2, 4, 8, 16, 32, 64, 128, 256, etc, etc, ):

Step 1: Look for the largest power of two that is less (or equal to) than 39:

In this case, 32 works!

So, 32 + 7 = 39

Step 2: Look at what's left over! (7 in this case). Look for the largest power of two that is less than (or equal to) 7:

In this case, 4 works! 7= 4 + 3, so.....

32 + 4 + 3 = 39

Step 3: Look at what's left over! (3 in this case). Look for the largest power of two that is less than (or equal to) 3:

In this case, 2 works! 3 = 2 + 1, so.....

32 + 4 + 2 + 1 = 39

They're all powers of 2! We're done with this part.

Step 4: Reverse the process!

Unlike the problem we did at the beginning, we're going from the bottom up this time!

?

?

?

?

?

?

?

?

?

256

128

64

32

16

8

4

2

1

32

0

0

4

2

1

** We know: 32 + 4 + 2 + 1 = 39 in base 10!


** So, we have a 32, a 4, a 2, and a 1!

** Which means our base 2 number is: 100111*


1

0

0

1

1

1

32

16

8

4

2

1

32

4

2

1

* Don't forget the zeroes! Actually writing a chart like the one above will help you keep the powers of two straight.

Lets' try another example, and then you can try it. (It's actually really easy once you get the hang of it!)

Convert 123 to binary:

STEP 1:

123

=

64

+

59

STEP 2:

123

=

64

+

32

+

27

STEP 3:

123

=

64

+

32

+

16

+

11

STEP 4:

123

=

64

+

32

+

16

+

8

+

3

STEP 5:

123

=

64

+

32

+

16

+

8

+

2

+

1

So, 123 = 64 + 32 + 16 + 8 + 2 + 1

STEP 6:

1

1

1

1

0

1

1

64

32

16

8

4

2

1

64

32

16

8

0

2

1

So, 123 is equal to 1111011 in base 2!


Question 9: Convert these decimal numbers to binary!

a) 31 is equivalent to _______ in base 2.

b) 128 is equivalent to _______ in base 2.

c) 202 is equivalent to _______ in base 2.

d) 98 is equivalent to _______ in base 2.

e) 17 is equivalent to _______ in base 2.

f) 111 is equivalent to _______ in base 2.



Question 10: Convert these to base 10 or binary!

a) 1000111 is equivalent to _______ in base 10.

b) 255 is equivalent to _______ in binary.