News for hackers. Stuff that matters.
Re:Reversing Sinclair's 1974 calculator hack (2013) by userbinator on Thursday September 16, 2021 @10:15PM (#28560472)
You might be surprised to learn that the calculator chip cannot perform multiplication natively. There's no floating point unit to multiply two numbers. Instead, multiplication is performed through repeated addition, digit by digit.

I believe all the ultra-cheap 4-function calculator ASICs do this or something similar; the speed is not at all important, but die area and resulting price are.

Re:Reversing Sinclair's 1974 calculator hack (2013) by fsckboy on Friday September 17, 2021 @02:44AM (#28562039)
> through repeated addition, digit by digit

when i read ideas like this I'm not sure what they mean

none of the early microprocessors had multiply instructions, but you can carry out a binary multiply using repeated shift+add, and if you don't have a shift you can add a number to itself and that's a shift... so all you are doing is adding but it's not the naive idea of adding a number over and over to simulate multiplication

or do they mean digit by digit and they are doing BCD multiplies? again, not that many adds are being performed so it's not a performance nightmare.

youngbloods don't realize how rarely a C programmer would invoke a multiply (or really need to) (and NEVER inside a loop) even a decade after these early calculators

Re:Reversing Sinclair's 1974 calculator hack (2013) by kens on Friday September 17, 2021 @03:23AM (#28562290)
The multiplies are done by repeated BCD addition, one digit at a time, along with BCD shifting, equivalent to multiplication by 10.