11⁶/13 = 156158413 × π / 3600 for Casio - Page 1
Forum section: electronics / general

author: mathsquid
author_rank: Frequent Contributor
timestamp: July 20, 2020, 02:13:18 am
content: According to my casio, 8958937768937 ÷ 2851718461558 = π

author: maginnovision
author_rank: Super Contributor
timestamp: July 20, 2020, 02:14:51 am
content: On my HP 50G I get 1771561/13 => 136,273.923077.

author: mathsquid
author_rank: Frequent Contributor
timestamp: July 20, 2020, 02:28:49 am
content: Quote from: mathsquid on July 20, 2020, 02:13:18 amIt seems to work for all of theconvergentsof 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 fromhttps://oeis.org/A002485andhttps://oeis.org/A002486.

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 20, 2020, 06:26:15 am
content: If it matters any, 8958937768937 ÷ 2851718461558 has the same value as π in IEEE-754 Binary64 format: 0 10000000000 (1)1001001000011111101101010100010001000010110100011000.

author: tom66
author_rank: Super Contributor
timestamp: July 20, 2020, 07:26:51 am
content: 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.

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 20, 2020, 08:48:43 am
content: Doubt all you want, but for example theCasio fx-991EX manualstates:Quotewhich 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'tknowfor 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 wouldguessthat the programmable and/or graphing calculators have a generic microcontroller in 'em, but that's just a guess.

author: tom66
author_rank: Super Contributor
timestamp: July 20, 2020, 08:54:20 am
content: 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.

author: smithnerd
author_rank: Regular Contributor
timestamp: July 20, 2020, 12:33:47 pm
content: 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.Quote from: Nominal Animal on July 20, 2020, 08:48:43 am

author: mathsquid
author_rank: Frequent Contributor
timestamp: July 20, 2020, 01:41:08 pm
content: Quote from: tom66 on July 20, 2020, 07:26:51 amThat'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

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 20, 2020, 03:43:35 pm
content: Quote from: mathsquid on July 20, 2020, 01:41:08 pmNo, 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 WikipediaCORDICpage 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.