/******************************************************************************/
/* */
/* 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: @(#)fpm_round.v
***
****************************************************************************
****************************************************************************/
// @(#)fpm_round.v 1.1 4/9/92
//
// **************************************************************
// fpm_round -- generates correct round value for overflow or
// non-overflow case.
// **************************************************************
module fpm_round
(
rnd_n,
rnd_v,
lsb,
g,
r,
s,
sign,
mode
);
output rnd_n
, rnd_v
;
input lsb
, g
, r
, s
, sign
;
input [1:0] mode
;
reg rnd_n, rnd_v;
ME_TIEOFF t1 (, LOW
) ;
always @(lsb or g or r or s or sign or mode)
case (mode) // synopsys parallel_case full_case
2'b00: // nearest
begin
rnd_n = (r & ~s & g) | (r & s) ;
rnd_v = (g & ~(r|s) & lsb) | (g & (r|s)) ;
end
2'b01: // zero
begin
rnd_n = LOW;
rnd_v = LOW;
end
2'b10: // +infinity
begin
rnd_n = (r | s) & ~sign ;
rnd_v = (g | r | s) & ~sign ;
end
2'b11: // -infinity
begin
rnd_n = (r | s) & sign ;
rnd_v = (g | r | s) & sign ;
end
// synopsys translate_off
default:
begin
rnd_n = 'bx;
rnd_v = 'bx;
end
// synopsys translate_on
endcase
endmodule
| This page: |
Created: | Thu Aug 19 12:02:36 1999 |
| From: |
../../../sparc_v8/ssparc/fpu/fp_fpm/rtl/fpm_round.v
|