1 / 12

ECE 2110: Introduction to Digital Systems

ECE 2110: Introduction to Digital Systems. Number Systems: conversions. Previous class Summary. Positional number systems Common Base 2, 8, 10, 16 Others !. Hex (base 16) to Binary Conversion.

Download Presentation

ECE 2110: Introduction to Digital Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECE 2110: Introduction to Digital Systems Number Systems: conversions

  2. Previous class Summary • Positional number systems • Common Base 2, 8, 10, 16 • Others !

  3. Hex (base 16) to Binary Conversion Each Hex digit represents 4 bits. To convert a Hex number to Binary, simply convert each Hex digit to its four bit value. Hex Digits to binary:016 = 00002116 = 00012216 = 00102316 = 00112416 = 01002516 = 01012616 = 01102716 = 01112816 = 10002 Hex Digits to binary (cont):916 = 10012A16 = 10102B16 = 10112C16 = 11002D16 = 11012E16 = 11102F16 = 11112

  4. Hex to Binary, Binary to Hex A2F16 = 1010 0010 1111234516 = 0011 0100 01012 Binary to Hex is just the opposite, create groups of 4 bits starting with least significant bits. If last group does not have 4 bits, then pad with zeros for unsigned numbers.10100012 = 010100012= 5116 Padded with a zero

  5. Octal to Binary, Binary to Octal 3458 = 011 100 1012 Binary to Octal is just the opposite, create groups of 3 bits starting with least significant bits. If last group does not have 3 bits, then pad with zeros for unsigned numbers.10100012 = 001010 0012= 1218 Padded with a zero

  6. Conversion of Any Base to Decimal Converting from ANY base to decimal is done by multiplying each digit by its weight and summing. Binary to Decimal 1011.112= 1x23 + 0x22 + 1x21 + 1x20 + 1x2-1 + 1x2-2 = 8 + 0 + 2 + 1 + 0.5 + 0.25 = 11.75 Hex to Decimal A2F16 = 10x162 + 2x161 + 15x160 = 10 x 256 + 2 x 16 + 15 x 1 = 2560 + 32 + 15 = 2607

  7. A Trick! If faced with a large binary number that has to be converted to decimal, I first convert the binary number to HEX, then convert the HEX to decimal. Less work! 1101111100112 = 1101 1111 00112 = D16 F16 316 = 13 x 162 + 15 x 161 + 3x160 = 13 x 256 + 15 x 16 + 3 x 1 = 3328 + 240 + 3 = 357110 Of course, you can also use the binary, hex conversion feature on your calculator. Calculators won’t be allowed on the first test, though…...

  8. Conversion of Decimal Integer To ANY Base Divide Number N by base R until quotient is 0. Remainder at EACH step is a digit in base R, from Least Significant digit to Most significant digit.

  9. Example Convert 53 to binary 53/2 = 26, rem = 1 26/2 = 13, rem = 0 13/2 = 6 , rem = 1 6 /2 = 3, rem = 0 3/2 = 1, rem = 1 1/2 = 0, rem = 1 5310 = 1101012 = 1x25 + 1x24 + 0x23 + 1x22 + 0x21 + 1x20 = 32 + 16 + 0 + 4 + 0 + 1 = 53 Least Significant Digit Most Significant Digit

  10. More Conversions Convert 53 to Hex 53/16 = 3, rem = 5 3 /16 = 0 , rem = 35310 = 3516 = 3 x 161 + 5 x 160 = 48 + 5 = 53 9710=??? 16

  11. Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2N-1. 4 bits = 0 to 158 bits = 0 to 25516 bits = 0 to 65535 Besides simply representation, we would like to also do arithmetic operations on numbers in binary form. Principle operations are addition and subtraction.

  12. Next… • Additions/subtractions

More Related