© 2003, Cisco Systems, Inc. All rights reserved.
Basics Information
Objectives (Cont.) Convert a decimal number to a binary number Convert a binary number to a decimal number Convert a binary number to a hexadecimal number Convert a hexadecimal number to a binary number Lesson Aim <Enter lesson aim here.>
Units of Information Units Bytes Bits bit (b) — 1 bit byte (B) 1 byte kilobyte (KB) 1000 bytes 8000 bits megabyte (MB) 1 million bytes 8 million bits gigabyte (GB) 1 billion bytes 8 billion bits
Decimal-to-Binary Conversion (r = remainder) 253/2 = 126 r 1 126/2 = 63 r 0 63/2 = 31 r 1 31/2 = 15 r 1 15/2 = 7 r 1 7/2 = 3 r 1 3/2 = 1 r 1 1/2 = 0 r 1 Converting a decimal number (253) to binary by successive division by 2 Write the binary number in order of the last bit first: 11111101
Base 2 Numbering System Number of Symbols 2 2 2 2 2 2 2 2 Symbols 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 Base Exponent 27 26 25 24 23 22 21 20 Place Value 128 64 32 16 8 4 2 1 Example: Convert decimal 35 to binary 1 1 1
Binary-to-Decimal Conversion Convert the binary number 11111101 to a decimal number (Binary bits have decimal values) Decimal Position Value 128 64 32 16 8 4 2 1 1 or 0 1 1 1 1 1 1 0 1 128*1 + 64*1 + 32*1 + 16*1 + 8*1 + 4*1 + 2*0 + 1*1 128 + 64 + 32 + 16 + 8 + 4 + 0 + 1 = 253
Base 2 Number System Number of Symbols 2 Symbols 0, 1 Base Exponent 27 26 25 24 23 22 21 20 Place Value 128 64 32 16 8 4 2 1 Example: Binary Number 1 1 1 1 1 Decimal number Total: 185 128 32 16 8 1
Binary-and-Hexadecimal Systems 00000000 00 1 00000001 01 2 00000010 02 3 00000011 03 4 00000100 04 5 00000101 05 6 00000110 06 7 00000111 07 8 00001000 08 9 00001001 09 10 00001010 0A 11 00001011 0B 12 00001100 0C 13 00001101 0D 14 00001110 0E 15 00001111 0F 16 00010000 10 32 00100000 20 64 01000000 40 128 10000000 80 255 11111111 FF
Binary-and-Hexadecimal Number Systems 0000 = 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
Binary-to-Hexadecimal Conversion Example 100100100010111110111110111001001 Converts to: 0001 0010 0100 0101 1111 0111 1101 1100 1001 Converts to: 1 2 4 5 F 7 D C 9 So: 100100100010111110111110111001001 Binary = 1245F7DC9 hexadecimal
Hexadecimal-to-Binary Conversion Example Converts to: 2 1 0 2 0010 0001 0000 0010 So: 2102 hexadecimal converts to: 0010 0001 0000 0010 binary
Summary (Cont.) Computers can recognize and process data only by using the binary numbering system. The binary number system is made up of 0s and 1s. Decimal numbers can be converted to binary numbers by following specific procedures. The hexadecimal number system is used frequently at higher levels of computation. The hexadecimal number system uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.