cc_cvg_alpha.v 6.58 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	cc_cvg_alpha
// description:	Coverage times alpha for texture edge
//		for color combine unit.
//
// designer:	Phil Gossett
// date:	6/13/95
//
////////////////////////////////////////////////////////////////////////

module cc_cvg_alpha (cc_a, cvg, cvg_times_alpha,
	clamp_a, cvg_alpha, alpha_cvg);

input [8:0] cc_a;
input [3:0] cvg;
input cvg_times_alpha;

output [8:0] clamp_a;
output [8:0] cvg_alpha;
output [8:0] alpha_cvg;

wire cc_a8n;
wire [8:0] pca;
wire ppcc_aff;
wire pcc_aff;
wire cc_aff;
wire [7:0] p0p;
wire [7:0] p1p;
wire [7:0] p2p;
wire [7:0] sa;
wire [7:0] ca;
wire [6:0] cc;
wire [7:0] mp;
wire [8:0] mx;
wire cvg_3b;
wire pctan;
wire ctan;
wire alpha_c8b;

in01d4  cvgin (.i(cc_a[8]), .zn(cc_a8n));
an02d1h cvga0 (.a1(cc_a8n), .a2(cc_a[0]),  .z(pca[0]));
an02d1h cvga1 (.a1(cc_a8n), .a2(cc_a[1]),  .z(pca[1]));
an02d1h cvga2 (.a1(cc_a8n), .a2(cc_a[2]),  .z(pca[2]));
an02d1h cvga3 (.a1(cc_a8n), .a2(cc_a[3]),  .z(pca[3]));
an02d1h cvga4 (.a1(cc_a8n), .a2(cc_a[4]),  .z(pca[4]));
an02d1h cvga5 (.a1(cc_a8n), .a2(cc_a[5]),  .z(pca[5]));
an02d1h cvga6 (.a1(cc_a8n), .a2(cc_a[6]),  .z(pca[6]));
an02d1h cvga7 (.a1(cc_a8n), .a2(cc_a[7]),  .z(pca[7]));
nr02d2  cvgnr (.a1(cc_a8n), .a2(cc_a[7]), .zn(pca[8]));

an08d2  xorap (.a1(cc_a[0]), .a2(cc_a[1]), .a3(cc_a[2]), .a4(cc_a[3]),
	       .a5(cc_a[4]), .a6(cc_a[5]), .a7(cc_a[6]), .a8(cc_a[7]),
	        .z(ppcc_aff));
an02d1h xoran (.a1(ppcc_aff), .a2(cc_a8n), .z(pcc_aff));
ni01d4  xorin (.i(pcc_aff),  .z(cc_aff));
xo02d1h xora0 (.a1(cc_aff), .a2(pca[0]), .z(clamp_a[0]));
xo02d1h xora1 (.a1(cc_aff), .a2(pca[1]), .z(clamp_a[1]));
xo02d1h xora2 (.a1(cc_aff), .a2(pca[2]), .z(clamp_a[2]));
xo02d1h xora3 (.a1(cc_aff), .a2(pca[3]), .z(clamp_a[3]));
xo02d1h xora4 (.a1(cc_aff), .a2(pca[4]), .z(clamp_a[4]));
xo02d1h xora5 (.a1(cc_aff), .a2(pca[5]), .z(clamp_a[5]));
xo02d1h xora6 (.a1(cc_aff), .a2(pca[6]), .z(clamp_a[6]));
xo02d1h xora7 (.a1(cc_aff), .a2(pca[7]), .z(clamp_a[7]));
xo02d1h xora8 (.a1(cc_aff), .a2(pca[8]), .z(clamp_a[8]));

an02d1h an0p0 (.a1(cvg[0]), .a2(clamp_a[0]), .z(p0p[0]));
an02d1h an0p1 (.a1(cvg[0]), .a2(clamp_a[1]), .z(p0p[1]));
an02d1h an0p2 (.a1(cvg[0]), .a2(clamp_a[2]), .z(p0p[2]));
an02d1h an0p3 (.a1(cvg[0]), .a2(clamp_a[3]), .z(p0p[3]));
an02d1h an0p4 (.a1(cvg[0]), .a2(clamp_a[4]), .z(p0p[4]));
an02d1h an0p5 (.a1(cvg[0]), .a2(clamp_a[5]), .z(p0p[5]));
an02d1h an0p6 (.a1(cvg[0]), .a2(clamp_a[6]), .z(p0p[6]));
an02d1h an0p7 (.a1(cvg[0]), .a2(clamp_a[7]), .z(p0p[7]));

an02d1h an1p0 (.a1(cvg[1]), .a2(clamp_a[0]), .z(p1p[0]));
an02d1h an1p1 (.a1(cvg[1]), .a2(clamp_a[1]), .z(p1p[1]));
an02d1h an1p2 (.a1(cvg[1]), .a2(clamp_a[2]), .z(p1p[2]));
an02d1h an1p3 (.a1(cvg[1]), .a2(clamp_a[3]), .z(p1p[3]));
an02d1h an1p4 (.a1(cvg[1]), .a2(clamp_a[4]), .z(p1p[4]));
an02d1h an1p5 (.a1(cvg[1]), .a2(clamp_a[5]), .z(p1p[5]));
an02d1h an1p6 (.a1(cvg[1]), .a2(clamp_a[6]), .z(p1p[6]));
an02d1h an1p7 (.a1(cvg[1]), .a2(clamp_a[7]), .z(p1p[7]));

an02d1h an2p0 (.a1(cvg[2]), .a2(clamp_a[0]), .z(p2p[0]));
an02d1h an2p1 (.a1(cvg[2]), .a2(clamp_a[1]), .z(p2p[1]));
an02d1h an2p2 (.a1(cvg[2]), .a2(clamp_a[2]), .z(p2p[2]));
an02d1h an2p3 (.a1(cvg[2]), .a2(clamp_a[3]), .z(p2p[3]));
an02d1h an2p4 (.a1(cvg[2]), .a2(clamp_a[4]), .z(p2p[4]));
an02d1h an2p5 (.a1(cvg[2]), .a2(clamp_a[5]), .z(p2p[5]));
an02d1h an2p6 (.a1(cvg[2]), .a2(clamp_a[6]), .z(p2p[6]));
an02d1h an2p7 (.a1(cvg[2]), .a2(clamp_a[7]), .z(p2p[7]));

ad01d1h sa0 (.ci(p0p[1]),  .b(p1p[0]),  .a(1'b1  ), .s(sa[0]), .co(ca[0]));
ad01d1h sa1 (.ci(p0p[2]),  .b(p1p[1]),  .a(p2p[0]), .s(sa[1]), .co(ca[1]));
ad01d1h sa2 (.ci(p0p[3]),  .b(p1p[2]),  .a(p2p[1]), .s(sa[2]), .co(ca[2]));
ad01d1h sa3 (.ci(p0p[4]),  .b(p1p[3]),  .a(p2p[2]), .s(sa[3]), .co(ca[3]));
ad01d1h sa4 (.ci(p0p[5]),  .b(p1p[4]),  .a(p2p[3]), .s(sa[4]), .co(ca[4]));
ad01d1h sa5 (.ci(p0p[6]),  .b(p1p[5]),  .a(p2p[4]), .s(sa[5]), .co(ca[5]));
ad01d1h sa6 (.ci(p0p[7]),  .b(p1p[6]),  .a(p2p[5]), .s(sa[6]), .co(ca[6]));
xo02d1h sa7 (             .a1(p1p[7]), .a2(p2p[6]), .z(sa[7]));
an02d1h ca7 (             .a1(p1p[7]), .a2(p2p[6]),             .z(ca[7]));

ad01d1h mp0 (.ci(sa[0]), .b(sa[1]),  .a(ca[0]),            .co(cc[0]));
ad01d1h mp1 (.ci(cc[0]), .b(sa[2]),  .a(ca[1]), .s(mp[0]), .co(cc[1]));
ad01d1h mp2 (.ci(cc[1]), .b(sa[3]),  .a(ca[2]), .s(mp[1]), .co(cc[2]));
ad01d1h mp3 (.ci(cc[2]), .b(sa[4]),  .a(ca[3]), .s(mp[2]), .co(cc[3]));
ad01d1h mp4 (.ci(cc[3]), .b(sa[5]),  .a(ca[4]), .s(mp[3]), .co(cc[4]));
ad01d1h mp5 (.ci(cc[4]), .b(sa[6]),  .a(ca[5]), .s(mp[4]), .co(cc[5]));
ad01d1h mp6 (.ci(cc[5]), .b(sa[7]),  .a(ca[6]), .s(mp[5]), .co(cc[6]));
ad01d1h mp7 (.ci(cc[6]), .b(p2p[7]), .a(ca[7]), .s(mp[6]), .co(mp[7]));

ni01d4  ni2 (.i(cvg[3]), .z(cvg_3b));

mx21d1h mx0 (.s(cvg_3b), .i0(mp[0]), .i1(clamp_a[0]), .z(mx[0]));
mx21d1h mx1 (.s(cvg_3b), .i0(mp[1]), .i1(clamp_a[1]), .z(mx[1]));
mx21d1h mx2 (.s(cvg_3b), .i0(mp[2]), .i1(clamp_a[2]), .z(mx[2]));
mx21d1h mx3 (.s(cvg_3b), .i0(mp[3]), .i1(clamp_a[3]), .z(mx[3]));
mx21d1h mx4 (.s(cvg_3b), .i0(mp[4]), .i1(clamp_a[4]), .z(mx[4]));
mx21d1h mx5 (.s(cvg_3b), .i0(mp[5]), .i1(clamp_a[5]), .z(mx[5]));
mx21d1h mx6 (.s(cvg_3b), .i0(mp[6]), .i1(clamp_a[6]), .z(mx[6]));
mx21d1h mx7 (.s(cvg_3b), .i0(mp[7]), .i1(clamp_a[7]), .z(mx[7]));
mx21d1h mx8 (.s(cvg_3b), .i0(1'b0),  .i1(clamp_a[8]), .z(mx[8]));

fn01d2  fn1 (.a1(clamp_a[8]), .b1(cvg_times_alpha), .zn(pctan));
ni01d4  ni1 (.i(pctan), .z(ctan));

mx21d1h al0 (.s(ctan), .i0(mx[0]), .i1(1'b0),   .z(alpha_cvg[0]));
mx21d1h al1 (.s(ctan), .i0(mx[1]), .i1(1'b0),   .z(alpha_cvg[1]));
mx21d1h al2 (.s(ctan), .i0(mx[2]), .i1(1'b0),   .z(alpha_cvg[2]));
mx21d1h al3 (.s(ctan), .i0(mx[3]), .i1(1'b0),   .z(alpha_cvg[3]));
mx21d1h al4 (.s(ctan), .i0(mx[4]), .i1(1'b0),   .z(alpha_cvg[4]));
mx21d1h al5 (.s(ctan), .i0(mx[5]), .i1(cvg[0]), .z(alpha_cvg[5]));
mx21d1h al6 (.s(ctan), .i0(mx[6]), .i1(cvg[1]), .z(alpha_cvg[6]));
mx21d1h al7 (.s(ctan), .i0(mx[7]), .i1(cvg[2]), .z(alpha_cvg[7]));
mx21d1h al8 (.s(ctan), .i0(mx[8]), .i1(cvg[3]), .z(alpha_cvg[8]));

ni01d4  ni3 (.i(alpha_cvg[8]), .z(alpha_c8b));

or02d2  or0 (.a1(alpha_c8b), .a2(alpha_cvg[0]), .z(cvg_alpha[0]));
or02d2  or1 (.a1(alpha_c8b), .a2(alpha_cvg[1]), .z(cvg_alpha[1]));
or02d2  or2 (.a1(alpha_c8b), .a2(alpha_cvg[2]), .z(cvg_alpha[2]));
or02d2  or3 (.a1(alpha_c8b), .a2(alpha_cvg[3]), .z(cvg_alpha[3]));
or02d2  or4 (.a1(alpha_c8b), .a2(alpha_cvg[4]), .z(cvg_alpha[4]));
or02d2  or5 (.a1(alpha_c8b), .a2(alpha_cvg[5]), .z(cvg_alpha[5]));
or02d2  or6 (.a1(alpha_c8b), .a2(alpha_cvg[6]), .z(cvg_alpha[6]));
or02d2  or7 (.a1(alpha_c8b), .a2(alpha_cvg[7]), .z(cvg_alpha[7]));

assign cvg_alpha[8] = 1'b0;

endmodule // cc_cvg_alpha