cc_edge_booth2.v 1.15 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	cc_edge_booth2
// description:	Pseudo-Booth encoder for texture edge
//		for color combine unit.
//
// designer:	Phil Gossett
// date:	9/16/94
//
////////////////////////////////////////////////////////////////////////

module cc_edge_booth2 (max1, x, y, a, p, c);

input max1;
input x;
input y;
input [3:0] a;

wire [3:0] pp;

output [3:0] p;		// pseudo-booth encoded partial product
output c;

in01d2  mux2ma (.zn(max1_l), .i(max1));
in01d4  mux2sa (.zn(msel), .i(x));			// msel = !x
xo02d1h mux2sb (.z(mpen), .a1(x), .a2(y));
an02d1h mux2e0 (.z(menb), .a1(mpen), .a2(max1_l));	// menb = x ^ y
xo02d1h mux2b0 (.a1(msel), .a2(a[0]), .z(pp[0]));
xo02d1h mux2b1 (.a1(msel), .a2(a[1]), .z(pp[1]));
xo02d1h mux2b2 (.a1(msel), .a2(a[2]), .z(pp[2]));
xo02d1h mux2b3 (.a1(msel), .a2(a[3]), .z(pp[3]));
an02d1h and2b0 (.a1(menb), .a2(pp[0]), .z(p[0]));
an02d1h and2b1 (.a1(menb), .a2(pp[1]), .z(p[1]));
an02d1h and2b2 (.a1(menb), .a2(pp[2]), .z(p[2]));
an02d1h and2b3 (.a1(menb), .a2(pp[3]), .z(p[3]));
an02d1h and2bc (.a1(menb), .a2(msel), .z(c));

endmodule // cc_edge_booth2