130 likes | 289 Views
Data Storage. Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas nras@iugaza.edu.ps Faculty of Information Technology Islamic University of Gaza. Hexadecimal (Hex).
E N D
Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.NaelAburasnras@iugaza.edu.ps Faculty of Information Technology Islamic University of Gaza
Hexadecimal (Hex) • Hex is a numbering system that uses Base 16. The numbers 0-910 are represented normally, but the numbers 1010 through 1510 are represented by the letters A through F • 1 hex digit is equivalent to 4 bits • Numbers are 0,1,2…..8,9, A, B, C, D, E, F. • The following shows that the number (2AE)16 in hexadecimal is equivalent to 686 in decimal. • The equivalent decimal number is N = 512 + 160 + 14 = 686.
Hexadecimal (Hex) • Using hexadecimal, a very large binary string of 1s and 0s can be represented with just a few hexadecimal numbers by breaking the binary number into groups of four and then using the hexadecimal equivalent; for example, 1101100101001111 can be written as 1101 1001 0100 1111
Hexadecimal to decimal • The following shows how to convert the hexadecimal number (1A)16 to decimal = 1 × 161 + A × 160 =16 + 10 ×1 =16+10 = 26 convert (F4C)16 to decimal = (F x 162) + (4 x 161) + (C x 160) = (15 x 256) + (4 x 16) + (12 x 1)
Decimal to hexadecimal convert (4768)10 to hex. = 4768 / 16 = 298 remainder 0 = 298 / 16 = 18 remainder 10 (A) = 18 / 16 = 1 remainder 2 = 1 / 16 = 0 remainder 1 Answer: 1 2 A 0
Hexadecimal to binary • (24C)16 • Each hexadecimal digit is converted to 4-bit patterns • 2 → 0010, 4 → 0100, and C → 1100 • (306 ) = (00110000 0110)
Binary to hexadecimal Convert (010011100010)2 to hexadecimal ? We first arrange the binary number in 4-bit patterns: 0100 1110 0010 4 E 2 Convert (0010110001101011)2 to hexadecimal? 0010 1100 0110 1011 2 C 6 B
Octal • The Octal numbering system is similar to the Hexadecimal numbering system. • This big difference is that the maximum value for Octal is 7 since it is Base 8 • 1 octal digit is equivalent to 3 bits.
Octal • (1256)8
Octal to Decimal • convert (632)8 to decimal = (6 x 82) + (3 x 81) + (2 x 80) = (6 x 64) + (3 x 8) + (2 x 1) = 384 + 24 + 2 = (410)10
Decimal to Octal • convert (177)10 to octal 177 / 8 = 22 remainder is 1 22 / 8 = 2 remainder is 6 2 / 8 = 0 remainder is 2 Answer = 2 6 1
Binary to octal • 111001112 = 3478 • 11000 010101010 010 0012 = 30252218
Octal to binary • convert (632)8 to binary (110011010)2