2 ##########################################################################
7 # IeeeCC754 or IEEE 754 Compliance Checker is a precision and range #
8 # independent tool to test whether an implementation of #
9 # floating-point arithmetic (in hardware or software) is compliant #
10 # with the principles of the IEEE 754-854 floating-point standards. #
11 # You can find out more about the testing tool IeeeCC754 at #
13 # http://win-www.uia.ac.be/u/cant/ieeecc754.html #
15 # This tool is in parts based on and greatly benefited from the #
16 # the program FPTEST developed by Jerome Coonen. For a full #
17 # description of the extensions to FPTEST and a reference to #
18 # the original Coonen program, please refer to the URL given above. #
19 # For the options available with the program IeeeCC754 and its #
20 # compatibility with David Hough's hexadecimal UCB format, we #
21 # also refer to the file readme.usage. #
23 # Usage: see readme.usage #
25 # Responsible authors: #
30 # Johan Bogo (1998-1999) #
31 # Tim Gevers (10-12/2000) #
32 # Debby Ooms (1996-1997) #
33 # Geert Vermuyten (1996-1997) #
34 # Dennis Verschaeren (09/1996-06/2000) #
36 # Copyright (C) 2000 University of Antwerp #
38 # This program can be obtained from the authors, free, but WITHOUT ANY #
39 # WARRANTY; without even the implied warranty of MERCHANTABILITY or #
40 # FITNESS FOR A PARTICULAR PURPOSE. #
43 # Brigitte.Verdonk@uia.ua.ac.be #
44 # Department of Mathematics and Computer Science #
45 # University of Antwerp (UIA) #
46 # Universiteitsplein 1 #
47 # B2610 Antwerp, BELGIUM #
49 ##########################################################################
59 /***************************************************************************
60 * This is a class definition for hexadecimal input of the bitstrings class.
61 * Hex is inherited from bitstring, so there are no data members necessery.
62 * The only thing that has to be done is to define the functions that change
64 ************************************************************************** */
70 #include <Bitstring.h>
75 This class manipulates the Bitstring class as a hexadecimal string of bits.
76 The only difference in the
77 hexadecimal representation is the length of the string, as it
78 is four times smaller than the binary representation.
80 All the members are defined in the class Bitstring, therefore there are no
81 extra data members in this class.
86 class Hex : public Bitstring
90 /** returns the binairy value of character v
91 @param v: character between 0-9 and A-F or a-F
92 @return: the binary value of v*/
95 /** returns the character value of the Bitstring b
96 @param b: binary value, from 0000-1111
97 @return: the character value of b*/
98 char GetHex(Bitstring& b) const;
102 /* * Constructor, creates empty Bitstring */ */
106 @param size: specifies the initial size of the bitstring.
107 The size is multiplied by 4 for a bistring.*/
108 Hex(unsigned long size);
110 /**Constructor, initiates the object with str
111 @param hstr: the hexadecimal number in a string-format */
115 @param copy a Bitstring object */
116 Hex(const Bitstring ©);
118 /* * Deconstructor */ */
122 /** Get the length of the bitstring
123 @return: the length of the bitstring divided by 4*/
124 unsigned long Length() const {return length/4;};
126 /** changes the length of the bitstring to \textit{len} *4.
127 If the new length is larger then before, the bitstring
128 is appended with 0, else the bitstring is truncated to
130 @param len the new length of the Bitstring
131 @return the previous length.
133 unsigned long Resize(unsigned long len);
135 /**converts the Bitstring to a C-string.
136 @return the converted Bitstring*/
137 void BitstrToString(char* out) const;
139 /**converts a C-string to a bitstring.
140 @param hstr a C-string to be converted
141 @return the HexString*/
142 void StringToBitstr(char *hstr);