strgbaoffset.v
1.59 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
/**************************************************************************
* *
* 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. *
* *
*************************************************************************/
/* Project Reality
MDP
Created by Mike M. Cai 5/24/94
*/
module strgbaoffset( att_data_out,
att_data_in, dx, x_offset,
dy, y_offset);
output [8:0] att_data_out; // 9 bits integer
input [11:0] att_data_in; // 10 bits integer, 2 bits fraction
input [12:0] dx, dy; // 10 bits integer, bits fraction
input [1:0] x_offset, y_offset; // 2 bits of fractions
wire [13:0] x_prod, y_prod; // 10 bits integer, 4 bits fraction
wire [11:0] sum; // 10 bits integer, 4 bits fraction
assign x_prod = {{2{dx[12]}},dx} * x_offset;
assign y_prod = {{2{dy[12]}},dy} * y_offset;
assign sum = att_data_in +
x_prod[13:2] +
y_prod[13:2];
assign att_data_out = sum[10:2];
endmodule // strgbaoffset