Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright (c) 2004 Professor Keith W. Noe Number System & Codes Number Conversions Part II.

Similar presentations


Presentation on theme: "Copyright (c) 2004 Professor Keith W. Noe Number System & Codes Number Conversions Part II."— Presentation transcript:

1

2 Copyright (c) 2004 Professor Keith W. Noe Number System & Codes Number Conversions Part II

3 Copyright (c) 2004 Professor Keith W. Noe Reading Assignment Digital Design with CPLD Applications and VHDL, by Robert K. Dueck Pages 6 through 17

4 Copyright (c) 2004 Professor Keith W. Noe Objectives Convert decimal numbers to binary, octal, & hexadecimal. Convert binary numbers to octal, & hexadecimal. Convert octal numbers to binary. Convert hexadecimal numbers to binary. Upon the successful completion of this lesson, you should be able to:

5 Copyright (c) 2004 Professor Keith W. Noe Number Conversions Number conversion from base 10 to bases 2, 8, & 16 will be discussed first. Next conversion from binary to bases 8 and 16 will be discussed. Then we will discuss converting base 8 to binary. Last, we will discuss converting base 16 numbers to binary.

6 Copyright (c) 2004 Professor Keith W. Noe Why so many number systems? Digital & microprocessor-based electronic circuitry use the binary number system. Man uses the decimal number system. Because the binary number system uses only 0 and 1, it is hard for us to work with such huge binary numbers. Example: 100111110111011101101110 2 Errors are usually the rule when working only in the binary number system.

7 Copyright (c) 2004 Professor Keith W. Noe Why so many number systems? Technicians function better when using the decimal number system. This is the number system we use every day of our life. The octal number system (base 8) closely resembles the decimal number system.

8 Copyright (c) 2004 Professor Keith W. Noe Why so many number systems? Another number system that resembles the decimal number system is the hexadecimal number system. The hexadecimal or base 16 number system has 16 symbols, some of which are the first 6 letters of the alphabet. This number system is also used with digital systems. This system is usually referred to as Hex (short for hexadecimal).

9 Copyright (c) 2004 Professor Keith W. Noe What does this mean for me? Use all four number systems with relative ease. Accurately convert numbers between all four number systems. Computers and output circuits used by computers output codes using one of these four number systems. As a technician working on digital-based circuits, you must be able to:

10 Copyright (c) 2004 Professor Keith W. Noe Decimal to Binary Octal Hexadecimal Number Conversions

11 Copyright (c) 2004 Professor Keith W. Noe Converting Decimal Numbers to Binary, Octal & Hex Converting decimal numbers to any one of these number systems uses exactly the same process. The process that you will use is repeated division with the integer portion of the decimal number being converted.

12 Copyright (c) 2004 Professor Keith W. Noe Converting Decimal Numbers to Binary, Octal & Hex Use the old style of division 9  5 = 1 R 4 It is important that you use this process as shown above. The remainders form the number in the new number system you are converting the decimal number to.

13 Copyright (c) 2004 Professor Keith W. Noe Number Conversion Converting 29 10 to Binary

14 Copyright (c) 2004 Professor Keith W. Noe Decimal to Binary Conversion To convert a decimal number to binary, you will repeatedly divide the decimal number by 2 keeping track of the remainders. Be sure to keep track of the remainders as the remainders are used to form the binary equivalent number.

15 Copyright (c) 2004 Professor Keith W. Noe Decimal to Binary Conversion 1  2 = 0 R 1 3  2 = 1 R 1 7  2 = 3 R 1 14  2 = 7 R 0 29  2 = 14 R 1 To read the binary equivalent of 29 10, read the remainders from the top down: 11101

16 Copyright (c) 2004 Professor Keith W. Noe Practice Session Practice Converting these decimal numbers to binary: 44 10 117 10 142 10 255 10

17 Copyright (c) 2004 Professor Keith W. Noe Practice Session Answers: 44 10 = 101100 2 117 10 = 1110101 2 142 10 = 10001110 2 255 10 = 11111111 2

18 Copyright (c) 2004 Professor Keith W. Noe Converting Decimal Numbers to Octal

19 Copyright (c) 2004 Professor Keith W. Noe Decimal to Octal Conversion Use the same process that you used when converting decimal numbers to binary. Use the repeated division process. When converting decimal numbers to octal, divide the decimal number by 8. Keep track of the remainders, The remainders form the octal equivalent.

20 Copyright (c) 2004 Professor Keith W. Noe Decimal to Octal Conversion Convert 183 10 to Octal.

21 Copyright (c) 2004 Professor Keith W. Noe Decimal to Octal Conversion 183  8 = 22 R 7 22  8 = 2 R 6 2  8 = 0 R 2 Use Repeated Division Dividing by 8 183 10 = 267 8

22 Copyright (c) 2004 Professor Keith W. Noe Practice Session Practice converting these decimal numbers to octal. 79 10 194 10 208 10 255 10

23 Copyright (c) 2004 Professor Keith W. Noe Practice Session Answers 79 10 = 117 8 194 10 = 302 8 208 10 = 320 8 255 10 = 377 8

24 Copyright (c) 2004 Professor Keith W. Noe Converting Decimal Numbers to Hexadecimal

25 Copyright (c) 2004 Professor Keith W. Noe Conversion of Decimal Numbers to Hexadecimal The same process is used for converting decimal numbers to hex that is for converting decimal numbers to binary and octal. Use the process of repeated division keeping track of the remainders. When converting decimal numbers to hex, divide the decimal number by 16.

26 Copyright (c) 2004 Professor Keith W. Noe Conversion of Decimal Numbers to Hexadecimal Do not forget, when remainders are 10 or higher, convert the remainder to the appropriate letter of the alphabet. 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, and F = 15.

27 Copyright (c) 2004 Professor Keith W. Noe Decimal-to-Hexadecimal Conversion Convert 195 10 to Hexadecimal.

28 Copyright (c) 2004 Professor Keith W. Noe Decimal-to-Hexadecimal Conversion 195  16 = 12 R 3 12  16 = 0 R 12 (C) 195 10 = C3 16

29 Copyright (c) 2004 Professor Keith W. Noe Practice Session Practice converting the following decimal numbers to hexadecimal. 57 10 138 10 217 10 255 10

30 Copyright (c) 2004 Professor Keith W. Noe Practice Session Solutions 57 10 = 39 16 138 10 = 8A 16 217 10 = D9 16 255 10 = FF 16

31 Copyright (c) 2004 Professor Keith W. Noe Other Number System Conversion Methods

32 Copyright (c) 2004 Professor Keith W. Noe Other Number Conversions There are times when it is necessary to convert binary numbers to octal & vice versa; Between the binary and hexadecimal numbers systems. These conversions basically do not require math such as multiplication or division.

33 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Octal Conversion

34 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Octal Conversion It is a simple process. Begin by dividing the binary number into groups of three bits each beginning on the right. Convert each group of three bits into its equivalent octal number from 0 to 7.

35 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Octal Equivalency 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7

36 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Octal Conversion Convert 10111001 2 to Octal.

37 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Octal Conversion 10111001 10 | 111 | 001 2 7 1 10111001 2 = 271 8

38 Copyright (c) 2004 Professor Keith W. Noe Practice Session Convert the following binary numbers to octal. 01101100 2 10110011 2 00101001 2 11111111 2

39 Copyright (c) 2004 Professor Keith W. Noe Practice Session Answers 01101100 2 = 154 8 10110011 2 = 263 8 00101001 2 = 051 8 11111111 2 = 377 8

40 Copyright (c) 2004 Professor Keith W. Noe Octal-to-Binary Conversion

41 Copyright (c) 2004 Professor Keith W. Noe Octal-to-Binary Conversion The method for converting octal numbers to binary is similar to the method used for converting binary numbers to octal. First, separate the octal digits. Second, write the binary equivalent for each of the octal digits.

42 Copyright (c) 2004 Professor Keith W. Noe Octal-to-Binary Conversion Convert 253 8 to Binary

43 Copyright (c) 2004 Professor Keith W. Noe Octal-to-Binary Conversion 2 5 3 8 2 | 5 | 3 10 101 011 253 8 = 10101011 2

44 Copyright (c) 2004 Professor Keith W. Noe Practice Session Convert the following octal numbers to binary. 037 8 116 8 145 8 273 8

45 Copyright (c) 2004 Professor Keith W. Noe Practice Session Answers 037 8 = 00111111 2 116 8 = 01001110 2 145 8 = 01100101 2 273 8 = 10111011 2

46 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Hexadecimal Conversion

47 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Hexadecimal Conversion Converting binary numbers to hexadecimal is similar to the process used for converting binary numbers to octal. When converting binary numbers to hexadecimal, divide the 8-bit binary number in-half.

48 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Hexadecimal Conversion After dividing the binary number in half, write the hexadecimal equivalent for each 4-bit group.

49 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Hexadecimal Conversion Binary to Hex Equivalency 0000 = 0 1000 = 8 0001 = 1 1001 = 9 0010 = 2 1010 = A 0011 = 3 1011 = B 0100 = 4 1100 = C 0101 = 5 1101 = D 0110 = 6 1110 = E 0111 = 7 1111 = F

50 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Hexadecimal Conversion Convert 10011100 2 to Hexadecimal

51 Copyright (c) 2004 Professor Keith W. Noe Binary-to-Hexadecimal Conversion 10011100 1001 | 1100 9 C 10011100 2 = 9C 16

52 Copyright (c) 2004 Professor Keith W. Noe Practice Session Convert the following binary numbers to hexadecimal. 00001010 2 10011110 2 11110011 2 01111101 2

53 Copyright (c) 2004 Professor Keith W. Noe Practice Session Solutions 00001010 2 = 0A 16 10011110 2 = 9E 16 11110011 2 = F3 16 01111101 2 = 7D 16

54 Copyright (c) 2004 Professor Keith W. Noe Hexadecimal-to-Binary Conversion

55 Copyright (c) 2004 Professor Keith W. Noe Hexadecimal-to-Binary Conversion Converting a hexadecimal number to binary is similar to converting an octal number to binary. Divide the hexadecimal number into its individual numbers (symbols). Write the binary equivalent for each symbol.

56 Copyright (c) 2004 Professor Keith W. Noe Hexadecimal-to-Binary Conversion Convert 5C 16 to binary.

57 Copyright (c) 2004 Professor Keith W. Noe Hexadecimal-to-Binary Conversion 5 C 5 | C 0101 1100 5C 16 = 01011100 2

58 Copyright (c) 2004 Professor Keith W. Noe Practice Session Convert the following hexadecimal numbers to binary. 1B 16 94 16 A5 16 FB 16

59 Copyright (c) 2004 Professor Keith W. Noe Practice Session Answers 1B 16 = 00011011 2 94 16 = 10010100 2 A5 16 = 10100101 2 FB 16 = 11111011 2

60 Copyright (c) 2004 Professor Keith W. Noe


Download ppt "Copyright (c) 2004 Professor Keith W. Noe Number System & Codes Number Conversions Part II."

Similar presentations


Ads by Google