Reverse Polish Notation And Its Mildly Confusing Elegance

The best rummage sale purchase I ever made was a piece of hardware that used Reverse Polish Notation. I know what you’re thinking… RPN sounds like a sales gimmick and I got taken for a fool. But I assure you it’s not only real, but a true gem in the evolution of computing.

Best rummage sale find ever!
Best rummage sale find ever!

Sometime in the 1980s when I was a spotty teen, I picked up a calculator at a rummage sale. Protected by a smart plastic case, it was a pretty good condition Sinclair Scientific that turned out when I got it home to have 1975 date codes on its chips, and since anything with a Sinclair badge was worth having it became mine for a trifling amount of money. It had a set of corroded batteries that had damaged one of its terminals, but with the application of a bit of copper strip I had a working calculator.

And what a calculator! It didn’t have many buttons at a time when you judged how cool a scientific calculator was by the prolific nature of its keyboard. This one looked more akin to a run-of-the-mill arithmetic calculator, but had button modes for trigonometric functions and oddly an enter key rather than an equals sign. The handy sticker inside the case explained the mystery, this machine used so-called Reverse Polish Notation, or RPN. It spent several years on my bench before being reverently placed in a storage box of Sinclair curios which I’ve spent half a day turning the house over to find as I write this article.

Continue reading “Reverse Polish Notation And Its Mildly Confusing Elegance”

Ken Shirriff Takes Us Inside The IC, For Fun

[Ken Shirriff] has seen the insides of more integrated circuits than most people have seen bellybuttons. (This is an exaggeration.) But the point is, where we see a crazy jumble of circuitry, [Ken] sees a riddle to be solved, and he’s got a method that guides him through the madness.

In his talk at the 2016 Hackaday SuperConference, [Ken] stepped the audience through a number of famous chips, showing how he approaches them and how you could do the same if you wanted to, or needed to. Reading an IC from a photo is not for the faint of heart, but with a little perseverance, it can give you the keys to the kingdom. We’re stoked that [Ken] shared his methods with us, and gave us some deeper insight into a handful of classic silicon, from the Z80 processor to the 555 timer and LM7805 voltage regulator, and beyond.

Continue reading “Ken Shirriff Takes Us Inside The IC, For Fun”

[Ken Shirriff] Demystifies BeagleBone I/O

If you have ever spent a while delving into the bare metal of talking to the I/O pins on a contemporary microprocessor or microcontroller you will know that it is not always an exercise for the faint-hearted. A host of different functions can be multiplexed behind a physical pin, and once you are looking at the hardware through the cloak of an operating system your careful timing can be derailed in an instant. For these reasons most of us will take advantage of other people’s work and use the abstraction provided by a library or a virtual filesystem path.

If you have ever been curious enough to peer under the hood of your board’s I/O then you may find [Ken Shirriff]’s latest blog post in which he explores the software stack behind the pins on a BeagleBone Black to be of interest. Though its specifics are those of one device, the points it makes have relevance to many other similar boards.

He first takes a look at the simplest way to access a Beagle Bone’s I/O lines, through virtual filesystem paths. He then explains why relying so heavily on the operating system in this way causes significant timing issues, and goes on to explore the physical registers that lie behind the pins. He then discusses the multiplexing of different pin functions before explaining the role of the Linux device tree in keeping operating system in touch with hardware.

For some Hackaday readers this will all be old news, but it’s safe to say that many users of boards like the BeagleBone Black will never have taken a look beyond the safely abstracted ways to use the I/O pins. This piece should therefore provide an interesting education to the chip-hardware novice, and should probably still contain a few nuggets for more advanced users.

We’ve seen a lot of [Ken]’s work here at Hackaday over the years, mostly in the field of reverse engineering. A few picks are his explanation of the TL431 voltage reference, a complete examination of the 741 op-amp, and his reverse engineering of the 1970s Sinclair Scientific calculator.

We appreciate [Fustini]’s tip on this story.

BeagleBone Black image: BeagleBoard.org Foundation [CC BY-SA 3.0], via Wikimedia Commons.

The IBM 1401’s Unique Qui-Binary Arithmetic

Old mainframe computers are interesting, especially to those of us who weren’t around to see them in action. We sit with old-timers and listen to their stories of the good ol’ days. They tell us about loading paper tape or giving instructions one at a time with toggle switches and LED output indicators. We hang on every word because its interesting to know how we got to this point in the tech-timeline and we appreciate the patience and insanity it must have taken to soldier on through the “good ol’ days”.

[Ken Shirriff] is making those good ol’ days come alive with a series of articles relating to his work with hardware at the Computer History Museum. His latest installment is an article describing the strange implementation of the IBM 1401’s qui-binary arithmetic. Full disclosure: It has not been confirmed that [Ken] is an “old-timer” however his article doesn’t help the argument that he isn’t.

Ken describes in thorough detail how the IBM 1401 — which was first introduced in 1959 — takes a decimal number as an input and operates on it one BCD digit at a time. Before performing the instruction the BCD number is converted to qui-binary. Qui-binary is represented by 7 bits, 5 qui bits and 2 binary bits: 0000000. The qui portion represents the largest even number contained in the BCD value and the binary portion represents a 1 if the BCD value is odd or a 0 for even. For example if the BCD number is 9 then the Q8 bit and the B1 bit are set resulting in: 1000010.

The qui-binary representation makes for easy error checking since only one qui bit should be set and only one binary bit should be set. [Ken] goes on to explain more complex arithmetic and circuitry within the IBM 1401 in his post.

If you aren’t familiar with [Ken], we covered his reverse engineering of the Sinclair Scientific Calculator, his explanation of the TL431, and of course the core memory repair that is part of his Computer History Museum work.

Thanks for the tip [bobomb].

Pocket Calculator Emulates Pocket Calculator

msp430 Calc Emu

[Chris] has built a pocket calculator that emulates… a pocket calculator. Two pocket calculators, in fact. Inspired by [Ken Shirriff’s] incredible reverse engineering of the Sinclair scientific calculator, [Chris] decided to bring [Ken’s] Sinclair and TI Datamath 2500II simulators to the physical world.

Both of these classic 70’s calculators are based on the TMS0805 processor. The 0805 ran with 320 11-bit words of ROM and only three storage registers. Sinclair’s [Nigel Searle] performed the real hack by implementing scientific calculator operations on a chip designed to be a four function calculator.

[Chris] decided to keep everything in the family by using a Texas Instruments msp430 microcontroller for emulation. He adapted [Ken’s] simulator code to run on a MSP430G2452. 256 bytes of RAM and a whopping 8KB of flash made things almost too easy.[Chris’] includes ROMs for both the TI and the Sinclair calculators. The TI Datamath ROM is default, but by holding the 7 key down during boot, the Sinclair ROM is loaded. The silk screen includes key icons for both calculators, as well as some Doge-inspired wisdom on the back.

All joking aside, these really are amazing little calculators. Children of the 60’s and 70’s will be taken back when they see the LEDs flash as the emulated TMS0805 performs algorithmic arithmetic. [Chris’] code is up on Github. While he hasn’t released gerbers yet, he does have images of his PCB layout on the 43oh.com forums.

Continue reading “Pocket Calculator Emulates Pocket Calculator”

Hackaday Links: September 8, 2013

hackaday-links-chain

“I’m sorry Dave, I’m afraid I can’t open the dorm room door.” Does your dorm room have a peephole? Take [pjensen’s] lead and turn it into a mini HAL 9000 using a red LED.

Mix a little work in with your hobby skills. [Vittore] needed to build a video looper to drive some TV screens for a Hotel contract job. He grabbed a Raspberry Pi and got to work. The final product (translated) even uses a shared folder on the hotel’s network as the source slides.

We’re not sure if anyone noticed last Monday (it was Labor Day in the U.S.).  We had a little fun with coffee themed posts. [Tom] wrote in to remind us about the HTCPCP: Hyper Text Coffee Pot Control Protocol. If you don’t have time to read it all, he suggests you don’t miss his favorite, error code 418.

Maybe funny reading isn’t your thing right now, but we have some more helpful stuff to offer. Check out [John Chandler’s] Commandments for using PIC microcontrollers from a few years back.

[Andy] has some old smart phones which he is using in his projects. His beef with the touchscreens is that there’s no tactile feedback. Since these are going to be dedicated displays he’s outlining the touch controls with tape to let your finger know what it’s doing.

If you’re living in your first home in America there’s a really good chance it’s a 1950’s ranch house considering how many of them were built after World War II. Bring its infrastructure into the information age with a cable retrofit. [Andrew Rossignol] just did so and posted a lot of pictures of the process.

If you liked [Ken Shirriff’s] post about the Sinclair Scientific Calculator we think you’ll love his continuation of a Z80 reverse engineering series.

Decoding A ROM From A Picture Of The Chip

Before there were home computers, among the hottest pieces of consumer technology to own was a pocket calculator. In the early 1970s a series of exciting new chips appeared which allowed the impossible to become the affordable, and suddenly anyone with a bit of cash could have one.

Perhaps one of the more common series of chips came from Texas instruments, and it’s one of these from which [Veniamin Ilmer] has retrieved the ROM contents. In a way there’s nothing new here as the code is well known, it’s the way it was done which is of interest. A photo of the die was analysed, and with a bit of detective work the code could be deduced merely from the picture.

These chips were dedicated calculators, but under the hood they were simple pre-programmed microcontrollers. Identifying the ROM area of the chip was thus relatively straightforward, but some more detective work lay in getting to the bottom of how it could be decoded before the code could be verified. So yes, it’s possible to read code from an early 1970s chip by looking at a photograph.

A very similar chip to this one was famously reprogrammed with scientific functions to form the heart of the inexpensive Sinclair Cambridge Scientific.