Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Number System.

Similar presentations


Presentation on theme: "Chapter 2 Number System."— Presentation transcript:

1 Chapter 2 Number System

2 Natural Numbers How many ones are there in 642? Hundreds = 6 Tens = 4
? Hundreds = 6 Tens = 4 Ones = 2 4

3 Natural Numbers Aha! 642 is 600 + 40 + 2 in BASE 10
The base of a number determines the number of digits and the value of digit positions 5

4 Positional Notation 642 in base 10 positional notation is:
Continuing with our example… 642 in base 10 positional notation is: 6 x 102 = 6 x = 600 + 4 x 101 = 4 x = 40 + 2 x 10º = 2 x = = 642 in base 10 The power indicates the position of the number This number is in base 10 6

5 Positional Notation What if 642 has the base of 13?
642 in base 13 is equivalent to 1068 in base 10 + 6 x 132 = 6 x = 1014 + 4 x 131 = 4 x = 52 + 2 x 13º = 2 x = 2 = in base 10 8 6

6 Positional Notation dn * Rn-1 + dn-1 * Rn-2 + ... + d2 * R + d1
R is the base of the number As a formula:  dn * Rn-1 + dn-1 * Rn d2 * R + d1 n is the number of digits in the number d is the digit in the ith position in the number 642 is  63 *  42 * 10 +  21 7

7 Common Number Systems System Base Symbols Decimal 10 0, 1, … 9 Binary
2 0, 1 Octal 8 0, 1, … 7 Hexa- decimal 16 0, 1, … 9, A, B, … F

8 Binary Decimal is base 10 and has 10 digits: 0,1,2,3,4,5,6,7,8,9
Binary is base 2 and has 2 digits: 0,1 For a number to exist in a given number system, the number system must include those digits. For example, the number 284 only exists in base 9 and higher. 9

9 Bases Higher than 10 How are digits in bases higher than 10 represented? With distinct symbols for 10 and above. Base 16 has 16 digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F 10

10 Binary Numbering systems
Base: 2 Digits: 0, 1 binary number: positional powers of 2: decimal positional value: binary number:

11 Conversions Decimal Octal Binary Hexadecimal

12 Octal to Decimal Decimal Octal Binary Hexadecimal

13 Octal to Decimal Technique
Multiply each digit by 8n, where n is the “weight” of the digit The weight is the position of the digit, starting from 0 on the right Add the results

14 Example 7248 => 4 x 80 = x 81 = x 82 =

15 Converting Octal to Decimal
What is the decimal equivalent of the octal number 642? 6 x 82 = 6 x 64 = 384 + 4 x 81 = 4 x 8 = 32 + 2 x 8º = 2 x 1 = 2 = 418 in base 10 11

16 Converting Octal to Decimal
278 = 2×81+7×80 = 16+7 = 2310 308 = 3×81+0×80 = 2410 43078 = 4×83+3×82+0×81+7×80= Octal numbers uses digits 8 denotes octal base and 10 represents decimal base.

17 Hexadecimal to Decimal
Octal Binary Hexadecimal

18 Hexadecimal to Decimal
Technique Multiply each digit by 16n, where n is the “weight” of the digit The weight is the position of the digit, starting from 0 on the right Add the results

19 Example ABC16 => C x 160 = 12 x 1 = B x 161 = 11 x 16 = A x 162 = 10 x 256 = 2560 274810

20 Converting Hexadecimal to Decimal
What is the decimal equivalent of the hexadecimal number DEF? D x 162 = 13 x 256 = 3328 + E x 161 = 14 x 16 = 224 + F x 16º = 15 x = 15 = 3567 in base 10 Remember, the digits in base 16 are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

21 Converting Hexadecimal to Decimal
2F16 = 2Fh = 2×161+15×160 = 4710 BC1216 = BC12h = 11×163+12×162+1×161+2×160= Hexa numbers : 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F 16 denotes Hax base and 10 represents decimal base.

22 Binary to Decimal Decimal Octal Binary Hexadecimal

23 Binary to Decimal Technique
Multiply each digit by 2n, where n is the “weight” of the bit The weight is the position of the digit, starting from 0 on the right Add the results

24 Example => 1 x 20 = x 21 = x 22 = x 23 = x 24 = x 25 = 32 4310

25 Converting Binary to Decimal
What is the decimal equivalent of the binary number ? 1 x 26 = 1 x 64 = 64 + 1 x 25 = 1 x 32 = 32 + 0 x 24 = 0 x 16 = 0 + 1 x 23 = 1 x 8 = 8 + 1 x 22 = 1 x 4 = 4 + 1 x 21 = 1 x 2 = 2 + 0 x 2º = 0 x 1 = 0 = 110 in base 10 13

26 Converting Binary to Decimal
= 10101b = 1×24+0×23+1×22+0×21+1×20 = = (21)d = 10111b = 1×24+0×23+1×22+1×21+1×20 = = (23)d = b = 1×25+0×24+0×23+0×22+1×21+1×20 =32+2+1= (35)d Binary numbers uses only 0 and 1 digits. b denotes binary base and d represents decimal base.

27 Other Conversions wrt Binary System
Octal Binary Hexadecimal

28 Binary to Octal Conversion (cont.)
Three-bit Group Decimal Digit Octal Digit

29 Binary to Octal Conversion
Since the maximum value represented in 3 bit is equal to: 23 – 1 = 7 i.e. using 3 bits we can represent values from 0 –7 which are the digits of the Octal numbering system. Thus, three binary digits can be converted to one octal digit and visa versa.

30 Binary to Octal Groups of Three (from right) Convert each group
is 253 in base 8 17

31 Binary to Octal Conversion
Ex : Convert = 110 = 6 100 = 4 010 = ( pad empty digits with 0) =

32 Octal to Binary Conversion
Ex : Convert = 7 = 111 4 = 100 2 = 010 =

33 Binary to Hexa conversion
Four-bit Group Decimal Digit Hexadecimal Digit A B C D E F

34 Binary to Hexa Conversion
Since the maximum value represented in 4 bit is equal to: 24 – 1 = 15 i.e. using 4 bits we can represent values from 0 –15 which are the digits of the Hexadecimal numbering system. Thus, Four binary digits can be converted to one Hexadecimal digit.

35 Converting Binary to Hexadecimal
Groups of Four (from right) Convert each group A B is AB in base 16 18

36 Binary to Hexa Conversion
Convert = 0110 = 6 1010 = A = A616

37 Hexa to Binary Conversion
Convert 3D916 = 3 = 0011 D = 1101 9 = 1001 3D916 =

38 Converting Decimal to other System
Octal Binary Hexadecimal

39 Decimal to Binary Technique Divide by two, keep track of the remainder
First remainder is digit 0 (LSB, least-significant bit) Second remainder is digit 1 Etc.

40 Example 12510 = ?2 12510 =

41 Decimal to Octal Technique Divide by 8 Keep track of the remainder

42 Example = ?8 8 19 2 8 2 3 8 0 2 = 23228

43 Decimal to Hexadecimal
Technique Divide by 16 Keep track of the remainder

44 Example = ?16 77 2 16 = D 0 4 = 4D216

45 Converting Decimal to Hexadecimal
32 15 F E D 21


Download ppt "Chapter 2 Number System."

Similar presentations


Ads by Google