Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems & Binary How to count. How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math:

Similar presentations


Presentation on theme: "Number Systems & Binary How to count. How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math:"— Presentation transcript:

1 Number Systems & Binary How to count

2 How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math: MCXXIII + CLXXIV = ????

3 What we are used to – Digits that have different meaning based on place: = 1 * 10000 + 2 * 1000 + 0 * 100 + 5 * 10 + 9 * 1 = 12059 Place Value Systems ten thousands thousandshundredstensones 12059

4 Decimal Numbers Base 10 : Each place increases by a power of 10 ten thousands 10 4 thousands 10 3 hundreds 10 2 tens 10 1 ones 10 0 12059

5 Why Base 10? Only one thing special about base 10: Other systems have been used: – Mayans : Base 20 – Babylonians : Base 60

6 Other Bases Base determines the multiplier from one column to next Base 20 = 1 * 160000 + 2 * 8000 + 0 * 400 + 5 * 20 + 9 * 1 = 176109 160- thousands 20 4 eight- thousands 20 3 four- hundreds 20 2 twentys 20 1 ones 20 0 12059

7 Base 2 Base two – Only 1 and 0 – Places are powers of 2 = 1 * 32 + 0 * 16 + 1 * 8 + 1 * 4 + 0 * 2 + 1 * 1 = 32 + 8 + 4 + 1 = 45 thirty-twos 2 5 sixteens 2 4 eights 2 3 fours2 twos 2 1 ones 2 0 101101

8 Other Bases Base also determines how many digits needed: Base 10 : 10 digits : 0-9 Base 2 : 2 digits : 0-1 Base 8 : 8 digits : 0-7

9 Notation Subscript used to indicate base: 101 2  101 in base 2 (numeric value of 5) 101 10  101 in base 10 (numeric value of 101)

10 More digits = bigger numbers 4 digits we can represent values 0-15 15: 8 digits can represent 0-255 16 digits can represent 0-65535 n digits can represent 0 to (2 n -1) 8421 1111

11 Leading 0's Leading 0's do not matter: 101 = 0101 = 00000101 1286432168421 00000101

12 Leading 0's Leading 0's do not matter: 101 = 0101 = 00000101 1286432168421 00000101

13 Counting to ten in binary In binary you generally show leading 0's Values for 1-10 (decimal) in binary: 1000160110 2001070111 3001181000 4010091001 50101101010

14 Binary -> Decimal with Table 1. Make a table like this one 2. Write in the binary number 3. Add up all the numbers from the top that have a 1 under them: 64 + 32 + 4 + 1 = 101 1286432168421 1286432168421 01100101

15 Decimal -> Binary with Table 1. Make a table like this one 2. Say we are converting 83: Look for largest number that is smaller than our value Look for largest number that is smaller than our value 1286432168421

16 Decimal -> Binary with Table 1. Make a table like this one 2. Say we are converting 83: Look for largest number that is smaller than our value Look for largest number that is smaller than our value We have 1 of those (0 of anything bigger) We have 1 of those (0 of anything bigger) Subtract that from our number 83 – 64 = still have 19 to make Subtract that from our number 83 – 64 = still have 19 to make 1286432168421 01

17 Decimal -> Binary with Table 1. Make a table like this one 2. Say we are converting 83: Look for largest number that is smaller than our value Look for largest number that is smaller than our value We have 1 of those (0 of anything bigger) We have 1 of those (0 of anything bigger) Subtract that from our number 83 – 64 = still have 19 to make Subtract that from our number 83 – 64 = still have 19 to make Look for largest value smaller than that… Now have 19 – 16 = 3 left Look for largest value smaller than that… Now have 19 – 16 = 3 left 1286432168421 0101

18 Decimal -> Binary with Table 1. Make a table like this one 2. Say we are converting 83: Look for largest number that is smaller than our value Look for largest number that is smaller than our value We have 1 of those (0 of anything bigger) We have 1 of those (0 of anything bigger) Subtract that from our number 83 – 64 = still have 19 to make Subtract that from our number 83 – 64 = still have 19 to make Look for largest value smaller than that… Now have 19 – 16 = 3 left Look for largest value smaller than that… Now have 19 – 16 = 3 left Continue… need a 2, have one left… Continue… need a 2, have one left… 1286432168421 0101001

19 Decimal -> Binary with Table 1. Make a table like this one 2. Say we are converting 83: 0101 0011 means 64 + 16 + 2 + 1 = 83 1286432168421 01010011

20 Conversion With Division/ Multiplication Binary works in powers of 2 Multiplying/dividing by 2 shifts digits

21 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105

22 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 2521

23 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 25211

24 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 25211 52 ÷ 2

25 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 25211 52 ÷ 226001

26 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 25211 52 ÷ 226001 26 ÷ 2130001

27 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 25211 52 ÷ 226001 26 ÷ 2130001 13 ÷ 2611001 6 ÷ 23001001 3 ÷ 211101001 1 ÷ 2011101001

28 Decimal -> Binary with Division Step 1: Start with a blank answer and the number your are converting Step 2: Divide your number by 2 to make a quotient and a remainder Step 3: Place your remainder on the left side of your answer Step 4: If your quotient is 0, you are done Otherwise, make the quotient your new number and go back to step 2 Convert 105 to binary: Number ÷ 2QR Answer 105 ÷ 25211 52 ÷ 226001 26 ÷ 2130001 13 ÷ 2611001 6 ÷ 23001001 3 ÷ 211101001 1 ÷ 2011101001 1286432168421 1101001 = 105

29 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010

30 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 0 * 2

31 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1010 * 2 + 1

32 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011

33 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 1 * 2

34 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 011 * 2 + 1

35 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013

36 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 3 * 2

37 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 13 * 2 + 0

38 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 16

39 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 16 6 * 2

40 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 16 _6 * 2 + 1

41 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 16 _13

42 Binary -> Decimal with Multiplication Step 1: Start with the number your are converting and the answer of 0 Step 2: Multiply your answer by 2 Step 3: Remove the leftmost digit of number and add it to your answer Step 4: If number has no more digits, you are done Otherwise, go back to step 2 Convert 1101 2 to decimal: Number Answer 11010 1011 013 16 _13 1286432168421 1101 = 13


Download ppt "Number Systems & Binary How to count. How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math:"

Similar presentations


Ads by Google