|
Authored by: Anonymous on Friday, March 29 2013 @ 10:43 AM EDT |
Also, as best I can remember, BCD is integer (or fixed point), not floating
point.
You misremember. Any base, 2 or 10 or 16 or whatever, can be used to represent
numbers in either fixed- or floating-point formats. Some languages (e.g., Cobol,
PL/I) require support for floating-point-decimal in the language. Some computers
(e.g., Honeywell DPS-8 mainframes) support floating-point-decimal in the
hardware instruction set.
[Caveat: this based on personal knowledge derived partly from writing the
manufacturer-supplied binary-to-decimal floating-point conversions for
Fortran-77 (and other languages) for the DPS-8 (and other computers).][ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Tuesday, April 02 2013 @ 05:38 AM EDT |
BCD is Binary Coded Decimal and used 10 of the 16 possible 4 bit
combinations. When packed 2 to a byte (each nybble a separate BCD digit)
conversion requires more than a nop.
Consider the addition of binary
representation 00100010 = 0x42 (in hexadecimal) + 00001001 = 0x09:
- in
BCD: 0x42 is decimal 42 → 0x42 + 0x09 → 42 + 9 = 51 → 0x51 =
01010001
- in normal: 0x42 + 0x09 = 0x4B = 01001011
conversion between
the two results is not a nop!
On a Z80 a DAA would be required but on a 6502
a SED prior to the ADC would do the addition directly in BCD (without the SED,
ie CLD, the ADC would be done in normal binary).
IIRC the 6502 had
inspiration from a PDP-8. [ Reply to This | Parent | # ]
|
|
|
|
|