FUNCTIONS(3)
NAME
overflow MDI_reciprocal, MDI_shift, ,MDI_mul, MDI_sqrt
A set of functions emulating image-processor operations.
SYNOPSIS
extern short MDI_mul(short x, short y);
extern short MDI_reciprocal(short x);
extern short MDI_shift(short x, int shift);
extern short MDI_sqrt(short x);
extern int overflow(int x);
DESCRIPTION
These functions emulate some of the operations and functions
implemented in the image processor.
MDI_mul multiplies two 16-bit numbers, returning the most
significant 16 bits.
MDI_reciprocal returns the value that would be obtained from
a reciprocal table. In this case the table value is the
result obtained with a dividend of 32768. If the divisor is
zero, zero is returned.
MDI_shift performs an arithmetic shift on the first argument
by the amount specified by the second. A positive shift is
to the left, negative to the right.
MDI_sqrt returns the value that would be obtained from a
15-bit square-root table. The numbers are treated as binary
fractions with the binary point to the left, in other words
the argument is treated as if it were normalized by 32768.
A negative argument, that is, bit 15, set results in a
return of -1.
overflow is not actually an image-processor emulation func-
tion, but is used in the simulation as a check for excessive
left shift in MDI_shift.
EXAMPLES
See ~soi/(version)/src/libMDI.d/functions.c
HISTORY
1994 June 13, Lyle Bacon, created for SOI v 0.9