Lines Matching refs:csd
62 scfx_string csd;
64 // copy bits from 's' into 'csd'; skip prefix, point, and exponent
70 csd[i ++] = s[j];
75 csd[i] = '\0';
77 // convert 'csd' from two's complement to csd
81 if( csd[i] == '0' )
85 if( i > 0 && csd[i - 1] == '0' )
88 csd[i --] = '-';
90 { // i > 0 && csd[i - 1] == '1'
91 csd[i --] = '-';
92 while( i >= 0 && csd[i] == '1' )
93 csd[i --] = '0';
95 csd[i] = '1';
97 csd[i --] = '1';
102 // copy bits from 'csd' back into 's'
105 while( csd[i] )
109 s[j ++] = csd[i ++];
115 scfx_csd2tc( scfx_string& csd )
117 SC_ASSERT_( csd[0] == '0' && csd[1] == 'c' &&
118 csd[2] == 's' && csd[3] == 'd', "invalid prefix" );
122 // copy bits from 'csd' into 's'; skip prefix, point, and exponent
126 while( csd[j] )
128 if( csd[j] == '-' || csd[j] == '0' || csd[j] == '1' )
129 s[i ++] = csd[j];
130 else if( csd[j] != '.' )
136 // convert 's' from csd to two's complement
154 // copy bits from 's' back into 'csd'
155 j = csd.length();
156 csd[j + 1] = '\0';
159 csd[j] = csd[j - 1];
167 if( csd[j] == '.' )
169 csd[j ++] = s[i ++];