bl_cvg3.v 1.62 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	bl_cvg3
// description: Interpenetration and coverage wrap for blend unit.
//
// designer:	Phil Gossett
// date:	9/1/94
//
////////////////////////////////////////////////////////////////////////

module bl_cvg3 (pcvg, mcvg, dest, en, alpha);

input [3:0] pcvg;	// 1.3
input [2:0] mcvg;	// 0.3
input [1:0] dest;	// 0) clamp/new, 1) wrap , 2) zap, 3) save.
input en;

output [2:0] alpha;	// 0.3

wire [3:0] pca;
wire [2:0] mco;
wire [3:0] s;
wire [2:0] c;

fn05d2 pca0 (.a1(pcvg[0]), .b1(dest[1]), .zn(pca[0]));
fn05d2 pca1 (.a1(pcvg[1]), .b1(dest[1]), .zn(pca[1]));
fn05d2 pca2 (.a1(pcvg[2]), .b1(dest[1]), .zn(pca[2]));
fn05d2 pca3 (.a1(pcvg[3]), .b1(dest[1]), .zn(pca[3]));

nr02d2 mcoe (.a1(en),      .a2(dest[0]), .zn(newcvg));
or02d2 mco0 (.a1(mcvg[0]), .a2(newcvg),   .z(mco[0]));
or02d2 mco1 (.a1(mcvg[1]), .a2(newcvg),   .z(mco[1]));
or02d2 mco2 (.a1(mcvg[2]), .a2(newcvg),   .z(mco[2]));

xo02d1 ads0 (           .a1(pca[0]), .a2(mco[0]), .z(s[0]));
an02d1 adc0 (           .a1(pca[0]), .a2(mco[0]),            .z(c[0]));
ad01d1 ads1 (.ci(c[0]),  .a(pca[1]),  .b(mco[1]), .s(s[1]), .co(c[1]));
ad01d1 ads2 (.ci(c[1]),  .a(pca[2]),  .b(mco[2]), .s(s[2]), .co(c[2]));
ad01d1 ads3 (.ci(c[2]),  .a(pca[3]),  .b(newcvg), .s(s[3]));

fn05d2 clmp (.a1(   s[3]), .b1(dest[0]), .zn(clamp));
fn05d2 zapp (.a1(dest[1]), .b1(dest[0]), .zn(zap));

or03d1 orr0 (.a1(s[0]), .a2(clamp), .a3(zap), .z(alpha[0]));
or03d1 orr1 (.a1(s[1]), .a2(clamp), .a3(zap), .z(alpha[1]));
or03d1 orr2 (.a1(s[2]), .a2(clamp), .a3(zap), .z(alpha[2]));

endmodule // bl_cvg3