00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.accellera.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 scfx_pow10.h - 00021 00022 Original Author: Robert Graulich, Synopsys, Inc. 00023 Martin Janssen, Synopsys, Inc. 00024 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 00029 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00030 changes you are making here. 00031 00032 Name, Affiliation, Date: 00033 Description of Modification: 00034 00035 *****************************************************************************/ 00036 00037 // $Log: scfx_pow10.h,v $ 00038 // Revision 1.1.1.1 2006/12/15 20:20:04 acg 00039 // SystemC 2.3 00040 // 00041 // Revision 1.3 2006/01/13 18:53:58 acg 00042 // Andy Goodrich: added $Log command so that CVS comments are reproduced in 00043 // the source. 00044 // 00045 00046 #ifndef SCFX_POW10_H 00047 #define SCFX_POW10_H 00048 00049 00050 #include "sysc/datatypes/fx/scfx_rep.h" 00051 00052 00053 namespace sc_dt 00054 { 00055 00056 // classes defined in this module 00057 class scfx_pow10; 00058 00059 00060 // ---------------------------------------------------------------------------- 00061 // CLASS : scfx_pow10 00062 // 00063 // Class to compute (and cache) powers of 10 in arbitrary precision. 00064 // ---------------------------------------------------------------------------- 00065 00066 const int SCFX_POW10_TABLE_SIZE = 32; 00067 00068 00069 class scfx_pow10 00070 { 00071 00072 public: 00073 00074 scfx_pow10(); 00075 ~scfx_pow10(); 00076 00077 const scfx_rep operator() ( int ); 00078 00079 private: 00080 00081 scfx_rep* pos( int ); 00082 scfx_rep* neg( int ); 00083 00084 scfx_rep m_pos[SCFX_POW10_TABLE_SIZE]; 00085 scfx_rep m_neg[SCFX_POW10_TABLE_SIZE]; 00086 }; 00087 00088 } // namespace sc_dt 00089 00090 00091 #endif 00092 00093 // Taf!