strgbaoffset.v 1.59 KB
/**************************************************************************
 *                                                                        *
 *               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