Decimal Adjust Accumulator on the 4004
kylevowen at gmail.com
Thu Jan 28 20:44:16 CST 2016
On Thu, Jan 28, 2016 at 8:33 PM, Brent Hilpert <hilpert at cs.ubc.ca> wrote:
> The original looks correct to me.
> I think you or the documentation are confusing the hardware carry flag
> with the carry out of the 4th bit (nibble carry).
> A binary addition of two BCD digits will require correction either if the
> result is in the range 0xA to 0xF or if there was a carry out of the 4th
> The hardware carry flag is the carry out of the 8th bit and is irrelevant
> immediately after the addition.
But this is a 4-bit architecture...? A carry out of the 4th bit does affect
the carry flag.
The JS simulator uses an 8-bit value to hold the 4-bit accumulator, which
is why they check if there's anything in the upper nibble, then clear the
upper nibble of the accumulator.
Or did I miss something?
More information about the cctech