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

module cc_edge_booth0 (max1, x, y, a, p);

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

wire [4:0] pp;

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

an02d1h mux0sa (.z(msel), .a1(x), .a2(y)); 	// msel = x && y
nr02d1	mux0sb (.zn(mpen), .a1(x), .a2(y));
nr02d2  mux0e0 (.zn(menb), .a1(mpen), .a2(max1));// menb = x || y
mx21d1h mux0b0 (.s(msel), .i0(a[0]), .i1(1'b0), .z(pp[0]));
mx21d1h mux0b1 (.s(msel), .i0(a[1]), .i1(a[0]), .z(pp[1]));
mx21d1h mux0b2 (.s(msel), .i0(a[2]), .i1(a[1]), .z(pp[2]));
mx21d1h mux0b3 (.s(msel), .i0(a[3]), .i1(a[2]), .z(pp[3]));
mx21d1h mux0b4 (.s(msel), .i0(1'b0), .i1(a[3]), .z(pp[4]));
an02d1h and0b0 (.a1(menb), .a2(pp[0]), .z(p[0]));
an02d1h and0b1 (.a1(menb), .a2(pp[1]), .z(p[1]));
an02d1h and0b2 (.a1(menb), .a2(pp[2]), .z(p[2]));
an02d1h and0b3 (.a1(menb), .a2(pp[3]), .z(p[3]));
an02d1h and0b4 (.a1(menb), .a2(pp[4]), .z(p[4]));

endmodule // cc_edge_booth0