tf_lerp_booth.v
1.9 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
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: tf_lerp_booth
// description: Pseudo-Booth encoder for bilerp for texture filter unit.
// Generates 9 partial products. Two of these feed the CSA
// for lerp subtract/multiply. This effectively does the
// subtract without propagating the carries. The negative
// input is first 1's complemented, then the two inputs are
// considered bitwise. If none is set, mask out the multiply
// input. If one bit is set, pass the mpy input as a partial
// product. If both bits are set, shift up one bit.
// This implements the sign extended interpretation of the
// subtract inputs. The 9 bit inputs are sign extended before
// the subtract, and all 10 bits of result are used in the
// multiply by the other 9 bit input.
//
// designer: Phil Gossett
// date: 6/18/94
//
////////////////////////////////////////////////////////////////////////
module tf_lerp_booth (x, y, a, p0p, p1p, p2p, p3p, p4p, p5p, p6p, p7p, p8p);
input [8:0] x;
input [8:0] y;
input [8:0] a;
output [9:0] p0p; // pseudo-booth encoded partial products
output [9:0] p1p;
output [9:0] p2p;
output [9:0] p3p;
output [9:0] p4p;
output [9:0] p5p;
output [9:0] p6p;
output [9:0] p7p;
output [8:0] p8p;
tf_lerp_booth0 booth0 (.x(x[0]), .y(y[0]), .a(a[8:0]), .p(p0p[9:0]));
tf_lerp_booth0 booth1 (.x(x[1]), .y(y[1]), .a(a[8:0]), .p(p1p[9:0]));
tf_lerp_booth0 booth2 (.x(x[2]), .y(y[2]), .a(a[8:0]), .p(p2p[9:0]));
tf_lerp_booth0 booth3 (.x(x[3]), .y(y[3]), .a(a[8:0]), .p(p3p[9:0]));
tf_lerp_booth0 booth4 (.x(x[4]), .y(y[4]), .a(a[8:0]), .p(p4p[9:0]));
tf_lerp_booth0 booth5 (.x(x[5]), .y(y[5]), .a(a[8:0]), .p(p5p[9:0]));
tf_lerp_booth0 booth6 (.x(x[6]), .y(y[6]), .a(a[8:0]), .p(p6p[9:0]));
tf_lerp_booth0 booth7 (.x(x[7]), .y(y[7]), .a(a[8:0]), .p(p7p[9:0]));
tf_lerp_booth8 booth8 (.x(x[8]), .y(y[8]), .a(a[8:0]), .p(p8p[8:0]));
endmodule // tf_lerp_booth