Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems Prepared by Department of Preparatory year.

Similar presentations


Presentation on theme: "Number Systems Prepared by Department of Preparatory year."— Presentation transcript:

1 Number Systems Prepared by Department of Preparatory year

2 Objectives Understand the concept of number systems.
Describe the decimal, binary, hexadecimal and octal system. Convert a number in binary, octal or hexadecimal to a number in the decimal system. Convert a number in the decimal system to a number in binary, octal and hexadecimal. Convert a number in binary to octal, hexadecimal and vice versa.

3 The decimal system Base: 10
Decimal digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Examples:

4 The binary system Base: 2 Decimal digits: 0, 1 Examples:

5 The hexadecimal system
Base: 16 Hexadecimal digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Examples:

6 The octal system Base: 8 Decimal digits: 0, 1, 2, 3, 4, 5, 6, 7
Examples:

7 Quantities/Counting (1 of 3)
Decimal Binary Octal Hexa- decimal 1 2 10 3 11 4 100 5 101 6 110 7 111

8 Quantities/Counting (2 of 3)
Decimal Binary Octal Hexa- decimal 8 1000 10 9 1001 11 1010 12 A 1011 13 B 1100 14 C 1101 15 D 1110 16 E 1111 17 F

9 Quantities/Counting (3 of 3)
Decimal Binary Octal Hexa- decimal 16 10000 20 10 17 10001 21 11 18 10010 22 12 19 10011 23 13 10100 24 14 10101 25 15 10110 26 10111 27 Etc.

10 Exercise – true or false...
Number Decimal Binary Octal Hexa- decimal 100001 33 1AF 11021 67S

11 Summary of the Number Systems
Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 Octal 8 0, 1, … 7 Hexa- decimal 16 0, 1, … 9, A, B, … F

12 Conversion Among Bases
The possibilities: Decimal Octal Binary Hexadecimal

13 Quick Example 2510 = = 318 = 1916 Base

14 Decimal to Decimal (just for fun)
Octal Binary Hexadecimal Next slide…

15 Weight 12510 => 5 x 100 = x 101 = x 102 = Base

16 Binary to Decimal Decimal Octal Binary Hexadecimal

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

18 Example Bit “0” => 1 x 20 = x 21 = x 22 = x 23 = x 24 = x 25 = 32 4310

19 Octal to Decimal Decimal Octal Binary Hexadecimal

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

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

22 Hexadecimal to Decimal
Octal Binary Hexadecimal

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

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

25 Decimal to Binary Decimal Octal Binary Hexadecimal

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

27 Example 12510 = ?2 12510 =

28 Decimal to Octal Decimal Octal Binary Hexadecimal

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

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

31 Decimal to Hexadecimal
Octal Binary Hexadecimal

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

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

34 Octal to Binary Decimal Octal Binary Hexadecimal

35 Octal to Binary Technique
Convert each octal digit to a 3-bit equivalent binary representation

36 Example 7058 = ?2 7058 =

37 Hexadecimal to Binary Decimal Octal Binary Hexadecimal

38 Hexadecimal to Binary Technique
Convert each hexadecimal digit to a 4-bit equivalent binary representation

39 Example 10AF16 = ?2 A F 10AF16 =

40 Binary to Octal Decimal Octal Binary Hexadecimal

41 Binary to Octal Technique Group bits in threes, starting on right
Convert to octal digits

42 Example = ?8 = 13278

43 Binary to Hexadecimal Decimal Octal Binary Hexadecimal

44 Binary to Hexadecimal Technique Group bits in fours, starting on right
Convert to hexadecimal digits

45 Example = ?16 B B = 2BB16

46 Octal to Hexadecimal Decimal Octal Binary Hexadecimal

47 Octal to Hexadecimal Technique Use binary as an intermediary

48 Example 10768 = ?16 E 10768 = 23E16

49 Hexadecimal to Octal Decimal Octal Binary Hexadecimal

50 Hexadecimal to Octal Technique Use binary as an intermediary

51 Example 1F0C16 = ?8 1 F C 1F0C16 =

52 Exercise – Convert ... Decimal Binary Octal Hexa- decimal 33 1110101
703 1AF Don’t use a calculator!

53 Summary of Conversion Methods
Conversion Among Bases Conversion from the binary system to octal, hexadecimal and vice versa. Conversion from the decimal system to binary, octal or hexadecimal Conversion from binary, octal or hexadecimal to the decimal system

54 Binary Addition (1 of 2) Two 1-bit values A B A + B 1 10 “two”

55 Binary Addition (2 of 2) Two n-bit values Add individual bits
Propagate carries E.g., 1 1

56 Multiplication (1 of 2) Binary, two 1-bit values A B A  B 1

57 Multiplication (2 of 2) Binary, two n-bit values
As with decimal values E.g., x

58 Thank you


Download ppt "Number Systems Prepared by Department of Preparatory year."

Similar presentations


Ads by Google