cc_edge_booth2.v
1.15 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
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: cc_edge_booth2
// description: Pseudo-Booth encoder for texture edge
// for color combine unit.
//
// designer: Phil Gossett
// date: 9/16/94
//
////////////////////////////////////////////////////////////////////////
module cc_edge_booth2 (max1, x, y, a, p, c);
input max1;
input x;
input y;
input [3:0] a;
wire [3:0] pp;
output [3:0] p; // pseudo-booth encoded partial product
output c;
in01d2 mux2ma (.zn(max1_l), .i(max1));
in01d4 mux2sa (.zn(msel), .i(x)); // msel = !x
xo02d1h mux2sb (.z(mpen), .a1(x), .a2(y));
an02d1h mux2e0 (.z(menb), .a1(mpen), .a2(max1_l)); // menb = x ^ y
xo02d1h mux2b0 (.a1(msel), .a2(a[0]), .z(pp[0]));
xo02d1h mux2b1 (.a1(msel), .a2(a[1]), .z(pp[1]));
xo02d1h mux2b2 (.a1(msel), .a2(a[2]), .z(pp[2]));
xo02d1h mux2b3 (.a1(msel), .a2(a[3]), .z(pp[3]));
an02d1h and2b0 (.a1(menb), .a2(pp[0]), .z(p[0]));
an02d1h and2b1 (.a1(menb), .a2(pp[1]), .z(p[1]));
an02d1h and2b2 (.a1(menb), .a2(pp[2]), .z(p[2]));
an02d1h and2b3 (.a1(menb), .a2(pp[3]), .z(p[3]));
an02d1h and2bc (.a1(menb), .a2(msel), .z(c));
endmodule // cc_edge_booth2