Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tools of Web Development 1: Module A: Numbering Systems

Similar presentations


Presentation on theme: "Tools of Web Development 1: Module A: Numbering Systems"— Presentation transcript:

1 Tools of Web Development 1: Module A: Numbering Systems

2 Goals Understand why computers use binary (Base-2) numbering.
Understand how to convert Base-2 numbers to Base-10 or Base-8. Understand how to convert Base-8 numbers to Base-10 or Base 2. Understand how to convert Base-16 numbers to Base-10.

3 Why Binary? Computers are made of a series of switches
Each switch has two states: ON or OFF Each state can be represented by a number – 1 for “ON” and 0 for “OFF”

4 Understanding Placeholders
Each numbering system has placeholders The possible values of each place holder depends on the maximum number of single-digit numbers available for that numbering system In the Base-10 world (aka Decimal), there are ten possible digits that each placeholder can take (0-9)

5 4 3 6 Base-10 Placeholders Number: Placeholder Name: “Tens” “Ones”
“Hundreds” Value: 100*4 10*3 1*6 Exponential Expression: 102*4 101*3 100*6

6 1 Base-2 Placeholders Number: Placeholder Name: “Fours” “Twos” “Ones”
Number: Placeholder Name: “Fours” “Twos” “Ones” n10 Value: 4*1 2*0 1*1 n10 Exponential Expression: 22*1 21*0 20*1

7 Converting Base-2 to Base-10
12 ON/OFF ON OFF OFF ON ON Exponent: 24 23 22 21 20 16 2 1 Calculation: + + + + = 1910

8 Converting Base-10 to Base-2
STEP ONE: Find the largest exponent of two that is less than or equal to the Base-10 number: 2110= 16 24 23 22 21 20

9 Converting Base-10 to Base-2
STEP TWO: Calculate the value of each exponent and place that value above it: 2110= 16 8 4 2 1 24 23 22 21 20

10 Converting Base-10 to Base-2
STEP THREE: Place a “1” above the left-most placeholder: 2110= 1 16 8 4 2 1 24 23 22 21 20

11 Converting Base-10 to Base-2
STEP FOUR: Add left-most value to the next place-holder. Put a “0” above is the sum is greater than the number being converted, otherwise put a “1” above: 2110= 1 16 8 4 2 1 24 23 22 21 20

12 Converting Base-10 to Base-2
STEP FIVE: Add subsequent placeholders. If the sum is greater than than the number being converted, put a “0” above and disregard it. Otherwise, put a “1” above and including it in your running total. 2110= 1 1 1 16 8 4 2 1 24 23 22 21 20

13 Converting Base-10 to Base-2
STEP SIX: The resulting 1s and 0s in the top row form the binary equivalent of the Base-10 number with which we started: 2110 =

14 Introducing Octal Computer scientists are often looking for shortcuts to do things One of the ways in which we can represent binary numbers is to use their octal equivalents instead This is especially helpful when we have to do fairly complicated tasks using numbers

15 Introducing Octal The octal numbering system includes eight base digits (0-7) After 7, the next placeholder to the right begins with a “1” 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12,

16 2 4 1 Octal Placeholders Number: Placeholder Name: “Ones” “Eights”
“Sixty-Fours” Value: 64*2 8*4 1*1 Exponential Expression: 82*2 81*4 80*1

17 Converting Base-2 to Base-8
STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary: 010 001 100 101 001

18 Converting Base-2 to Base-8
= 214518 STEP TWO: Convert each triplet to its single-digit octal equivalent. (HINT: For each triplet, the octal conversion is the same as converting to a decimal number): 010 001 100 101 001 2 1 4 5 1

19 Converting Base-8 to Base-2
435208 = STEP ONE: Take each octal digit and convert each digit to a binary triplet. Keep leading zeros: 4 3 5 2 100 011 101 010 000

20 Converting Base-8 to Base-10
23748 STEP ONE: Multiply each octal digit by the exponential expression that represents its placeholder: 2 * 83 = 1024 3 * 82 = 192 7 * 81 = 56 4 * 80 = 4

21 Converting Base-8 to Base-10
23748 = 127610 STEP TWO: Add the products together. The sum represents the Base-10 equivalent: = 1276

22 Converting Base-10 to Base-8
483210 STEP ONE: Divide the Base-10 number by eight. DO NOT DIVIDE PAST THE DECIMAL POINT – INSTEAD INCLUDE A REMAINDER: 4832 / 8 = 604 r0

23 Converting Base-10 to Base-8
483210 STEP TWO: Divide the quotient of the previous expression by eight. Repeat the process until you have a quotient of 0: 4832 / 8 = 604 r0 604 / 8 = 75 r4 75 / 8 = 9 r3 9 / 8 = 1 r1 1 / 8 = r1

24 Converting Base-10 to Base-8
483210 = 113408 STEP THREE: The octal equivalent can be found by looking at the remainders from the bottom up: 4832 / 8 = 604 r0 604 / 8 = 75 r4 75 / 8 = 9 r3 9 / 8 = 1 r1 1 / 8 = r1

25 Hexadecimal Numbering
Sometimes, it is necessary to use a numbering system that has more than ten base digits One such numbering system, hexadecimal, is useful on the Web Hexadecimal number, a Base-16 numbering system, is used in specifying web colors

26 Hexadecimal Numbering
There are new symbols for the Base-16 equivalents of the Base-10 numbers 10, 11, 12, 14 and 15. Examine: DEC 1 2 3 4 5 6 7 HEX 8 9 10 11 12 13 14 15 A B C D E F

27 Converting Base-10 to Base-16
21410 STEP ONE: Divide the Base-10 number by sixteen. Do not divide past the decimal point: 214 / 16 = 13 r6

28 Converting Base-10 to Base-16
21410 STEP TWO: Convert both the quotient and the remainder to their hexadecimal equivalents: 214 / 16 = 13 r6 D 6 Hex Equivalents

29 Converting Base-10 to Base-16
21410 = D616 STEP THREE: The quotient represents the first digit of the hexadecimal equivalent and the remainder represents the second digit: 214 / 16 = 13 r6 D 6 Hex Equivalents

30 Questions?


Download ppt "Tools of Web Development 1: Module A: Numbering Systems"

Similar presentations


Ads by Google