Arpad- Responses below. Mike S. Muranyi, Arpad wrote:
I see this as being a bit like teaching my grandmother to suck eggs; however if people believe this would be helpful as a programming suggestion in the spec, fine, let's do it. I do suggest that we not make a big deal of this because it's not a big deal.Mike, Thanks, this makes perfect sense. So going back to the original question, shouldn't we say something about this in the IBIS-AMI spec?
"Here's one way to do it that we know works." is about as far as I would go. Furthermore, I don't think it would need much more text than my previous e-mail.I don't think we can "prescribe" and enforce what algorithms people should/can put into the DLL, but at least give them a ***strong*** suggestion (and example) for how one might do it properly to avoid problems with multi million bit runs.
The technique that's in there is already not too bad in that the number of floating point operations is one plus the number of previous GetWave calls; however, it could be improved to use exactly the technique I described. The source code changes would be simple enough, but I'd be a bit more concerned about the effort to post a new version. Would the benefit to novice model makers really justify that effort? That's not obvious to me.In addition, may I request that you update your tool kit with this in mind (preferably with a 64-bit integer) to set a correct example for the novice model makers?
Among the languages I've used- C/C++, PERL, Verilog, Visual Basic, MatLab/Octave, python- Verilog has a "time" variable type that's 64 bits. My recollection of MatLab/Octave is a bit hazy, so maybe there's something there, though I don't think so. Any of these languages on a 64 bit machine probably also uses 64 bit integers. Other than that, I truly do mean to leave 64 bits as an exercise for the student.Just a technical detail question on the "bit twiddling" topic. This may not always be necessary, depending on what language the model maker is using, right? I would assume that more modern languages would allow someone to use 64-bit integers in multiplication with a floating point variable without additional user intervention. Or am I wrong?
Thanks, Arpad ============================================================== -----Original Message-----From: Mike Steinberger [mailto:msteinb@xxxxxxxxxx] Sent: Thursday, June 18, 2009 1:22 PMTo: Muranyi, Arpad Cc: IBIS-ATM Subject: Re: [ibis-macro] Re: Problem with IBIS-AMI clock_times definitionKeep the sample count as an integer, then use a single floating point multiplication to multiply by the sample interval to generate each floating point time value. The integer arithmetic has no round-off error, and there's only one floating point operation. Mirabile dictu and Bob's your uncle.If 32 bits isn't large enough to count all the samples you have in mind, then create a double precision integer (e.g., 64 bits), increment that, and perform the floating point multiplication. That means you have to write some bit twiddling functions to perform the arithmetic functions. I think those bit twiddling functions would make a good homework assignment for an introductory programming course, since it would require an understanding of binary arithmetic, provide practice with bit-wise logical operations, and force a deeper understanding of the relationship between integer and floating point variables in the programming language.Mike S.
--------------------------------------------------------------------- IBIS Macro website : http://www.eda.org/pub/ibis/macromodel_wip/ IBIS Macro reflector: //www.freelists.org/list/ibis-macro To unsubscribe send an email: To: ibis-macro-request@xxxxxxxxxxxxx Subject: unsubscribe