Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there.

Similar presentations


Presentation on theme: "The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there."— Presentation transcript:

1 The Wonders of Conversion

2 A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there are infinite numbers, after all), but you are only responsible for a very small subset. For the AP Exam, you will need to know binary (base- 2), octal (base-8), decimal (base-10) and hexadecimal (base-16). Notice that all of those bases are powers of 2!

3 The binary number system is the one your computer explicitly understands. All numbers are represented by bits, which is either a 0 or a 1. A byte is a collection of 8 bits, and can represent numbers from -256 to 255. (The max value of a collection of bits is always 2^ numbits -1  2 8 -1 = 255) For example, 10110110 is 182 in decimal.

4 Octal is base-8. Only digits 0-7 are used. Using 182 again, it is 266 in octal. (That is not a typo – the number appears to be bigger!)

5 Decimal is good old base-10. You’ve been using this all of your lives! 182 is 182 in decimal!

6 Hexadecimal is base-16. It uses the digits 0-9 and the letters A-F to represent 10-15, respectfully. For example, 15 base 10 is F in hexadecimal. 16 is 10. 890 is 37A.

7 The following is called the expansion method and only works on converting a number TO BASE-10!!! You need to understand how these numbers are written. You have to analyze the number starting on the right. This number represents the base number raised to the 0 th power. The second number from the right represents the base number raised to the first power. …and so on

8 Consider the following binary number: 01110011 What is this number in decimal format? Start looking at the rightmost digit. This represents the base number raised to the 0 th power. Multiply this number by the digit present (which is a 1). Save this number. Look at the second rightmost digit. This represents the base number raised to the first power. Multiply this number by the digit present (which is a 1). Save this number. …do this for all numbers present and add all of products together to get your base-10 number.

9 01110011 to decimal 2 0 * 1 = 1 2 1 * 1 = 2 2 2 * 0 = 0 2 3 * 0 = 0 2 4 * 1 = 16 2 5 * 1 = 32 2 6 * 1 = 64 2 7 * 0 = 0 The sum is 115.

10 Convert 10101010 to decimal. Convert 00011111 to decimal. Convert 11110110 to decimal.

11 Convert 234 base-8 to decimal. 8 0 * 4 = 4 8 1 * 3 = 24 8 2 * 2 = 128 The sum is 156.

12 Convert 716 base-8 to decimal. Convert 45 base-8 to decimal. Convert 10 base-8 to decimal.

13 REMEMBER: A = 10 B = 11 C = 12 D = 13 E = 14 F = 15 Convert F16 to decimal.

14 Work: 16 0 * 6 = 6 16 1 * 1 = 16 16 2 * 15 = 3840 The sum is 3862.

15 Convert C10 to decimal. Convert FF to decimal. Convert 16 to decimal.

16 One method of converting any base number to base-10 is by continuously dividing the original decimal number by the desired base until you get a quotient of 0, and then read the remainders backwards. Note: if you are converting to hexadecimal, remember that 10..15 are represented by A..F respectively!)

17 Convert 201 to binary. Work: 201 / 2 = 100 remainder 1 100 / 2 = 50 remainder 0 50 / 2 = 25 remainder 0 25 / 2 = 12 remainder 1 12 / 2 = 6 remainder 0 6 / 2 = 3 remainder 0 3 / 2 = 1 remainder 1 1 / 2 = 0 remainder 1. 201 in binary is 11001001.

18 Convert 1076 to binary. Convert 200 to binary. Convert 450 to binary.

19 Convert 173 to octal. Work: 173 / 8 = 21 remainder 5 21 / 8 = 2 remainder 5 2 / 8 = 0 remainder 2 173 base-10 is 255 base-8.

20 Convert 1076 to octal. Convert 200 to octal. Convert 450 to octal.

21 Convert 506 to hexadecimal. Work: 506 / 16 = 31 remainder 10 31 / 16 = 1 remainder 15 1 / 16 = 0 remainder 1 BUT 10 is A and 15 is F so… 506 base-10 is 1FA base-16.

22 Convert 1076 to hexadecimal. Convert 200 to hexadecimal. Convert 450 to hexadecimal.

23 There is a neat trick that allows one to convert from binary to hexadecimal, without converting the binary to base-10 first. Every base-16 digit (including letters) can be represented by four bits:

24 Base -2Base-16 00000 00011 00102 00113 01004 01015 01106 01117 Base-2Base-16 10008 10019 1010A 1011B 1100C 1101D 1110E 1111F

25 Convert 1001001010111 base-2 to base-16. Starting from the right, break up the binary number into groups of 4 bits. If the last group doesn’t have four bytes, pad it on the left with zeros. Base-2 groups: 0001 0010 0101 0111 Base-16: 1 2 5 7 Answer = 1257

26 1111111110010001101 to base-16 Groups: Base-2: 0111 1111 1100 1000 1101 Base-16: 7 F C 8 D Answer = 7FC8D

27 Convert 73254 base-16 to base-2 Groups: Base-16: 73254 Base-2: 0111 0011 0010 0101 0100 Answer: 01110011001001010100

28 Convert 1a2b3c to base-2 Groups: Base-16:1a2b3c Base-2: 0001 1010 0010 1011 0011 1100 Answer: 000110100010101100111100

29 Convert 101101011010101101 to hexadecimal. Convert 111111111111111111101010 to hexadecimal. Convert 3f5a86 to binary. Convert aa4fc to binary.


Download ppt "The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there."

Similar presentations


Ads by Google