vi_lerp_booth0.v
1.3 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: vi_lerp_booth0
// description: Pseudo-Booth encoder for lerp for video interface.
//
// designer: Phil Gossett
// date: 10/23/94
//
////////////////////////////////////////////////////////////////////////
// $Id: vi_lerp_booth0.v,v 1.1 2002/03/28 00:26:14 berndt Exp $
module vi_lerp_booth0 (x, y, a, p);
input x;
input y;
input [4:0] a;
wire [5:0] pp;
output [5:0] p; // pseudo-booth encoded partial product
fn05d2 mux0s0 (.zn(msel), .a1(x), .b1(y)); // msel = x && !y
fn01d2 mux0e0 (.zn(menb), .a1(x), .b1(y)); // menb = x || !y
mx21d1 mux0b0 (.s(msel), .i0(a[0]), .i1(1'b0), .z(pp[0]));
mx21d1 mux0b1 (.s(msel), .i0(a[1]), .i1(a[0]), .z(pp[1]));
mx21d1 mux0b2 (.s(msel), .i0(a[2]), .i1(a[1]), .z(pp[2]));
mx21d1 mux0b3 (.s(msel), .i0(a[3]), .i1(a[2]), .z(pp[3]));
mx21d1 mux0b4 (.s(msel), .i0(a[4]), .i1(a[3]), .z(pp[4]));
mx21d1 mux0b5 (.s(msel), .i0(1'b0), .i1(a[4]), .z(pp[5]));
an02d1 and0b0 (.a1(menb), .a2(pp[0]), .z(p[0]));
an02d1 and0b1 (.a1(menb), .a2(pp[1]), .z(p[1]));
an02d1 and0b2 (.a1(menb), .a2(pp[2]), .z(p[2]));
an02d1 and0b3 (.a1(menb), .a2(pp[3]), .z(p[3]));
an02d1 and0b4 (.a1(menb), .a2(pp[4]), .z(p[4]));
an02d1 and0b5 (.a1(menb), .a2(pp[5]), .z(p[5]));
endmodule // vi_lerp_booth0