12

According to the history of barcodes, the idea of consumer product barcodes appeared before the microprocessor era. What was the implementation plan then? Would each store need a mini-computer in a back-room?

The first commercial barcode reader appeared in 1974. What was it based on?

The UPC barcode symbology seems to be quite complex compared to encodings used to record data on cassette tape (for example, it must be readable in either direction, and it contains just a couple of sync bars compared to hundreds of initial sync pulses in the beginning of cassette tape files); how was it implemented, given the memory constraints and the variation in scanning speed?

2 Answers 2

5

The one tricky aspect of the UPC code is accurately gauging the bit rate, but that is facilitated by the fact that each code starts and ends with a sequence of narrow bars and spaces. Once the bit rate has been determined, one can start by converting each "pixel" that matches the previous one to a zero and each pixel that differs into a 1. Each character will start with a 1 and have six bits after it, of which three will be set and three will be clear. There are 64 combinations of six bits, and 20 of them have three ones and three zeroes. Ten of those are used to represent digits on the left half of the code, and ten are used to represent digits on the right.

The one feature of UPC code which makes it difficult to process, and I'm not sure how this was handled, is the possibility of having up to three consecutive zero bits. I would guess that if the inventor of UPC had thought of interleaving pairs of digits, an interleaved 2-of-5 format might have been used instead (though perhaps with other start/end sentinels), since it offers the same data density while only using two widths of bar and space. I suspect that in practice capturing the bit rate for UPC data would not have been a problem for a laser scanner which could use one pass to measure the data rate (originally each code would have always had the same number of bars and spaces, stored in the same number of "pixels", so measuring the time between the start and end sentinels and dividing by the number of pixels would have given the time per bit). Reading UPC is harder for a single-pass handheld wand, but I don't know how common those were expected to be.

7
  • I'm interested how it was all done using the early 1970s computer technology. Was the bit rate comparable to the bit rate of the cassette tape encodings (~2Kbaud) or substantially different; was there any pre-processing of the bitstream (e.g. run-length encoding) before sending it to the CPU, etc. And you're right, handheld wands are a completely different game.
    – Leo B.
    Apr 25, 2017 at 23:43
  • @LeoB.: If a laser takes about 10ms to scan a barcode (I suspect they ranged from being faster than that to being slower, though I don't know the average) the raw data rate would be 10,000 bits/second. Thinking about it, a state machine and had a couple of attached shift registers which was running around 1MHz could probably do a decent job of timing the pulses and breaking out the bits, though I don't know that such techniques were used before Woz used them on his floppy-drive controller.
    – supercat
    Apr 26, 2017 at 14:24
  • 1
    PLLs (en.wikipedia.org/wiki/Phase-locked_loop) are a standard technique for locking on to signal transitions, and can effectively tell you how many zero bits there were in a run. It's an old analogue technique (which can also now be done in the digital domain) and well within the abilities of 1970s technology. The NCR255 probably used one, but I have no way of checking for sure.
    – pndc
    Apr 26, 2017 at 19:16
  • 1
    @pndc: Most kinds of PLL require a stable frequency reference. Once one has derived a signal at the correct bit rate, one could use transitions that were slightly early or late of expectations to adjust it, but getting a frequency lock from a couple cycles of a PLL is apt to be really hard. If the required quiet zone time on the smallest/fastest barcode would be well over 4 bit times on the largest/slowest, a state machine could be more effective.
    – supercat
    Apr 26, 2017 at 20:08
  • 1
    @pndc: Given e.g. an 8-bit synchronous counter which can either advance or reset on each clock cycle, a 6-bit capture register which grabs the upper 6 bits of the counter, and comparator which can check whether the capture register matches the lower 6 bits of the counter, the required state machine should be pretty simple. Time the first two transitions, and load their combined duration (shifted right 2 bits) into the capture register to set the counter's timeout period to half a bit time. That should yield accuracy good enough to classify measure transitions to the nearest half-bit-time.
    – supercat
    Apr 26, 2017 at 20:30
5

You can see a picture of the first checkout system with barcode from National Cash Register, the NCR 255, here. It uses a laser scanner, and as the shown newspaper article explains, an NCR 726 minicomputer in a backroom controls the whole system.

Here is a bigger picture of the NCR 255 point of sale terminal, and a picture of the NCR 725 (hopefully not too different from the NCR 726) is here.

It's probably impossible to find out how it exactly was implemented. A laser scanner using mirrors shouldn't have a lot of variation in scanning speed, and I can imagine the bright-dark decoding was handled by dedicated hardware in the POS terminal. The density of bar codes is a lot lower compared to magnetic tape, and the contrast of the bar code stands out against everything else on the scanned package, so I don't see why it should need hundreds of sync pulses. Scanning twice in a cross makes sure the data is correct. The UPC barcode encoding really isn't that complex.

2
  • It is unclear if NCR 726 was getting a raw bitstream from the laser, or already decoded decimal digits. It is a pity that the original code is likely lost.
    – Leo B.
    Apr 25, 2017 at 23:08
  • Yes, it's totally unclear. But judging from the way all other peripherals (disk, tape) worked at the time, my guess is "decoded digits".
    – dirkt
    Apr 26, 2017 at 5:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .