Presentation is loading. Please wait.

Presentation is loading. Please wait.

Representing numeric data with bits

Similar presentations


Presentation on theme: "Representing numeric data with bits"— Presentation transcript:

1 Representing numeric data with bits
Skills: counting with decimal and binary numbers Concepts: using a binary code for representing numbers, positional number systems, number system base, number of symbols in a number system We will see how to count and represent quantities using positional number systems, like our own decimal system. This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

2 Where does this topic fit?
Internet concepts Applications Technology Implications Internet skills Application development Content creation User skills This presentation presents number system concepts.

3 Encoding numeric data Data type Decade Numeric 1950s Alphanumeric
Text 1970s Image 1990s Speech 2000s Music Video 2000, 2010s These are some of our IT data types. The table shows the rough dates when a data type made the transition from research and development to mainstream adoption, There are one or more standard codes for each type of data. This presentation shows a commonly used code for numeric data.

4 I’m not sure if it is true or not, but I’ve heard that Roman generals estimated the size of their armies by having each soldier put a stone on a pile. The bigger the pile, the bigger the army. The Romans wrote numbers like this: MMX Those Roman numerals were easy to read, but not suitable for doing arithmetic. For arithmetic, we needed positional numbers. Let’s use positional numbers to count stones.

5 Using decimal numbers to count stones
When you were small, you learned to count – you learned the concept of quantity. Later, you learned to write ten 10 symbols to represent the quantities 0 through 9. We can count up to nine stones using a single digit since our decimal number system has ten different symbols. … 9

6 ? One more stone But, what happens when you add one more stone?
You are out of symbols. ?

7 Zero, carry 1 There is no symbol for the quantity ten, so we must use two symbols. We “carry” one into the tens position, and reset the ones position to zero. What if you add one more stone? 10

8 Add 1 to the 1’s position You just add one to the ones position and keep going – 12, 13, 14 and so forth. 11

9 Do you remember how cool it was when you figured this out?
1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 ... 90 91 92 93 94 95 96 97 98 99 100 101 ... When you get up to 99, you carry one to the hundreds position, reset the ones and tens back at zero and keep going. Do you remember how cool it was when you figured this out? Little kids like to count to 100 and beyond. Using this system, you can count as high as you wish.

10 No matter how many stones you have counted, you can always add one more.
That means you can represent any whole number using the familiar decimal counting system. You can represent any number of stones or other objects. But, we represent all types of data using bits – zeros and ones. Can we count a large number of objects using only two symbols, 0 and 1?

11 Using binary numbers to count stones
1 10 11 100 101 110 Binary numbers work the same as decimal number. You have only two symbols, so you end up having to do a lot more carries, but counting works just the same. Let’s compare decimal and binary counting.

12 Counting with decimal and binary numbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000 10001 10010 10011 10100 10101 Counting with decimal and binary numbers Counting works the same regardless of the number system base. When you run out of options, you carry one and keep going. Since binary numbers have only two symbols, you do a lot more carrying, and they are longer than decimal numbers. Think how fast the odometer on your car would overflow to the next position if there were only two symbols.

13 250 Here we have 250 (decimal) stones.
Two in the hundreds position, five in the tens position and zero in the ones position. What would that be in binary? 250

14 The counting pattern continues indefinitely in binary as well.
There are the same number of stones in this picture as the previous one. We have one in the 128s, 64s, 32s, 16, 8 and 2s positions and 0 in the 1 and 4 positions.

15 Convert 11111010 (binary) to decimal
1 x 128 = 128 1 x 64 = 64 1 x 32 = 32 1 x 16 = 16 1 x 8 = 8 0 x 4 = 0 1 x 2 = 2 0 x 1 = 0 Total = 250 You can easily convert binary numbers into decimal numbers and vice versa. Everything works the same, but the values of the positions change. In this example, we have one in the 2, 8, 16, 32, 64 and 128 positions and zero in the 1 and 4 positions. (binary) = 250 (decimal)

16 Mayan base 20 symbols Of course two or ten symbol number systems are not the only choices. It turns out you can use any base or radix for a numbering system. The Mayans used a base 20 (vigesimal) number system. Their 20 symbols are shown here. The symbol for zero is a seashell. These Mayan symbols date back to the fourth century.

17 Summary We have seen that you can represent any positive whole number quantity using binary numbers. Using variations on what we have seen here, you can also represent negative and fractional numbers using only two symbols zero and one. Other number systems are possible, but today’s information processing systems all use base two because they are most economical to design and build using today’s technology. 99 or

18 Self study questions If I am counting in binary, what is 11111 plus 1?
Write the number 12 (base 10) in binary Write the number (binary) in decimal. If I were a Mayan, how would I write the number 25 (base 10)? True or false – all odd binary numbers end in 1?

19 Links Mayan numbers: http://en.wikipedia.org/wiki/Maya_numerals
Hindu-Arabic number system:


Download ppt "Representing numeric data with bits"

Similar presentations


Ads by Google