bl_enc.v
3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: bl_enc
// description: Floating point encode for blend unit.
//
// designer: Phil Gossett
// date: 8/14/94
//
////////////////////////////////////////////////////////////////////////
module bl_enc (i, z);
input [17:0] i;
output [13:0] z;
wire [6:0] qc;
wire [7:0] qz;
assign qc[6] = i[17];
an02d1h and5 (.a1(qc[6]), .a2(i[16]), .z(qc[5]));
an02d1h and4 (.a1(qc[5]), .a2(i[15]), .z(qc[4]));
an02d1h and3 (.a1(qc[4]), .a2(i[14]), .z(qc[3]));
an02d1h and2 (.a1(qc[3]), .a2(i[13]), .z(qc[2]));
an02d1h and1 (.a1(qc[2]), .a2(i[12]), .z(qc[1]));
an02d1h and0 (.a1(qc[1]), .a2(i[11]), .z(qc[0]));
in01d2 qua7 ( .i(qc[6]), .zn(qz[7]));
fn05d2 qua6 (.a1(qc[6]), .b1(qc[5]), .zn(qz[6]));
fn05d2 qua5 (.a1(qc[5]), .b1(qc[4]), .zn(qz[5]));
fn05d2 qua4 (.a1(qc[4]), .b1(qc[3]), .zn(qz[4]));
fn05d2 qua3 (.a1(qc[3]), .b1(qc[2]), .zn(qz[3]));
fn05d2 qua2 (.a1(qc[2]), .b1(qc[1]), .zn(qz[2]));
fn05d2 qua1 (.a1(qc[1]), .b1(qc[0]), .zn(qz[1]));
assign qz[0] = qc[0];
or04d2 or0 (.a1(qz[0]), .a2(qz[2]), .a3(qz[4]), .a4(qz[6]), .z(z[11]));
or04d2 or1 (.a1(qz[0]), .a2(qz[1]), .a3(qz[4]), .a4(qz[5]), .z(z[12]));
or04d2 or2 (.a1(qz[0]), .a2(qz[1]), .a3(qz[2]), .a4(qz[3]), .z(z[13]));
mx81d1h mx00 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[ 6]), .i1(i[ 5]), .i2(i[ 4]), .i3(i[ 3]),
.i4(i[ 2]), .i5(i[ 1]), .i6(i[ 0]), .i7(i[ 0]),
.z(z[ 0]));
mx81d1h mx01 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[ 7]), .i1(i[ 6]), .i2(i[ 5]), .i3(i[ 4]),
.i4(i[ 3]), .i5(i[ 2]), .i6(i[ 1]), .i7(i[ 1]),
.z(z[ 1]));
mx81d1h mx02 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[ 8]), .i1(i[ 7]), .i2(i[ 6]), .i3(i[ 5]),
.i4(i[ 4]), .i5(i[ 3]), .i6(i[ 2]), .i7(i[ 2]),
.z(z[ 2]));
mx81d1h mx03 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[ 9]), .i1(i[ 8]), .i2(i[ 7]), .i3(i[ 6]),
.i4(i[ 5]), .i5(i[ 4]), .i6(i[ 3]), .i7(i[ 3]),
.z(z[ 3]));
mx81d1h mx04 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[10]), .i1(i[ 9]), .i2(i[ 8]), .i3(i[ 7]),
.i4(i[ 6]), .i5(i[ 5]), .i6(i[ 4]), .i7(i[ 4]),
.z(z[ 4]));
mx81d1h mx05 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[11]), .i1(i[10]), .i2(i[ 9]), .i3(i[ 8]),
.i4(i[ 7]), .i5(i[ 6]), .i6(i[ 5]), .i7(i[ 5]),
.z(z[ 5]));
mx81d1h mx06 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[12]), .i1(i[11]), .i2(i[10]), .i3(i[ 9]),
.i4(i[ 8]), .i5(i[ 7]), .i6(i[ 6]), .i7(i[ 6]),
.z(z[ 6]));
mx81d1h mx07 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[13]), .i1(i[12]), .i2(i[11]), .i3(i[10]),
.i4(i[ 9]), .i5(i[ 8]), .i6(i[ 7]), .i7(i[ 7]),
.z(z[ 7]));
mx81d1h mx08 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[14]), .i1(i[13]), .i2(i[12]), .i3(i[11]),
.i4(i[10]), .i5(i[ 9]), .i6(i[ 8]), .i7(i[ 8]),
.z(z[ 8]));
mx81d1h mx09 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[15]), .i1(i[14]), .i2(i[13]), .i3(i[12]),
.i4(i[11]), .i5(i[10]), .i6(i[ 9]), .i7(i[ 9]),
.z(z[ 9]));
mx81d1h mx10 (.s0(z[11]), .s1(z[12]), .s2(z[13]),
.i0(i[16]), .i1(i[15]), .i2(i[14]), .i3(i[13]),
.i4(i[12]), .i5(i[11]), .i6(i[10]), .i7(i[10]),
.z(z[10]));
endmodule // bl_enc