tf_lerp_booth.v 1.9 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	tf_lerp_booth
// description:	Pseudo-Booth encoder for bilerp for texture filter unit.
//		Generates 9 partial products. Two of these feed the CSA
//		for lerp subtract/multiply. This effectively does the
//		subtract without propagating the carries. The negative
//		input is first 1's complemented, then the two inputs are
//		considered bitwise. If none is set, mask out the multiply
//		input. If one bit is set, pass the mpy input as a partial
//		product. If both bits are set, shift up one bit.
//		This implements the sign extended interpretation of the
//		subtract inputs. The 9 bit inputs are sign extended before
//		the subtract, and all 10 bits of result are used in the
//		multiply by the other 9 bit input.
//
// designer:	Phil Gossett
// date:	6/18/94
//
////////////////////////////////////////////////////////////////////////

module tf_lerp_booth (x, y, a, p0p, p1p, p2p, p3p, p4p, p5p, p6p, p7p, p8p);

input [8:0] x;
input [8:0] y;
input [8:0] a;

output [9:0] p0p;	// pseudo-booth encoded partial products
output [9:0] p1p;
output [9:0] p2p;
output [9:0] p3p;
output [9:0] p4p;
output [9:0] p5p;
output [9:0] p6p;
output [9:0] p7p;
output [8:0] p8p;

tf_lerp_booth0 booth0 (.x(x[0]), .y(y[0]), .a(a[8:0]), .p(p0p[9:0]));
tf_lerp_booth0 booth1 (.x(x[1]), .y(y[1]), .a(a[8:0]), .p(p1p[9:0]));
tf_lerp_booth0 booth2 (.x(x[2]), .y(y[2]), .a(a[8:0]), .p(p2p[9:0]));
tf_lerp_booth0 booth3 (.x(x[3]), .y(y[3]), .a(a[8:0]), .p(p3p[9:0]));
tf_lerp_booth0 booth4 (.x(x[4]), .y(y[4]), .a(a[8:0]), .p(p4p[9:0]));
tf_lerp_booth0 booth5 (.x(x[5]), .y(y[5]), .a(a[8:0]), .p(p5p[9:0]));
tf_lerp_booth0 booth6 (.x(x[6]), .y(y[6]), .a(a[8:0]), .p(p6p[9:0]));
tf_lerp_booth0 booth7 (.x(x[7]), .y(y[7]), .a(a[8:0]), .p(p7p[9:0]));
tf_lerp_booth8 booth8 (.x(x[8]), .y(y[8]), .a(a[8:0]), .p(p8p[8:0]));

endmodule // tf_lerp_booth