vi_lerp.v
2.03 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
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
// $Id: vi_lerp.v,v 1.1.1.1 2002/05/17 06:07:49 blythe Exp $
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: vi_lerp
// description: Resampling lerp for video interface.
//
// designer: Phil Gossett
// date: 11/30/94
//
////////////////////////////////////////////////////////////////////////
module vi_lerp (vclk, frac, rgb_a, rgb_b, sync_b, lerp_rgb, lerp_sync);
input vclk;
input [4:0] frac;
input [7:0] rgb_a;
input [7:0] rgb_b;
input sync_b;
output [7:0] lerp_rgb;
output lerp_sync;
wire [7:0] csa;
wire [5:0] p0p; // pseudo-booth encoded partial products
wire [5:0] p1p;
wire [5:0] p2p;
wire [5:0] p3p;
wire [5:0] p4p;
wire [5:0] p5p;
wire [5:0] p6p;
wire [5:0] p7p;
reg [7:0] lerp_rgb;
reg lerp_sync;
vi_lerp_booth vlbooth (.x(rgb_b), .y(rgb_a), .a(frac),
.p0p(p0p), .p1p(p1p), .p2p(p2p), .p3p(p3p),
.p4p(p4p), .p5p(p5p), .p6p(p6p), .p7p(p7p));
vi_lerp_csa vlcsa (.a(frac),
.p0p(p0p), .p1p(p1p), .p2p(p2p), .p3p(p3p),
.p4p(p4p), .p5p(p5p), .p6p(p6p), .p7p(p7p),
.c(rgb_a), .mp(csa));
always @(posedge vclk)
begin
lerp_rgb <= sync_b ? {(rgb_a[7] || rgb_b[7]), rgb_b[6:0]} :
((frac == 0) ? rgb_a : csa);
lerp_sync <= sync_b;
end
endmodule // vi_lerp