1 / 17

THE BINARY NUMBER SYSTEM

THE BINARY NUMBER SYSTEM. Binary Numbers. Ex. 1: The decimal number 14 is represented in binary as:. Ex. 2: The decimal number 353 is represented in binary as:. Ex.3: The decimal number 251 is represented in binary as. Fractions.

haroun
Télécharger la présentation

THE BINARY NUMBER SYSTEM

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. THE BINARY NUMBER SYSTEM

  2. Binary Numbers

  3. Ex. 1: The decimal number 14 is represented in binary as:

  4. Ex. 2: The decimal number 353 is represented in binary as:

  5. Ex.3: The decimal number 251 is represented in binary as

  6. Fractions • Numbers smaller than 1 are represented using negative powers of 2. For reference, the first few negative powers of 2 are:

  7. EX. The decimal number 3.375 is represented in binary as:

  8. Note • The fractions 1/3 or 3/7 cannot be represented as terminating • decimal numbers, A little thought will lead one to realize that • only those fractions whose denominator can be expressed as a • power of 2 can be written as a terminating binary number. The • binary number representations for ½, ¼, 3/8, 9/16, etc. all • terminate. However, the binary number representations for 1/3, • 1/5, 3/10 etc. need an infinite number of binary digits. The least significant (right-most) bits of these representations must be • truncated. As is the case of decimal numbers, we must decide • how many digits beyond the binary point we wish to retain

  9. Hexadecimal numbers • In order to avoid the writing of long strings of 1’s and 0’s, other number systems based on powers of 2 are used, the most common being the base 16 or hexadecimal system. Powers of two are used to enable easy conversion back and forth from binary

  10. To convert 1001011100.011001 to hexadecimal, we first pad with 0’s as appropriate on both the left and the right, and • rewrite it as: • 0010|0101|1100.0110|0100 • = 25C.64

  11. To go from binary to hexadecimal, we start at the binary point, making sure that the number of digits to the left and right of the point are multiples of four. If not, simply add leading 0’s in the first case and trailing 0’s in the second. We then divide up the binary number into groups of four and replace each group by its hexadecimal equivalent. To go from hexadecimal to binary, we • simply reverse the process.

  12. 25C.64

  13. Reference • http://users.encs.concordia.ca/~tahar/coen311/notes/Chapter2-NumberSystem.pdf • http://www.statman.info/conversions/hexadecimal.html

More Related