For another example, an LF control byte of $80 ( = 1000 0000 binary) turns on bits only
for those points of the D destination rectangle where the corresponding bits of A, B, and C
sources were all on (ABC = 1, bit 7 of LF on). All other points in the rectangle, which
correspond to other combinations for A, B, and C, will be 0. This is because bits 6 through
0 of the LF control byte, which specify the D output for these situations, are set to 0.
DESIGNING THE LF CONTROL BYTE WITH MINTERMS
One approach to designing the LF control byte uses logic equations. Each of
the rows in the truth Table corresponds to a "minterm", which is a
particular arrangement of values to the A, B, and C bits. For instance, the
___
first minterm is usually written ABC, or "not A and not B and not C". The
last is written as ABC.
NOTE
Two terms that are adjacent are AND'ed, and two terms that are separated by
"+" are OR'ed. "And" has a higher precedence, so AB + BC is equal to (AB) +
(BC).
Any function can be written as a sum of minterms. If we wanted to calculate
the function where D is one when the A bit is set and the C bit
_
is clear, or when the B bit is set, we can write that as AC+B, or "A and not
C or B". Since "1 and A" is "A":
_
D = AC + B
_
D = A(1)C + (1)B(1)
_ _
Since either A or A is true (1 = A + A), and similarly for B, and C; we
can expand the above equation further:
_
D = A(1)C + (1)B(1)
_ _ _ _ _
D=A(B+B)C+(A+A)B(C+C)
_ __ _ _ _
D=ABC+ABC+AB(C+C)+AB(C+C)
_ __ _ _ _ _
D=ABC+ABC+ABC+ABC+ABC+ABC
After eliminating duplicates, we end up with the five minterms:
_ _ __ _ _ _
AC+B=ABC+ABC+ABC+ABC+ABC
These correspond to BLTCON0 bit positions of 6, 4, 7, 3, and 2, according to
our truth Table, which we would then set, and clear the rest.
The wide range of logic operations allow some sophisticated graphics
techniques. For instance, you can move the image of a car across some pre-
existing building images with a few blits. Producing this effect requires
predrawn images of the car, the buildings (or background), and a car
- Blitter Hardware 169 -