bl_deltaz_quant.v 3.48 KB
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module:	bl_deltaz_quant
// description:	Quantize to next higher power of two for blend,
//
// designer:	Phil Gossett
// date:	8/24/94
//
////////////////////////////////////////////////////////////////////////

module bl_deltaz_quant(i, z);

input [15:0] i;

wire [15:0] i1i;
wire [15:0] i2i;
wire [15:0] i3i;

output [15:0] z;

or02d2  quorl (.a1(i[15]), .a2(i[14]),  .z(qorl));
nr02d2  quork (.a1(i[ 1]), .a2(i[ 2]), .zn(qork));
nr02d2  quorj (.a1(i[ 3]), .a2(i[ 4]), .zn(qorj));
nr02d2  quori (.a1(i[ 5]), .a2(i[ 6]), .zn(qori));
nr02d2  quorh (.a1(i[ 7]), .a2(i[ 8]), .zn(qorh));
nr02d2  quorg (.a1(i[ 9]), .a2(i[10]), .zn(qorg));
nr02d2  quorf (.a1(i[11]), .a2(i[12]), .zn(qorf));
nr02d2  quore (.a1(i[13]), .a2( qorl), .zn(qore));
an02d1h quord (.a1( qori), .a2( qorj),  .z(qord));
an02d1h quorc (.a1( qorg), .a2( qorh),  .z(qorc));
an02d1h quorb (.a1( qore), .a2( qorf),  .z(qorb));
an02d1h quora (.a1( qorb), .a2( qorc),  .z(qora));

assign  i1i[15] = qorl;
fn05d2  and1e (.a1(i[13]), .b1( qorl), .zn(i1i[14]));
assign  i1i[13] = i[12];
fn05d2  and1c (.a1(i[11]), .b1(i[12]), .zn(i1i[12]));
assign  i1i[11] = i[10];
fn05d2  and1a (.a1(i[ 9]), .b1(i[10]), .zn(i1i[10]));
assign  i1i[ 9] = i[ 8];
fn05d2  and18 (.a1(i[ 7]), .b1(i[ 8]), .zn(i1i[ 8]));
assign  i1i[ 7] = i[ 6];
fn05d2  and16 (.a1(i[ 5]), .b1(i[ 6]), .zn(i1i[ 6]));
assign  i1i[ 5] = i[ 4];
fn05d2  and14 (.a1(i[ 3]), .b1(i[ 4]), .zn(i1i[ 4]));
assign  i1i[ 3] = i[ 2];
fn05d2  and12 (.a1(i[ 1]), .b1(i[ 2]), .zn(i1i[ 2]));
assign  i1i[ 1] = i[ 0];
assign  i1i[ 0] = i[ 0];

assign  i2i[15] = i1i[15];
assign  i2i[14] = i1i[14];
an02d1h and2d (.a1(i1i[13]), .a2(qore), .z(i2i[13]));
an02d1h and2c (.a1(i1i[12]), .a2(qore), .z(i2i[12]));
assign  i2i[11] = i1i[11];
assign  i2i[10] = i1i[10];
an02d1h and29 (.a1(i1i[ 9]), .a2(qorg), .z(i2i[ 9]));
an02d1h and28 (.a1(i1i[ 8]), .a2(qorg), .z(i2i[ 8]));
assign  i2i[ 7] = i1i[ 7];
assign  i2i[ 6] = i1i[ 6];
an02d1h and25 (.a1(i1i[ 5]), .a2(qori), .z(i2i[ 5]));
an02d1h and24 (.a1(i1i[ 4]), .a2(qori), .z(i2i[ 4]));
assign  i2i[ 3] = i1i[ 3];
assign  i2i[ 2] = i1i[ 2];
an02d1h and21 (.a1(i1i[ 1]), .a2(qork), .z(i2i[ 1]));
assign  i2i[ 0] = qork;

assign  i3i[15] = i2i[15];
assign  i3i[14] = i2i[14];
assign  i3i[13] = i2i[13];
assign  i3i[12] = i2i[12];
an02d1h and3b (.a1(i2i[11]), .a2(qorb), .z(i3i[11]));
an02d1h and3a (.a1(i2i[10]), .a2(qorb), .z(i3i[10]));
an02d1h and39 (.a1(i2i[ 9]), .a2(qorb), .z(i3i[ 9]));
an02d1h and38 (.a1(i2i[ 8]), .a2(qorb), .z(i3i[ 8]));
assign  i3i[ 7] = i2i[ 7];
assign  i3i[ 6] = i2i[ 6];
assign  i3i[ 5] = i2i[ 5];
assign  i3i[ 4] = i2i[ 4];
an02d1h and33 (.a1(i2i[ 3]), .a2(qord), .z(i3i[ 3]));
an02d1h and32 (.a1(i2i[ 2]), .a2(qord), .z(i3i[ 2]));
an02d1h and31 (.a1(i2i[ 1]), .a2(qord), .z(i3i[ 1]));
an02d1h and30 (.a1(i2i[ 0]), .a2(qord), .z(i3i[ 0]));

assign  z[15] = i3i[15];
assign  z[14] = i3i[14];
assign  z[13] = i3i[13];
assign  z[12] = i3i[12];
assign  z[11] = i3i[11];
assign  z[10] = i3i[10];
assign  z[ 9] = i3i[ 9];
assign  z[ 8] = i3i[ 8];
an02d1h and47 (.a1(i3i[ 7]), .a2(qora), .z(z[ 7]));
an02d1h and46 (.a1(i3i[ 6]), .a2(qora), .z(z[ 6]));
an02d1h and45 (.a1(i3i[ 5]), .a2(qora), .z(z[ 5]));
an02d1h and44 (.a1(i3i[ 4]), .a2(qora), .z(z[ 4]));
an02d1h and43 (.a1(i3i[ 3]), .a2(qora), .z(z[ 3]));
an02d1h and42 (.a1(i3i[ 2]), .a2(qora), .z(z[ 2]));
an02d1h and41 (.a1(i3i[ 1]), .a2(qora), .z(z[ 1]));
an02d1h and40 (.a1(i3i[ 0]), .a2(qora), .z(z[ 0]));

endmodule // bl_deltaz_quant