100 likes | 187 Views
Computer Systems. Dk Izzati Pg Haji Ahmad. Octal The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Each octal digit represents three binary digits. Conversion of binary to octal
E N D
Computer Systems DkIzzati Pg Haji Ahmad
Octal • The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. • Each octal digit represents three binary digits
Conversion of binary to octal • Given a binary number, in order to convert it to an octal number, first of all, split the binary number into groups of 3 bits starting from the right. Example: 110111001₂ 110 111 001 6 7 1 Hence, 110111001₂ = 671₈
Conversion of octal to binary • To convert octal to binary, replace each octal digit by its binary representation. Example: Convert 518 to binary: • 58 = 1012 • 18 = 0012 • Thus: 518 = 101 0012
Conversion of octalto decimal • To convert a number k to decimal, use the formula that defines its base-8 representation: • In this formula, ai is an individual octal digit being converted, where i is the number of the digit (counting from 0 for the right-most digit). Example: Convert 7648 to decimal: 7648= 7 x 8² + 6 x 8¹ + 4 x 8° = 448 + 48 + 4 = 50010
Exercise 1. Convert the following binary numbers to octal a. 101 b. 1001 c. 110101 d. 1110010 e. 11101011 f. 1110001101 g. 0001110100011 h. 111000011010101
2. Convert the following octal numbers to binary: • 65 • 876 • 2190 • 67788 • 324671 • 4440134 • 870145 • 2506779
3. Convert the following octal numbers to decimal: a. 90 b. 255 c. 2787 d. 44567 e. 2908043 f. 289001 g. 112009 h. 567830
4. Convert the following decimal numbers to octal: • 9 • 32 • 73 • 255 • 1,025 • 4,099 • 65536 • 1,048,575
Convert the following octal numbers to hexadecimal: • 79 • 321 • 673 • 2098 • 123025 • 401099 • 634528 • 281995