[Ken Shirriff] completely reverse engineers the 1974 Sinclair Scientific calculator

reverse-engineer-sinclair-scientific-calculator

Wow. Seriously… Wow! The work [Ken Shirriff] put into reverse engineering the Sinclair Scientific is just amazing. He covers so much; the market forces that led [Clive Sinclair] to design the device with an under-powered chip, how the code actually fits in a minuscule amount of space, and an in-depth look at the silicon itself. Stop what you’re doing a read it right now!

This calculator shoe-horned itself into the market when the HP-35 was king at a sticker price of $395 (around $1800 in today’s money). The goal was to undercut them, a target that was reached with a $120 launch price. They managed this by using a Texas Instruments chip that had only three storage registers, paired with a ROM totaling 320 words. The calculator worked, but it was slow and inaccurate. Want to see how inaccurate? Included in the write-up is a browser-based simulator built from the reverse engineering work. Give it a try and let us know what you think.

Now [Ken] didn’t do all this work on his own. Scroll down to the bottom of his post to see the long list of contributors that helped bring this fantastic piece together. Thanks everyone!

[Thanks Ed]

 

Comments

  1. very very very cool!

  2. djdesign says:

    Brilliant. Both the design of this calculator and Ken’s reverse engineering. Sir Clive definitely had a hacker mentality, years ahead of his time. Not much code needs to be written in assembly these days but it is definitely a place that can separate the men from the boys, programmatically speaking.

  3. Paul says:

    Back in the late 80’s I was preparing for my GCSE (high school) Maths exam. A day before the exam my Casio died. In the back of a drawer was an old Sinclair scientific calculator. It was a later model (but still with led display). This is what I used.

    I’m sure the whole hall heard the click-click-click of the buttons. But it worked great!

    Clive was genius when it came to reducing costs. There’s a story of him buying skip loads of reject components and paying people to test for those that working.

    • EdS says:

      “Sinclair was certainly an early convert to industrial recycling, as one incident shows. Texas Instruments at Bedford used a large batch of reject transistors as hardcore for a driveway. Sinclair found out about this, presumably through industry contacts, and rather than shrugging his shoulders at a missed opportunity negotiated a price for digging the whole lot up again! ” – http://www.nvg.ntnu.no/sinclair/audio/slimline.htm

    • Greenaum says:

      In more detail, he realised that a transistor that failed it’s specifications, would still meet *some* specifications. So he bought rejects that were still good enough, and sold them much cheaper with lower specs. And also incorporated them into audio amps, radio stuff, all sorts of kits and assembled stuff.

      His biography, published in the 1980s, is pretty interesting, mostly it’s a career biography. Apart from marrying Miss World and playing poker, not much is known about his personal life. He’s apparently quite short-tempered, which goes with being a redhead.

  4. CoolMod says:

    Amazing!!! My brother Joaquin and I ordered the kit and mostly he put it together. We were so worried about damaging something in it. When we turned it on it worked perfectly. It was so amazing! I remember taking it to school and showing it off. Its RPN was interesting since there wasn’t any ENTER key and doing square roots or any other powerful operations required to manipulate logarithms. He still have it in perfectly working condition!!! We both love it. Amazing reverse engineering and explanation job!. And thanks to my brother Joaquin for ordering it and making us been part of history!!! Santiago

  5. leeahart says:

    Absolutely stunning work! Ken Shrriff has shown us his “masterwork”; proof that he has mastered the art of hacking, and worthy to be called a Master.

  6. J. Peterson says:

    Wow. I built one of those from a kit when I was a kid. Wish I’d hung onto it.

  7. Truth says:

    Wow – genius, a real hacker brain.

  8. localroger says:

    This was a brilliant solution in an era when most engineers were still using slide rules, and only expected 3 digits of accuracy best case anyway.

  9. Hack Man says:

    Pretty well done! Up there with the MOS Technology 6502 work.

  10. sinembarg0 says:

    you probably don’t know this, but your bold font is terrible on chrome on OS X. It’s ok on pretty much every other browser though. How do I know this? It’s the same font as /r/android uses.

  11. JimB says:

    Great article. Engineering school in the mid 1970’s was wild and a time of change. Slide rules, trig tables, Wang desktop calculators with neon display (couldn’t read the 7,8, or 9 digits because it was so far back in the display) and the poor kid’s TI SR71. Only one kid had a HP35 because his dad was president of a coal company. Everyone who went to school then knew pi to 7 digits because there was no pi key. My engineering interns of today don’t know how good they have it.

  12. xorpunk says:

    This is stuff people who are into RE always want to do but usually don’t have time to do. Embedded and legacy systems are far more interesting than today’s tech. Mostly because they are more informative and less dense. You try this with today’s tech you’re talking about a very long project only to find out a small subset of a specification or architecture..

    I think if you wanted to be a talented coder, on top of learning pure math, dumping old code from the days when you had to know the system, would give you an edge. The coding practices of this era are still used in rendering, animation, and kernel dev today..

  13. t&p says:

    god a 4 bit ALU and a 0 operand instruction set… wow!

  14. One of the clever features is the lack of decimal point. By forcing all numbers to be entered as normalised scientific notation Sinclair/Searle were able to reduce the code required to handle numeric input AND release a precious key in order to access an extra 4 scientific functions*. Hence a scientific calculator with no decimal point key – Brilliant!

    [* The branch instructions on its CPU are designed to handle individual functions *or* the digits 0..9 . Thus it's much easier to cram extra functions onto existing function keys than onto the digits].

    I had a feeling I persuaded my parents to buy me a Sinclair Scientific calculator, but being 8 years old at the time I couldn’t work it out so we swapped it for a Commodore 796M (d’oh!)

    • edrandom says:

      Good point about placing functions on non-digits. Note also that there’s no Enter key, unlike most RPN calculators. You always start by adding the first operand to zero, or subtracting it from zero.

  15. AA says:

    Enjoyable read. One point of correction though :- I think it’s inaccurate to say the computation of sin and cos is similar to the application of a rotation matrix. What it really is is a truncation of a power series to the linear terms only for cos and to the linear terms plus an approximation of higher order terms for sin (this achieved by using the new value of cos in computing the new value of sin). You can see this if you do a maclaurin series expansion of e^(jd) and multiply that by (cos t + jsin t). This multiplication is a rotation of the current c,s value (cos t + jsin t) by angle d, assuming d is small. The new cos value is the sum of real terms and the new sin value is the sum of imaginary terms in the multiply expansion.

  16. Richard_M says:

    Would Clive Sinclair and Nigel Searle have had access to a machine that could emulate the TMS0800 ? With a masked ROM they would have had to be incredibly confident to commit to production. An astonishing design and astonishing reverse engineering.
    PS: Has anyone else toggled the power switch on the sim and seen it boot ?
    That’s lovely.

  17. Unbelievable in 1974, now +1 some 39 years later. Well done to Clive Sinclair and Nigel Searle for the design and to Ken Sherriff for lifting the lid. It’s about time.
    An astonishing bit of code and top-rank reverse engineering, surely an inspiration to us all. Since the TMS0800 has a masked ROM, did they have an emulator, a development chip with an outboard ROM or did they audaciously commit to silicon ?

    Thank you Ken and well done. Did anyone else toggle the power switch and see the Sim boot ? Absolutely gorgeous.

  18. Les-M says:

    That’s a great article. I still have my Sinclair Scientific. It still works too, despite an occasionally troublesome on-off switch (a standard feature with that style of Sinclair calculator).

  19. Robbo says:

    What is Ken Sherriffs e mail address?

  20. Robbo says:

    Are the speeds in your article on the biological cell of 250 mph and 20 mph real? Do the cell parts really cover 250 miles per hour in such a tiny space?

  21. Nigel Searle says:

    It was the most challenging thing I ever did. If Clive Sinclair hadn’t told me otherwise, I would have believed it was impossible. 😊

    • EdS says:

      Great to see you here Nigel, and enormous respect for the achievement! Did you really code it in a few days, and did you only have hand-simulation available?

      • Nigel Searle says:

        The short answers are No and No. The coding, which was the first of only two coding jobs I ever did except for student exercises, took place over several months. TI had a simulator running on a mainframe in Dallas which I accessed from Houston on a two- or three-week visit in 1973, and from London periodically via a very slow satellite link. My first attempt – which may have taken “only a few days” – used twice as much ROM as was available. Toward the end, reducing the code became incredibly difficult; I was spending many days – and nights – searching for ways to reduce the code by even a single instruction.
        Of course, it would have taken less time overall if Clive Sinclair hadn’t got me working on several other projects at the same time. Happy days!

    • Ed S says:

      Nigel, one historical detail would be very interesting to know: had you come across Minsky’s circle drawing (sincos) trick in the HAKMEM memo, or elsewhere, or independently discovered it?

      • Nigel Searle says:

        In mid-1972, Clive Sinclair started a project to develop a single-chip scientific calculator from scratch. I was hired to work with the chip’s hardware designers, specifying the instruction set, writing the code and deciding how much RAM and ROM were needed. This project, which was partially funded by Bowmar, was eventually abandoned in 1973, after we figured out we could utilize the TI chip.
        Clive was aware of the CORDIC algorithms used by H-P, but right from the start he had the idea to use the simpler, more compact – but slower – process for the trigonometric functions that was eventually implemented in the final product. Clive was a very good mathematician and it is quite possible that he discovered the process for himself. He also read technical and scientific literature extensively, but I doubt that he was aware of Minsky’s work. If he got any help from an outside source, it was probably from “Handbook of Mathematical Functions” (Abramowitz and Stegun, eds.) It was our Bible.
        My memory of the origins of the log function algorithm is less clear. I think the basic idea came from Clive, but was not as fully formed as the idea for the trig calculations. I did not rely on any outside source for whatever contribution I may have made to the algorithm, and if the idea was suggested to Clive by anyone else’s work it was probably something he read in the Handbook.
        I wish now that I had kept notes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,486 other followers