1 / 6

BCD = Binary Coded Decimal

BCD = Binary Coded Decimal. Representing numbers. Integers 2’s complement is most popular BCD Real numbers Floating point IEEE 754 standard format is most popular Fixed point 2’s complement integers (using standard integer arithmetic) BCD All of the above are supported by IA32!.

yahto
Télécharger la présentation

BCD = Binary Coded Decimal

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. BCD = Binary Coded Decimal

  2. Representing numbers • Integers • 2’s complement is most popular • BCD • Real numbers • Floating point • IEEE 754 standard format is most popular • Fixed point • 2’s complement integers (using standard integer arithmetic) • BCD • All of the above are supported by IA32!

  3. BCD = binary coded decimal 4 bit encoding of 0..9 (decimal) base 10 base 2 BCD 0 0000 0000 same 1 0000 0001 " 2 0000 0010 " 3 0000 0011 " 4 0000 0100 " 5 0000 0101 " 6 0000 0110 " 7 0000 0111 " 8 0000 1000 " 9 0000 1001 " 10 0000 1010 0001 0000 11 0000 1011 0001 0001 12 0000 1100 0001 0010 . . . ? ? ?

  4. BCD = binary coded decimal 4 bit encoding of 0..9 (decimal) base 10 base 2 BCD 0 0000 0000 same 1 0000 0001 " 2 0000 0010 " 3 0000 0011 " 4 0000 0100 " 5 0000 0101 " 6 0000 0110 " 7 0000 0111 " 8 0000 1000 " 9 0000 1001 " 10 0000 1010 0001 0000 11 0000 1011 0001 0001 12 0000 1100 0001 0010 … … … 99 0110 0011 1001 1001 100 0110 0100 invalid … … invalid 255 1111 1111 invalid

  5. Why BCD? • What happened when we converted 0.10 (base 10) to base 2? 0.10 x 2 = 0.20 .0 0.20 x 2 = 0.40 0 0.40 x 2 = 0.80 0 0.80 x 2 = 0.60 1 0.60 x 2 = 0.20 1 . . .

  6. Binary and BCD addition Add 9 + 1.

More Related