Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hexadecimal Dk Izzati Pg Haji Ahmad.

Similar presentations


Presentation on theme: "Hexadecimal Dk Izzati Pg Haji Ahmad."— Presentation transcript:

1 Hexadecimal Dk Izzati Pg Haji Ahmad

2 Hex Hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a through f) to represent values For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160) , or 10,995. Each hexadecimal digit represents four binary digits, and the primary use of hexadecimal notation is as a human-friendly representation of binary coded values in computing and digital electronics. For example, byte values can range from 0 to 255 (decimal) but may be more conveniently represented as two hexadecimal digits in the range 00 through FF.

3 Conversion of binary to hex
Given a binary number, in order to convert it to a hex number, first of all, split the binary number into groups of 4 bits starting from the right. Example: ₂ Hence, ₂ = 9B₁₆ 9 B

4 = (2 x 16³) + (10 x 16²) + (15 x 16¹) + (3 x 16⁰)
Conversion of hex to decimal To convert hex to decimal, there are more than 1 alternative but the easiest way is to multiply each figure of the hex digit with 16ⁿ starting with the power of 0 (starts from the rightmost). Confusing? Let’s take a look at the example below: Example: Given a hex number 2AF3, convert it to a decimal. 2AF3 = (2 x 16³) + (10 x 16²) + (15 x 16¹) + (3 x 16⁰) = = 10,995 The power of 16 should start from 0 and not 1 and it should begin from the rightmost of the hex number. The hex digit represented by an alphabet should be expand to a decimal number

5 How about the conversion of decimal to hex?
Let’s take a look at the table below. Example 1: Decimal Numberc Operation Quotient Remainder Hexadecimal Result 1792 112 7 ÷ 16 = DONE. 00 700

6 Example 2: 48879 3054 190 11 ÷ 16 = Done. 15 14 F EF EEF BEEF
       Example 2: Decimal Number Operation Quotient Remainder  Hexadecimal Result 48879 3054 190 11 ÷ 16 = Done. 15 14 F EF EEF BEEF

7 Conversion of hex to octal
To convert a hexadecimal number to an octal number, the first thing to do is to convert the hex number into something which is common between the two numeral system: BINARY. Each hex digit is represented by 4-bits binary E.g.: Convert AF6D to an octal. A = 10 = 1010 F = 15 = 1111 6 = 0110 D = 13 = 1101 Hence, AF6D = An octal number is represented by 3-bits binary. Hence, starting from the right most side, divide the number above (hex converted to binary) into 3-bits binary.

8 Hence, the answer for the conversion of AF6D to octal is 1275558
Divide the binary every 3-bits starting from right to left ADD 0 to the last set if it is not exactly 3-bits Change each set of 3-bits into decimal

9 Exercise 1. Convert the following binary numbers to hexadecimal a
Exercise 1. Convert the following binary numbers to hexadecimal a b c d e f g h

10 2. Convert the following hexadecimal numbers to binary:
ADEA AF C-9F-F2-A9 E ABCDEF F0E1D2C3B4A59687 B0C 1000

11 3. Convert the following hexadecimal numbers to decimal:
a. AA b. 123F c. FEDCBA d. D0-BE-D0 e. B8C f. FF-FF-FF-FA g. 10 h. FABE

12 4. Convert the following decimal numbers to hexadecimal:
9 32 73 255 1,025 4,099 65536 1,048,575


Download ppt "Hexadecimal Dk Izzati Pg Haji Ahmad."

Similar presentations


Ads by Google