Post Reply 
Any Binary Calculators
11-21-2019, 11:38 PM
Post: #13
RE: Any Binary Calculators
(11-21-2019 08:32 PM)burkhard Wrote:  
(11-21-2019 07:06 PM)KeithB Wrote:  Generally, non-floating-point binary fractions are just handled as "fixed point". For example you might take your 32 bit number and assume the decimal point is the 16th bit. Addition and subtraction are handled normally, but for multiplication and division you might have to shift the result to get the decimal back where it belongs, just like multiplying by hand.

This is done on small, low power MCU's where floating point might be too expensive time-wise.

Exactly. And the real math going on is a 32-bit integer.

I think what Kaliuzhkin seeks is perfectly legitimate although it's a pretty unusual request. To most engineers indeed "binary math" implies binary integer math. One can argue the merits of the jargon, but when he asked the question, that's what the initial respondents assumed.

So, anyhow... it sounds like there are some programs out there to do what he wants, but it doesn't sound like it's native to any of the present and past HP calculators.

Interesting question!

I agree with both. But if the OP needs to work with binary numbers with fractional parts, on a HP48 and newer should be easy to convert real numbers to "fractional" binary numbers as long as the desired number of bits is <64
Just decide how many fractional bits you need (let's call it 'f') and convert to integers: IP(R) and IP(FP(R)*2^f), both of them can be displayed in binary, even converted to a string with the format "010101.10101".

Just a couple of short routines and I'd say the entire line of RPL HP calculators can easily support fractional binary numbers. The only catch is you can display them, but not operate on them since all operations are decimal. Results in binary may not correspond to the results obtained if using binary math of course. The HP Prime could do this using binary math, so it might even achieve this too.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Any Binary Calculators - Kaliuzhkin - 11-20-2019, 07:09 PM
RE: Any Binary Calculators - Kaliuzhkin - 11-20-2019, 07:44 PM
RE: Any Binary Calculators - Jim Horn - 11-20-2019, 07:41 PM
RE: Any Binary Calculators - BruceH - 11-20-2019, 11:36 PM
RE: Any Binary Calculators - Joe Horn - 11-21-2019, 01:05 AM
RE: Any Binary Calculators - burkhard - 11-21-2019, 05:52 PM
RE: Any Binary Calculators - Kaliuzhkin - 11-21-2019, 06:23 PM
RE: Any Binary Calculators - KeithB - 11-21-2019, 07:06 PM
RE: Any Binary Calculators - burkhard - 11-21-2019, 08:32 PM
RE: Any Binary Calculators - Claudio L. - 11-21-2019 11:38 PM



User(s) browsing this thread: 3 Guest(s)