Presentation is loading. Please wait.

Presentation is loading. Please wait.

4.2 Number Bases in Positional Systems

Similar presentations


Presentation on theme: "4.2 Number Bases in Positional Systems"— Presentation transcript:

1 4.2 Number Bases in Positional Systems

2 Recall: Decimal (base 10) System
10000 1000 100 10 104 103 102 101 4 x 10000 3 x1000 5 x100 1 x10 = 43512 Uses 10 digits (symbols): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each position implies power of 10

3 Binary (base 2) System Computer signals in terms of ‘yes’/’no’, ‘on’/’off’, ‘high voltage’/’low voltage’, 1/0. Computer data storage also in terms of ‘on’/’off’, ‘north pole’/’south pole’, 1/0. Binary system uses 2 symbols: 0, 1 E.g., 1two = 1ten two = 2ten two = 3ten two = 4ten 101two = 5ten

4 Binary (base 2) System 64 +0 +1 = 65dec Uses 2 digits (symbols): 0, 1
Each position implies power of 2

5 Binary (base 2) System Decimal Binary 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 1010 1011 12 1100 13 1101

6 Converting Binary to Decimal
Express the following binary notation in decimal notation. 0110binary = (0 x 23) + (1 x 22) + (1 x 21) + (0 x 20) = = 6 1111binary = (1 x 23) + (1 x 22) + (1 x 21) + (1 x 20) = = 15

7 Your Turn 111binary = (1 x 22) + (1 x 21) + (0 x 20) = 4 + 2 + 1 = 7
Express the following binary notation in decimal notation. 111binary = (1 x 22) + (1 x 21) + (0 x 20) = = 7 10001binary = (1 x 24) + (0 x 23) + (0 x 22) + (0 x 21) + (1 x 20) = = 17

8 Hexadecimal Notation (base 16)
C++ Code Find the gcd of two numbers E.g., given: 12 and 36 gcd = 12

9 Computer Program Code Machine Language Code (What? No binary code?)
Hexadecimal Notation can serve as a short hand for Binary Notation. In the last line: B A C F F D

10 Hexadecimal (base 16) Notation
Uses 16 symbols: E.g., 2Bhexadecimal = 43ten A3hexadecimal = 163ten Decimal 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hexadec A B C D E F

11 Hexadecimal (base 16) Notation
4096 256 16 163 162 161 160 A C 3 x 4096 10 x 256 12 x 16 12288 2560 192 2 = 15042dec Uses 16 digits (symbols): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Each position implies power of 16

12 Converting Hexadecimal to Decimal Notation
Converting Hexadecimal  to Decimal Notation Dec Hex 1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F Convert from hexadecimal to decimal notation: 2Bhex Recall: Pos. val Digit B Dec. val. (2 x 16) + (11 x 1) = 43dec A3hex (10 x 16) + (3 x 1) = 163dec

13 Your Turn Convert from hexadecimal to decimal notation: 8B hex
1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F Convert from hexadecimal to decimal notation: 8B hex Recall: Pos. val Digit B Dec. val. (8 x 16) + (11 x 1) = 138dec 45 hex (4 x 16) + (5 x 1) = 69dec

14 Converting Hexadecimal to Decimal Notation
Converting Hexadecimal  to Decimal Notation (15 x 256+ (15 x 16) + (15 x 1) = = 3095 Find the decimal numeral for the following hex numeral. 12A FFF (15 x 256+ (15 x 16) + (15 x 1) = = 3095 Pos val. 162 161 160 256 16 1 Digit 2 A Value 1 x 256 2 x 16 10 x 1 32 10 = 298

15 Your Turn Convert the Hexadecimal Numeral to Decimal Numeral: 13E.
1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F Convert the Hexadecimal Numeral to Decimal Numeral: 13E. Pos val. 162 161 160 256 16 1 Digit 3 E Value 1 x 256 3 x 16 14 x 1 48 14 = 308

16 How Is Binary Notation Related to Hex Notation?
128 64 32 16 8 4 2 1 27 26 25 24 23 22 21 20 64 +16 +8 +2 = 90ten 16 1 161 160 128 64 32 8 4 2 27 26 25 24 23 22 21 20 5 A 5 x 16 10 x 1 = 90ten

17 Dec Binary Hex 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 1010 A 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F Your Turn Convert from binary to hexadecimal Binary: Hex: Binary: Hex: A B Binary: Hex: B C

18 Your Turn A3 Hex: A3 Binary: 1010 0011 FC Hex: FC Binary: 1111 1100
Dec Binary Hex 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F Your Turn Convert from hexadecimal to binary. A3 Hex: A3 Binary: FC Hex: FC Binary:


Download ppt "4.2 Number Bases in Positional Systems"

Similar presentations


Ads by Google