dp_incdec16.v 7.05 KB
// Module instances modified by /home/rws/workarea/rf/sw/bbplayer/tools/necprimfix 
//
//    16 instances of an02d1h changed to j_an02.
//    1 instance of ni01d5 changed to j_ni01.
//    32 instances of xo02d1 changed to j_xo02.
//

/*
*************************************************************************
*									*
*               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							*
*									*
*  module:	dp_incdec16.v						*
*  description:	16 bit incrementer/decrementer which is optimised	*
*		for minimum area therefore is implemented as a 		*
*		ripple carry.						*
*									*
*									*
*  designer:	Brian Ferguson						*
*  date:	3/21/95							*
*									*
*************************************************************************
*/

// $Id: dp_incdec16.v,v 1.2 2002/11/13 02:11:42 rws Exp $


module dp_incdec16 (
				input_data,
				decrement,
				carryin,
				output_data,
				carryout
		       ) ;

input	[15:0]	input_data ;
input	decrement ;
input	carryin ; 

output	[15:0]	output_data ;
output	carryout ; 


wire	decrement_buf ;		// zero input to register when high

wire	[15:0]	comp_input_data ;  // conditionally complemented input data for decrement function
wire	[15:0]	carry_bits ; 	   // carry out bits for whole incrementer/decrementer

	j_ni01	incdec_buf ( .i (decrement), .z (decrement_buf) ) ;


j_xo02 exor_comp_b0 (
			.a1		(input_data[0]),
			.a2		(decrement_buf),
			.z		(comp_input_data[0])
		    ) ;

j_xo02 exor_b0 (
			.a1		(input_data[0]),
			.a2		(carryin),
			.z		(output_data[0])
	       ) ;

j_an02 and_b0 (
			.a1		(comp_input_data[0]),
			.a2		(carryin),
			.z		(carry_bits[0])
	       ) ;


j_xo02 exor_comp_b1 (
			.a1		(input_data[1]),
			.a2		(decrement_buf),
			.z		(comp_input_data[1])
		    ) ;

j_xo02 exor_b1 (
			.a1		(input_data[1]),
			.a2		(carry_bits[0]),
			.z		(output_data[1])
	       ) ;

j_an02 and_b1 (
			.a1		(comp_input_data[1]),
			.a2		(carry_bits[0]),
			.z		(carry_bits[1])
	       ) ;


j_xo02 exor_comp_b2 (
			.a1		(input_data[2]),
			.a2		(decrement_buf),
			.z		(comp_input_data[2])
		    ) ;

j_xo02 exor_b2 (
			.a1		(input_data[2]),
			.a2		(carry_bits[1]),
			.z		(output_data[2])
	       ) ;

j_an02 and_b2 (
			.a1		(comp_input_data[2]),
			.a2		(carry_bits[1]),
			.z		(carry_bits[2])
	       ) ;


j_xo02 exor_comp_b3 (
			.a1		(input_data[3]),
			.a2		(decrement_buf),
			.z		(comp_input_data[3])
		    ) ;

j_xo02 exor_b3 (
			.a1		(input_data[3]),
			.a2		(carry_bits[2]),
			.z		(output_data[3])
	       ) ;

j_an02 and_b3 (
			.a1		(comp_input_data[3]),
			.a2		(carry_bits[2]),
			.z		(carry_bits[3])
	       ) ;


j_xo02 exor_comp_b4 (
			.a1		(input_data[4]),
			.a2		(decrement_buf),
			.z		(comp_input_data[4])
		    ) ;

j_xo02 exor_b4 (
			.a1		(input_data[4]),
			.a2		(carry_bits[3]),
			.z		(output_data[4])
	       ) ;

j_an02 and_b4 (
			.a1		(comp_input_data[4]),
			.a2		(carry_bits[3]),
			.z		(carry_bits[4])
	       ) ;


j_xo02 exor_comp_b5 (
			.a1		(input_data[5]),
			.a2		(decrement_buf),
			.z		(comp_input_data[5])
		    ) ;

j_xo02 exor_b5 (
			.a1		(input_data[5]),
			.a2		(carry_bits[4]),
			.z		(output_data[5])
	       ) ;

j_an02 and_b5 (
			.a1		(comp_input_data[5]),
			.a2		(carry_bits[4]),
			.z		(carry_bits[5])
	       ) ;


j_xo02 exor_comp_b6 (
			.a1		(input_data[6]),
			.a2		(decrement_buf),
			.z		(comp_input_data[6])
		    ) ;

j_xo02 exor_b6 (
			.a1		(input_data[6]),
			.a2		(carry_bits[5]),
			.z		(output_data[6])
	       ) ;

j_an02 and_b6 (
			.a1		(comp_input_data[6]),
			.a2		(carry_bits[5]),
			.z		(carry_bits[6])
	       ) ;


j_xo02 exor_comp_b7 (
			.a1		(input_data[7]),
			.a2		(decrement_buf),
			.z		(comp_input_data[7])
		    ) ;

j_xo02 exor_b7 (
			.a1		(input_data[7]),
			.a2		(carry_bits[6]),
			.z		(output_data[7])
	       ) ;

j_an02 and_b7 (
			.a1		(comp_input_data[7]),
			.a2		(carry_bits[6]),
			.z		(carry_bits[7])
	       ) ;


j_xo02 exor_comp_b8 (
			.a1		(input_data[8]),
			.a2		(decrement_buf),
			.z		(comp_input_data[8])
		    ) ;

j_xo02 exor_b8 (
			.a1		(input_data[8]),
			.a2		(carry_bits[7]),
			.z		(output_data[8])
	       ) ;

j_an02 and_b8 (
			.a1		(comp_input_data[8]),
			.a2		(carry_bits[7]),
			.z		(carry_bits[8])
	       ) ;


j_xo02 exor_comp_b9 (
			.a1		(input_data[9]),
			.a2		(decrement_buf),
			.z		(comp_input_data[9])
		    ) ;

j_xo02 exor_b9 (
			.a1		(input_data[9]),
			.a2		(carry_bits[8]),
			.z		(output_data[9])
	       ) ;

j_an02 and_b9 (
			.a1		(comp_input_data[9]),
			.a2		(carry_bits[8]),
			.z		(carry_bits[9])
	       ) ;


j_xo02 exor_comp_b10 (
			.a1		(input_data[10]),
			.a2		(decrement_buf),
			.z		(comp_input_data[10])
		     ) ;

j_xo02 exor_b10 (
			.a1		(input_data[10]),
			.a2		(carry_bits[9]),
			.z		(output_data[10])
	        ) ;

j_an02 and_b10 (
			.a1		(comp_input_data[10]),
			.a2		(carry_bits[9]),
			.z		(carry_bits[10])
	        ) ;

j_xo02 exor_comp_b11 (
			.a1		(input_data[11]),
			.a2		(decrement_buf),
			.z		(comp_input_data[11])
		     ) ;

j_xo02 exor_b11 (
			.a1		(input_data[11]),
			.a2		(carry_bits[10]),
			.z		(output_data[11])
	       ) ;

j_an02 and_b11 (
			.a1		(comp_input_data[11]),
			.a2		(carry_bits[10]),
			.z		(carry_bits[11])
	        ) ;

j_xo02 exor_comp_b12 (
			.a1		(input_data[12]),
			.a2		(decrement_buf),
			.z		(comp_input_data[12])
		     ) ;

j_xo02 exor_b12 (
			.a1		(input_data[12]),
			.a2		(carry_bits[11]),
			.z		(output_data[12])
	        ) ;

j_an02 and_b12 (
			.a1		(comp_input_data[12]),
			.a2		(carry_bits[11]),
			.z		(carry_bits[12])
	        ) ;

j_xo02 exor_comp_b13 (
			.a1		(input_data[13]),
			.a2		(decrement_buf),
			.z		(comp_input_data[13])
		     ) ;

j_xo02 exor_b13 (
			.a1		(input_data[13]),
			.a2		(carry_bits[12]),
			.z		(output_data[13])
	        ) ;

j_an02 and_b13 (
			.a1		(comp_input_data[13]),
			.a2		(carry_bits[12]),
			.z		(carry_bits[13])
	        ) ;


j_xo02 exor_comp_b14 (
			.a1		(input_data[14]),
			.a2		(decrement_buf),
			.z		(comp_input_data[14])
		     ) ;

j_xo02 exor_b14 (
			.a1		(input_data[14]),
			.a2		(carry_bits[13]),
			.z		(output_data[14])
	        ) ;

j_an02 and_b14 (
			.a1		(comp_input_data[14]),
			.a2		(carry_bits[13]),
			.z		(carry_bits[14])
	        ) ;


j_xo02 exor_comp_b15 (
			.a1		(input_data[15]),
			.a2		(decrement_buf),
			.z		(comp_input_data[15])
		     ) ;

j_xo02 exor_b15 (
			.a1		(input_data[15]),
			.a2		(carry_bits[14]),
			.z		(output_data[15])
	        ) ;

j_an02 and_b15 (
			.a1		(comp_input_data[15]),
			.a2		(carry_bits[14]),
			.z		(carry_bits[15])
	        ) ;

	assign carryout =	carry_bits[15] ;

endmodule  //  dp_incdec16