HierarchyFilesModulesSignalsTasksFunctionsHelp

/******************************************************************************/ 
/*                                                                            */ 
/* Copyright (c) 1999 Sun Microsystems, Inc. All rights reserved.             */ 
/*                                                                            */ 
/* The contents of this file are subject to the current version of the Sun    */ 
/* Community Source License, microSPARCII ("the License"). You may not use    */ 
/* this file except in compliance with the License.  You may obtain a copy    */ 
/* of the License by searching for "Sun Community Source License" on the      */ 
/* World Wide Web at http://www.sun.com. See the License for the rights,      */ 
/* obligations, and limitations governing use of the contents of this file.   */ 
/*                                                                            */ 
/* Sun Microsystems, Inc. has intellectual property rights relating to the    */ 
/* technology embodied in these files. In particular, and without limitation, */ 
/* these intellectual property rights may include one or more U.S. patents,   */ 
/* foreign patents, or pending applications.                                  */ 
/*                                                                            */ 
/* Sun, Sun Microsystems, the Sun logo, all Sun-based trademarks and logos,   */ 
/* Solaris, Java and all Java-based trademarks and logos are trademarks or    */ 
/* registered trademarks of Sun Microsystems, Inc. in the United States and   */ 
/* other countries. microSPARC is a trademark or registered trademark of      */ 
/* SPARC International, Inc. All SPARC trademarks are used under license and  */ 
/* are trademarks or registered trademarks of SPARC International, Inc. in    */ 
/* the United States and other countries. Products bearing SPARC trademarks   */ 
/* are based upon an architecture developed by Sun Microsystems, Inc.         */ 
/*                                                                            */ 
/******************************************************************************/ 
/***************************************************************************
****************************************************************************
***
***  Program File:  @(#)expconstadd.v
***
****************************************************************************
****************************************************************************/

//  @(#)expconstadd.v	1.1  4/11/92
//
// **************************************************************
//  expconstadd -- carry-save add of a constant, a+b+C, where C is
//  either 2's complement 127 (single), 2's complement 1023 (double),
//  or 769 (fsmuld).
//  It uses 5-bits of carry save adders, and 6-bits of half-adders.
//
// **************************************************************

[Up: fpm_exp cnstAdd]
module expconstadd(sum,
		   cout,
		   a,
		   b,
		   fpm_inst
		   );

    output [12:0] sum;
    output [12:0] cout;
    input  [10:0] a, b;
    input  [1:0]  fpm_inst;	// FMULs=00, FMULd=01, FsMULd=10

    ME_TIEOFF t1 (VDD, GND);

				// 2's complement  127 = 13'b1111110000001
				// 2's complement 1023 = 13'b1110000000001
				//		   769 = 13'b0001100000001
    wire c12_10 = ~fpm_inst[1] ;
    wire c9_8   = ~fpm_inst[0] ;
    wire c7     = ~(fpm_inst[0] | fpm_inst[1]) ;

    add2       a0  ( sum[ 0], cout[ 1], a[ 0], b[ 0], VDD );
    half_adder a1  ( sum[ 1], cout[ 2], a[ 1], b[ 1] );
    half_adder a2  ( sum[ 2], cout[ 3], a[ 2], b[ 2] );
    half_adder a3  ( sum[ 3], cout[ 4], a[ 3], b[ 3] );
    half_adder a4  ( sum[ 4], cout[ 5], a[ 4], b[ 4] );
    half_adder a5  ( sum[ 5], cout[ 6], a[ 5], b[ 5] );
    half_adder a6  ( sum[ 6], cout[ 7], a[ 6], b[ 6] );
    add2       a7  ( sum[ 7], cout[ 8], a[ 7], b[ 7], c7 );
    add2       a8  ( sum[ 8], cout[ 9], a[ 8], b[ 8], c9_8 );
    add2       a9  ( sum[ 9], cout[10], a[ 9], b[ 9], c9_8 );
    add2       a10 ( sum[10], cout[11], a[10], b[10], c12_10 );

    assign sum[12:11] = {c12_10, c12_10} ;
    assign cout[12]   = GND ;
    assign cout[ 0]   = GND ;

endmodule
HierarchyFilesModulesSignalsTasksFunctionsHelp

This page: Created:Thu Aug 19 12:03:30 1999
From: ../../../sparc_v8/ssparc/fpu/fp_fpm/rtl/expconstadd.v

Verilog converted to html by v2html 5.0 (written by Costas Calamvokis).Help