day7 - Number Systems Binary, Decimal, and Hexadecimal...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Number Systems – Binary, Decimal, and Hexadecimal Basic Number Systems and Conversions See Appendix A for a brief history of number systems. Binary Base or radix 2 number system B inary dig it is called a bit. Numbers are 0 and 1 only. Numbers are expressed as powers of 2. 2 0 = 1, 2 1 = 2, 2 2 = 4, 2 3 = 8, 2 4 = 16, 2 5 = 32, 2 6 = 64, 2 7 = 128, 2 8 = 256, 2 9 = 512, 2 10 = 1024, 2 11 = 2048, 2 12 = 4096, 2 12 = 8192, … Conversion of binary to decimal ( base 2 to base 10) Example: convert (110011) 2 to decimal = (1 x 2 5 ) + (1 x 2 4 ) + (0 x 2 3 ) + (0 x 2 2 ) + (1 x 2 1 ) + (1 x 2 0 ) = 32 + 16 + 0 + 0 + 2 + 1 = (51) 10 Conversion of decimal to binary (base 10 to base 2) Example: convert (51) 10 to binary 51 ÷ 2 = 25 remainder is 1 25 ÷ 2 = 12 remainder is 1 12 ÷ 2 = 6 remainder is 0 6 ÷ 2 = 3 remainder is 0 3 ÷ 2 = 1 remainder is 1 1 ÷ 2 = 0 remainder is 1 Answer = 1 1 0 0 1 1 Note: the answer is read from bottom (MSB) to top (LSB) as 110011 2 Octal Base or radix 8 number system 1 octal digit is equivalent to 3 bits. Numbers are 0-7. Numbers are expressed as powers of 8. 8 0 = 1, 8 1 = 8, 8 2 = 64, 8 3 = 512, 8 4 = 4096. Number Systems - 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Conversion of octal to decimal ( base 8 to base 10) Example: convert (632) 8 to decimal = (6 x 8 2 ) + (3 x 8 1 ) + (2 x 8 0 ) = (6 x 64) + (3 x 8) + (2 x 1) = 384 + 24 + 2 = (410) 10 Conversion of decimal to octal (base 10 to base 8) Example: convert (177) 10 to octal 177 ÷ 8 = 22 remainder is 1 22 ÷ 8 = 2 remainder is 6 2 ÷ 8 = 0 remainder is 2 Note: the answer is read from bottom to top as (261) 8 , the same as with the binary case. Hexadecimal Base or radix 16 number system 1 hex digit is equivalent to 4 bits. Numbers are 0-9, A, B, C, D, E, and F. (A) 16 = (10) 10 , (B) 16 = (11) 10 , (C) 16 = (12) 10 , (D) 16 = (13) 10 , (E) 16 = (14) 10 , (F) 16 = (15) 10 Numbers are expressed as powers of 16. 16 0 = 1, 16 1 = 16, 16 2 = 256, 16 3 = 4096, 16 4 = 65536, … Conversion of hexadecimal to decimal ( base 16 to base 10) Example: convert (F4C) 16 to decimal = (F x 16 2 ) + (4 x 16 1 ) + (C x 16 0 ) = (15 x 256) + (4 x 16) + (12 x 1) = 3840 + 64 + 12 = (3916) 10 Conversion of decimal to hex (base 10 to base 16) Example: convert (77) 10 to hex 77 ÷ 16 = 4 remainder is D 4 ÷ 16 = 0 remainder is 4 Note: the answer is read from bottom to top as (4D) 16 , the same as with the binary case. Number Systems - 2
Background image of page 2
Decimal Binary Octal Hexadecimal 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F Figure 1 - Table of Binary, Decimal and Hexadecimal Numbers Conversion of Octal and Hex to Binary Conversion of octal and hex numbers to binary is based upon the the bit patterns shown in the table above and is straight forward. For octal numbers, only three bits are required. Thus 6 8 = 110 2 , and 345 8 = 11100101 2 . For hex numbers, four bits are required. Thus E
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

day7 - Number Systems Binary, Decimal, and Hexadecimal...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online