cc_lerp_booth.v 1.96 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	cc_lerp_booth
// description:	Pseudo-Booth encoder for lerp for color combine unit.
//		Generates 9 partial products. this feeds 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 "Akeley" interpretation of the
//		subtract inputs. The 9 bit inputs treated as unsigned if
//		the 2 msb's are 10, else 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/19/94
//
////////////////////////////////////////////////////////////////////////

module cc_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;

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

endmodule // cc_lerp_booth