Now a simple schematic, how to detect results from (decimal) 10..15:
BCD_ADD enables the BCD correction for A+B.
For A+B:
C_OUT=1 indicates a result greater than (decimal) 10.
Note the three_input OR gate, that produces the C_OUT output carry:
One if its inputs goes active, when A+B is greater than (decimal) 15.
For detecting results from (decimal) 10..15, we use two AND gates,
that are enabled during a BCD add.
The AND gate connected to Q3,Q1 detects (decimal) 10,11,14,15.
The other AND connected to Q3,Q2 detects (decimal) 12,13,14,15.
For A-B (or B-A):C_OUT=1 indicates a positive result.
Means, when subtracting BCD numbers, C_OUT=0 indicates a negative result,
and we need to do a BCD correction...
We could also use NANDs instead of an AND/OR combination:
Another trick would be using a 74151 8:1 multiplexer:
If the ALU carry output is active, the !OE (low_active output enable)
of the 74151 is 1, forcing the !Q output (and C_OUT) to 1.
If the ALU carry output is inactive:
If Q is 0..9, C_OUT is always 0.
For results from (decimal) 10..15, BCD_ADD=1 sets C_OUT to 1.
Now that we know, how to detect positive results greater than 10
or negative results, the next step is implementing the BCD correction.
[HOME] [UP]/ [BACK] [1] [2] [3] [4] [5] [6] [7] [NEXT]
(c) Dieter Mueller 2006