Author Topic: 11⁶/13 = 156158413 × π / 3600 for Casio  (Read 4912 times)

0 Members and 2 Guests are viewing this topic.

Offline bsfeechannelTopic starter

  • Super Contributor
  • ***
  • Posts: 1678
  • Country: 00
11⁶/13 = 156158413 × π / 3600 for Casio
« on: July 20, 2020, 12:09:29 am »
 

Offline mathsquid

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: us
  • I like math.
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #1 on: July 20, 2020, 02:13:18 am »
According to my casio, 8958937768937  ÷ 2851718461558 = π
 

Offline maginnovision

  • Super Contributor
  • ***
  • Posts: 1967
  • Country: us
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #2 on: July 20, 2020, 02:14:51 am »
On my HP 50G I get 1771561/13 => 136,273.923077.
 

Offline mathsquid

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: us
  • I like math.
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #3 on: July 20, 2020, 02:28:49 am »
According to my casio, 8958937768937  ÷ 2851718461558 = π

It seems to work for all of the convergents of pi, starting with the one I mentioned above. Most everyone knows 3 and 22/7 as the first two convergents. You can get the numerators and denominators of the first 26 or so from https://oeis.org/A002485 and https://oeis.org/A002486.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8108
  • Country: fi
    • My home page and email address
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #4 on: July 20, 2020, 06:26:15 am »
If it matters any,  8958937768937 ÷ 2851718461558  has the same value as  π  in IEEE-754 Binary64 format: 0 10000000000 (1)1001001000011111101101010100010001000010110100011000.
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 8135
  • Country: gb
  • Professional HW / FPGA / Embedded Engr. & Hobbyist
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #5 on: July 20, 2020, 07:26:51 am »
I really doubt these calculators use floating point.

For anyone interested you can get into a factory service menu fairly easy (oh how bored you get in college math classes): press SHIFT+7+ON, then '9' or SHIFT advances through the various menus.  I haven't found anything more down this rabbit-hole.
« Last Edit: July 20, 2020, 07:29:45 am by tom66 »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8108
  • Country: fi
    • My home page and email address
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #6 on: July 20, 2020, 08:48:43 am »
Doubt all you want, but for example the Casio fx-991EX manual states:
Quote
Calculation range: ±1×10-99 to ±9.999999999×1099 or 0
Number of Digits for Internal Calculation: 15 digits
Precision: In general, ±1 at the 10th digit for a single calculation. Precision for exponential display is ±1 at the least significant digit. Errors are cumulative in the case of consecutive calculations.
which is a textbook definition of floating-point format being used.  I don't know what kind of chip they have, but even an 8-bit microcontroller do FP emulation.  The above sounds very much like a 49-bit mantissa (48-bit with implicit MSB set for nonzero numbers) with 8-bit exponent, which would be real easy to do on even a dirt cheap 8-bit MCU.  Or possibly a 60-bit BCD mantissa with 8-bit exponent; possibly preferred (simpler to convert to decimal form).

AFAIK (but I don't know for sure) Casio and others do have their own specialized calculator cores, which implement floating-point calculation in hardware, and have had those for a long time.  Whether they still do, or if they use dirt-cheap microcontrollers instead, I have no idea: but both would work.  I would guess that the programmable and/or graphing calculators have a generic microcontroller in 'em, but that's just a guess.
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 8135
  • Country: gb
  • Professional HW / FPGA / Embedded Engr. & Hobbyist
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #7 on: July 20, 2020, 08:54:20 am »
OK, right.  I meant to say that I doubt they use IEEE754-type binary floating point. The decimal point does indeed float on these calculators, which makes them floating point, but they are storing the decimal digits either directly or in some packed BCD format.  Binary floating point introduces unacceptable errors into precision calculations.

It probably does use some custom RISC core with some hardware acceleration as the calculators are reasonably fast considering the math involved in e.g. computing fraction representations.  The first fx-series calculator I had, which met its end when run over by the bus after falling out of my pocket, used two controller ICs - perhaps one of these was the display/CPU and the other the accelerator ASIC.  The newer fx-991ES I have, uses a single large blob IC.  Casio does have considerable experience with ASIC design, and these calculators are dirt cheap, you can regularly get them for less than £6 in the UK, which means they probably cost around £1 to make.

There's a software checksum available on the diag screen and different calculators have different software versions and checksums.    You can change some of the older models by moving solder jumpers on the PCB which would unlock features like statistics and differentiation, but the newer fx series have different software on each calculator so that doesn't change anything.

Also, on my older model at least, when the battery ran down, it seems like the RAM or processor started going a bit loopy, in that you could occasionally get obviously incorrect results with a frozen screen and randomly stuck pixels. 
« Last Edit: July 20, 2020, 08:56:25 am by tom66 »
 

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #8 on: July 20, 2020, 12:33:47 pm »
They use a bespoke OKI/Lapis/Rohm part with a nX-U8/100 core. They are very impressive parts - exceptionally low power.

Some considerable effort has already gone into extracting the ROM of the fx-991/570:

https://community.casiocalc.org/topic/7583-fx-82-83gt-115-991es-plus-hacking/

The early models were mask ROM, which is why the capabilities were unlockable in hardware. From the analysis that I've already done, I strongly suspect that the more recent models are flash or mask/flash hybrid.

Doubt all you want, but for example the Casio fx-991EX manual states:
Quote
Calculation range: ±1×10-99 to ±9.999999999×1099 or 0
Number of Digits for Internal Calculation: 15 digits
Precision: In general, ±1 at the 10th digit for a single calculation. Precision for exponential display is ±1 at the least significant digit. Errors are cumulative in the case of consecutive calculations.
which is a textbook definition of floating-point format being used.  I don't know what kind of chip they have, but even an 8-bit microcontroller do FP emulation.  The above sounds very much like a 49-bit mantissa (48-bit with implicit MSB set for nonzero numbers) with 8-bit exponent, which would be real easy to do on even a dirt cheap 8-bit MCU.  Or possibly a 60-bit BCD mantissa with 8-bit exponent; possibly preferred (simpler to convert to decimal form).

AFAIK (but I don't know for sure) Casio and others do have their own specialized calculator cores, which implement floating-point calculation in hardware, and have had those for a long time.  Whether they still do, or if they use dirt-cheap microcontrollers instead, I have no idea: but both would work.  I would guess that the programmable and/or graphing calculators have a generic microcontroller in 'em, but that's just a guess.
 
The following users thanked this post: tom66

Offline mathsquid

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: us
  • I like math.
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #9 on: July 20, 2020, 01:41:08 pm »
I really doubt these calculators use floating point.

That's a good point. I don't know what they do internally, but when casio calculators talk to each other via the serial port (the 2.5 mm jack on top), they encode numbers using BCD.

https://www.qsl.net/la9sja/electronics/casio-comm.pdf?q=casio
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8108
  • Country: fi
    • My home page and email address
Re: 11⁶/13 = 156158413 × π / 3600 for Casio
« Reply #10 on: July 20, 2020, 03:43:35 pm »
I really doubt these calculators use floating point.

That's a good point. I don't know what they do internally, but when casio calculators talk to each other via the serial port (the 2.5 mm jack on top), they encode numbers using BCD.

https://www.qsl.net/la9sja/electronics/casio-comm.pdf?q=casio
No, they most definitely use some form of floating-point format to describe numbers.  It is unlikely it is IEEE-754 Binary64, though.

For the transfer, the PDF says the format is a sign/info byte, a single byte exponent, and a 15 BCD digit mantissa.

The sign/info byte has only 4 bits, so it looks like at least some Casio devices use 9 bytes to describe a real number, and 18 for complex numbers: one byte for the base-10 exponent, and 8 bytes of BCD digits, with the most significant 4 bits replaced with the sign/info byte.  (The extra byte, since each real variable takes 10 bytes of memory, is the name of the variable.) This is a particularly nice format to process with a 8-bit microcontroller.  Multiplication and division can be implemented with a 256-byte look-up table each, via long multiplication and division.

The thing that I'm unsure of is logarithms and hyperbolic functions.  I know of the binary approaches (that can be implemented even on an 8-bit processor), but don't know about other radixes, especially decimal/BCD.  However, the Wikipedia CORDIC page links to a 1971 paper by John Stephen Walter, A unified algorithm for elementary functions (PDF), which shows how it is done; so, in my opinion, BCD is more likely than binary for the mantissa.

Circling back to the topic at hand, a mantissa of 15 decimal digits corresponds to about 50 bits, or slightly less than IEEE-754 Binary64 (53 bits), which explains the reason Casio calculators think 8958937768937 ÷ 2851718461558 = π: their internal floating point representation is the same for both, 3.14159265358979×100.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf