tf_lerp.v 1.84 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	tf_lerp
// description:	Bilerp for texture filter unit. 23 partial products.
//		Note that this is the triangular bilerp
//		(2 multiplies per component).
//
// designer:	Phil Gossett
// date:	6/18/94
//
////////////////////////////////////////////////////////////////////////

module tf_lerp (xa, ya, a, xb, yb, b, c, t, o, mp);

input [8:0] xa;		// 1st positive subtract input
input [8:0] ya;		// 1st negative subtract input
input [8:0] a;		// 1st multiply input
input [8:0] xb;		// 2nd positive subtract input
input [8:0] yb;		// 2nd negative subtract input
input [8:0] b;		// 2nd multiply input
input [8:0] c;		// final lerp add
input [8:0] t;		// for mid mode average (1's comp)
input [8:0] o;		// for mid mode average

wire [9:0] p0p;		// pseudo-booth encoded partial products (*a)
wire [9:0] p1p;
wire [9:0] p2p;
wire [9:0] p3p;
wire [9:0] p4p;
wire [9:0] p5p;
wire [9:0] p6p;
wire [9:0] p7p;
wire [8:0] p8p;
wire [9:0] q0q;		// pseudo-booth encoded partial products (*b)
wire [9:0] q1q;
wire [9:0] q2q;
wire [9:0] q3q;
wire [9:0] q4q;
wire [9:0] q5q;
wire [9:0] q6q;
wire [9:0] q7q;
wire [8:0] q8q;

output [8:0] mp;	// final carry-propagated sum

tf_lerp_booth bootha (	.x(xa), .y(ya), .a(a),
			.p0p(p0p), .p1p(p1p), .p2p(p2p),
			.p3p(p3p), .p4p(p4p), .p5p(p5p),
			.p6p(p6p), .p7p(p7p), .p8p(p8p));
tf_lerp_booth boothb (	.x(xb), .y(yb), .a(b),
			.p0p(q0q), .p1p(q1q), .p2p(q2q),
			.p3p(q3q), .p4p(q4q), .p5p(q5q),
			.p6p(q6q), .p7p(q7q), .p8p(q8q));
tf_lerp_csa	csa  (	.a(a), .b(b),
			.p0p(p0p), .p1p(p1p), .p2p(p2p),
			.p3p(p3p), .p4p(p4p), .p5p(p5p),
			.p6p(p6p), .p7p(p7p), .p8p(p8p),
			.q0q(q0q), .q1q(q1q), .q2q(q2q),
			.q3q(q3q), .q4q(q4q), .q5q(q5q),
			.q6q(q6q), .q7q(q7q), .q8q(q8q),
			.c(c), .t(t), .o(o), .mp(mp));

endmodule // tf_lerp