7 ms·
Classic Calculator Was Reverse Engineered from the Bare Metal
- barbegal 6y agoKen Schirriff's blog has a much more detailed and interesting explanation including photos of the die that were used to reverse engineer it. http://files.righto.com/calculator/sinclair_scientific_simulator.html http://files.righto.com/calculator/sinclair_scientific_simul...
- samizdis 6y agoExcellent. Thanks for that.
- leni536 6y ago> How can sine and cosine be computed efficiently in a calculator that has a hard time even doing multiplication? The trick is to do repeated rotations by 0.001 radians until the desired angle is reached. Genius!
- kens 6y agoThanks. My last name is "Shirriff", by the way (no "c").
- samizdis 6y ago> ... the replica reproduced its behavior, by using an emulator running firmware that had been reverse engineered by visually examining the metal of an original processor.
- Qasaur 6y agoSomewhat off-topic, but why does the IEEE (a non-profit) have annoying ads on their site? I'm not using an ad-blocker and as soon as I clicked the link I was bombarded by one big half-page ad and a bunch of other ads that are irrelevant to the content of the article. I would have thought that their very expensive membership fees and article/publication fees would have covered their operating expenses.
- metaphor 6y agoTo rub salt into the wound, even dues-paying regular members aren't immune to such ridiculous ad bombardment.
- Yetanfou 6y ago> Somewhat off-topic, but why does the IEEE (a non-profit) have annoying ads on their site? Because you forgot to install or enable an ad blocker. I know this is not a real answer to your question but it is the best answer to the annoying ads problem.
- matheusmoreira 6y ago> I'm not using an ad-blocker Why not? The advertising is never going to stop unless everyone blocks it. Content blockers should come pre-installed with all browsers. Ideally, they should be fully integrated features instead of mere extensions. That's the only way for browsers to still retain their status as user agents. Browsers are supposed to act on our behalf by showing us the information we want to see. They aren't supposed to show us advertising noise for someone else's benefit. > I would have thought that their very expensive membership fees and article/publication fees would have covered their operating expenses. It's not about covering operating expenses. Memberships revenue + advertising revenue will always be greater than memberships revenue alone. It's an easy choice for them to make. Why would they actively choose to make less money than they could be making? This advertising noise will never disappear on its own. We need to actively get rid of it. We need to make it so that advertising is a waste of money for companies. That's the only way to make them stop.
- amelius 6y agoHere's someone who rebuilt the device with modern parts: https://hackaday.io/project/91895-sinclair-scientific-calculator-emulator https://hackaday.io/project/91895-sinclair-scientific-calcul...
- throwaway_pdp09 6y agoThat is one strange calculator. It's like having a car with 3 buttons; forward, backward and teleport.
- Aardwolf 6y agoForward, backward and rotate left.
- anewdirection 6y agoIf childhood taight me anything, the minimum is just 2 buttons. Forward, reverse-left. Simple, usually effective, and maddenly oversimplified. I think I liked the one that only sent forward more, but it of course required a track. People forget simple things like steering servos were not available to most kids until the 90s injection molding explosion that is so ubiq today.
- dylan604 6y agoTotally forgot about one of the cars I had that did that. Though, I always hated it thinking it was such a cheap toy.
- Frenchgeek 6y agoThere was also a model that had "forward" and "spin counterclockwise".
- Paperweight 6y agoWeren't there single-button ones that would continuously drive forward unless you pressed the remote control button, which would switch it to reverse-left? So to "stop" you had to keep tapping the button.
- thaumasiotes 6y ago> The Sinclair Scientific was able to reduce complexity by using reverse Polish notation, in which mathematical operators come after the numbers they are operating on—for instance, “5 + 4 =” becomes “5 4 +.” This is a great example of a place where you shouldn't use punc-quote formatting. There is no . key on the calculator, but that's not obvious while you're reading the article.
- zapzupnz 6y ago> This is a great example of a place where you shouldn't use punc-quote formatting There's no place where it should be used. It can only introduce ambiguities, never solve any. Quote-punc, on the other hand, doesn't introduce any. What always drove me nuts in academic writing was the knowledge that no matter how well I chose to format my article, the publisher would always introduce punc-quote and wreck things. I'd have to defensively write around the potential placement of a punctuation mark which is just insane.
- kleiba 6y agoMy former boss, a university professor, is a very good writer and leaning towards the anal side when it comes to things like punctuation, wording, spelling, etc. I remember we once worked on a journal article together that was edited somewhere in India. She sent in a pristine source file, and got back a print proof where literally tens of mistakes had been introduced. She corrected them meticulously, sent the corrected version back, and received another proof with another tens of errors introduced. This went on for quite a while, you can only admire my boss's perseverance. However, what I don't understand is how these mistakes could have been introduced in the first place? It almost felt like someone on the other end was actually retyping all of her writing, or else how was it possible to get all of these mistakes in there?
- JoeAltmaier 6y agoWas there money involved? Perhaps it was a scam, or a failure to pay the right bribe.
- deleted 6y ago[deleted]
- fnord77 6y agoI was on a VPN and was getting http 418 from this server. Weird.
- drfuchs 6y agoWhy can't they mention "CORDIC" so that interested readers can find out the cool details about how to actually calculate "... trigonometric functions by repeatedly rotating an initial vector until the target angle was reached..." using only fixed-point add, subtract, and shift?
- Someone 6y agoNitpick: this calculator uses only one of the core ideas of CORDIC: that one can compute sines and cosines by repeated rotation. It doesn’t use the other core idea that you can approximate any angle by successively halving each step. It doesn’t do the latter because of lack of memory to implement it in. http://files.righto.com/calculator/sinclair_scientific_simulator.html http://files.righto.com/calculator/sinclair_scientific_simul...: “How can sine and cosine be computed efficiently in a calculator that has a hard time even doing multiplication? The trick is to do repeated rotations by 0.001 radians until the desired angle is reached. […] Other calculators use algorithms such as decimal CORDIC that are much faster and more accurate, taking time proportional to the number of digits.”
- roelschroeven 6y ago> The Sinclair Scientific was able to reduce complexity by using reverse Polish notation, in which mathematical operators come after the numbers they are operating on—for instance, “5 + 4 =” becomes “5 4 +.” It's not really RPN though. RPN lets you write "2 × (5+4)" as "2 5 4 + ×", but the Sinclair Scientific doesn't support that. It would have needed a stack for that, which wasn't available. Instead each operation simply acts on the previous result. You'd have to use "5 + 4 + 2 ×" instead. Still very impressive how they managed to accomplish all that using that simple TI chip and only 320 instructions.
- ec109685 6y agoIt’s not “5 4 + 2 x”?
- morcheeba 6y agochanging the order like that doesn't extend to "(5+4)*(3+2)"
- roelschroeven 6y agoThat would be pretty cumbersome to calculate. I guess you'd have to remember the intermediate result. On paper, since the calculator didn't have any memory function.
- duskwuff 6y agoThat'd give you 54 x 2. You have to press + to delimit the initial value.
- roelschroeven 6y agoActually 5.4 × 2; for 54 you have to enter 54E1 (5.4 × 10^1).
- thaumasiotes 6y agoTechnically, you still need delimiters in RPN, so "2 5 4 + ×" won't get you anything, because it's invalid. You need "2 ENTER 5 ENTER 4 + ×" But that is both mentally more difficult to handle and physically more difficult to input than "5 ENTER 4 + 2 ×", so I wouldn't count this as a strike against the Sinclair even theoretically.
- barbegal 6y agoThe patent https://patentimages.storage.googleapis.com/0d/b2/87/7f219f38ca9899/US3934233.pdf https://patentimages.storage.googleapis.com/0d/b2/87/7f219f3... for the chip this calculator was based on (the TMS080x) is a real work of art. If you know how to make a transistor and a seven segment display, you can build yourself a fully working calculator with the information in the patent. The architecture is truly odd, using 44 bit registers (11 x 4-bit BCD) and 11-bit opcodes. It is more like an electrical abacus than a microcontroller.
- kens 6y agoMost patents are worthless for learning anything, but Texas Instruments has some remarkably useful patents. That one, in particular, is a 61-page complete description of the calculator hardware with detailed schematics, as well as the software in flowchart and assembly form and the chip's instruction set. The patent has enough information to completely simulate the calculator (which I did: http://righto.com/ti http://righto.com/ti). This patent was clearly written by the engineers and not the lawyers. The funny thing is that what the patent actually claims is an obscure technique for connecting the ground lines in the calculator's ROM. In other words, almost all the detailed text in the patent is irrelevant to what is actually patented.
- barbegal 6y agoThanks Ken, it's a great simulator. Is there any way others could write code for this simulator and play around with it as opposed to just running the original code? And what are the best and worst features of this hardware architecture? Was there any little thing you think the designers should have done to improve it? Or was there something genius about it?
- kens 6y agoIf you want to hack on the calculator, the code is on github: https://github.com/shirriff/TICalculatorJSSimulator https://github.com/shirriff/TICalculatorJSSimulator As far as the architecture of the calculator, it's kind of amazing that they were able to build a calculator chip at all, given the state of IC technology. The architecture is highly tuned to calculators, rather than being general-purpose. For instance, a "digit scan" register cycles through 10 scan lines to illuminate each digit. At the same time, it scans 10 rows of the keyboard. Another interesting thing about the calculator chip is it has 11-bit opcodes. Powers of two are so ingrained in us that it seems bizarre to have 11-bit opcodes. But old computers often had random word lengths. The calculator's instruction set is very low-level, more like microcode than a "real" instruction set.
- Paperweight 6y agoThe UI design of calculators is fascinating. Where do you put the buttons? TI and friends have a randomish layout, let alone the TERRIBLE mobile calculator apps. (Self-promotion) I always wanted to design a calculator and finally got around to it as a lockdown project - https://ucalc.app https://ucalc.app
- ajnin 6y agoOT but it's a real shame the bubble LED displays used in those calculators are not manufactured anymore. Something about the warm red glow and incandescent-like filament look appeals to me. They are also very compact, it's occasionally possible to find more recent bubble displays but quite bulkier, and outrageously expensive.