Joost Bürgi And Logarithms

Logarithms are a common idea today, even though we don’t use them as often as we used to. After all, one of the major uses of logarithms is to simplify computations, and computers do that just fine (although they might use logs internally). But 400 years ago, doing math was painful. Enter Joost Bürgi. According to [Welch Labs], his book of mathematical tables should have changed math forever. But it didn’t.

If you know how a slide rule works, you’ll find you already know much of what the video shows. The clockmaker was one of the people who worked out how logs could simplify many difficult equations. He created a table of 23,030 “red and black” numbers to nine digits. Essentially, this was a table of logarithms to a very unusual base: 1.0001.

Why such a strange base? Because it allowed interpolation to a higher accuracy than using a larger base. Red numbers are, of course, the logarithms, and the black numbers are antilogs. The real tables are a bit hard to read because he omitted digits that didn’t change and scaled parts of it by ten (which was changed in the video below to simplify things). It doesn’t help, either, that decimal points hadn’t been invented yet.

What was really impressive, though, was the disk-like construct on the cover of the book. Although it wasn’t mentioned in the text, it is clear this was meant to allow you to build a circular slide rule, which [Welch Labs] does and demonstrates in the video.

Unfortunately, the book was not widely known and Napier gets the credit for inventing and popularizing logarithms. Napier published in 1614 while Joost published in 1620. However, both men likely had their tables in some form much earlier. However, Kepler knew of the Bürgi tables as early as 1610 and was dismayed that they were not published.

While we enjoy all kinds of retrocomputers, the slide rule may be the original. Want to make your own circular version? You don’t need to find a copy of this book.

Continue reading “Joost Bürgi And Logarithms”

Count Leading Zeros For Efficient Logarithms

[Ihsan Kehribar] points out a clever trick you can use to quickly and efficiently compute the logarithm of a 32-bit integer. The technique relies on the CLZ instruction which counts the number of leading zeros in a machine word and is available in many modern processors. Typical algorithms used to compute logarithms are not quick and have a variable execution time depending on the input value. The technique [Ihsan] is using is both fast and has a constant run time.

The above equation summarized the math behind the algorithm. We get the first term easily using the CLZ instruction. Using the remainder and a pre-computed lookup table, it is possible to get the second term to various degrees of accuracy, depending on how big you make the table and whether or not you take the performance hit of interpolation or not — those of a certain age will no likely groan at the memory of doing interpolation by hand from logarithm tables in high school math class. [Ihsan] has posted an MIT-licensed implementation of this technique in his GitHub repository, which includes both the C-language algorithm and Python tools to generate the lookup table and evaluate the errors.

Why would you do this? Our first thought was real-time streaming DSP operations, where you want fast and deterministic calculations, and [Ihsan]’s specifically calls out embedded audio processing as one class of such applications. And he should know, after all, since he developed a MIDI capable polyphonic FM synthesizer on a Cortex M0 that we covered way back in 2015.

Rubber Band “Slide Rule” Doesn’t Slide, But Rotates

Around here we mostly enjoy slide rules. We even have our own collections including some cylindrical and circular ones. But [Mathologer] discusses a recent Reddit post that explains a circular slide rule-like device using a wheel and a stretchable rubber band. While it probably would be difficult to build the actual device using a rubber band, it can do wonders for your understanding of logarithms which still show up in our lives when, for example, you are calculating decibels. [Dimitri] did simulate the rubber band for you in software.

The idea is that a perfect rubber band has numbers from 0 to 10 evenly marked on it. As you rotate a wheel attached at the 10 mark, the rubber band stretches more and more. So the 10 and the 9 have relatively little space between them, but the 1 and the 2 are much further apart. The wheel’s circumference is set so that the 1 will exactly overlay the 10. What this means is that each spot on the wheel can represent any number that differs only by a decimal point. So you could have 3 mean 0.03, 300, or — of course — 3. Of course, you don’t need to build the wheel with a rubber band — you could just mark the wheel like a regular circular slide rule.

Continue reading “Rubber Band “Slide Rule” Doesn’t Slide, But Rotates”

Vintage Console Becomes The Calculator It Appears To Be

What’s sitting on [Bob Alexander]’s desk in the video below did not start out life as the desktop calculator it appears to be. Turning it into a standalone calculator with features the original designers couldn’t imagine turned out to be an interesting project, and a trip down the retrocomputing rabbit hole.

A little explanation is in order. Sure, with its Nixie display, calculator keypad, and chunky mid-century design, the Wang 360 desktop console looks like a retro calculator. But it’s actually only a dumb terminal for a much, MUCH bigger box, called the Electronic Package, that would fit under a desk. The foot-warming part that was once connected to [Bob]’s console by a thick cable that had been unceremoniously lopped off by a previous owner. [Bob] decided to remedy the situation with modern electronics. The console turned out to have enough room for a custom PCB carrying a PIC32, some level-shifting components, power supply modules that include the high-voltage supply for the Nixies, and a GPS module because Nixies and clocks just go together. The interesting bit is the programming; [Bob] chose to emulate the original Wang methods of doing math, which include multiplication by logarithmic addition. Doing so replicates the original look and feel of the calculator down to the rapid progression of numbers across the Nixies as the logarithms are calculated using the display registers.

We normally frown on vintage gear being given modern guts, but in this case [Bob] hit just the right balance of new and old, And given that the Electronic Packages these consoles were connected to go for $1500 or more on eBay, it was a better choice than letting the console go to scrap. A similarly respectful approach was taken with this TRS80 Model 100 revival.

Continue reading “Vintage Console Becomes The Calculator It Appears To Be”

Bone Up On Your Multiplication Skills

John Napier was a Scottish physicist, mathematician, and astronomer who usually gets the credit for inventing logarithms. But his contributions to simplifying mathematics and building shorthand solutions didn’t end there. In the course of performing the many calculations he needed to practice these subjects in the 1500s, Napier invented a kind of computing mechanism for multiplication. It’s a physical manifestation of an old system known as lattice multiplication or gelosia.

Lattice multiplication makes use of the multiplication table in order to multiply huge numbers together quickly and easily. It is thought to have originated in India and moved west into Europe. When the lattice method reached Italy, the Italians named it gelosia after the trellised window covering it resembled, which was commonly used to keep prying eyes away from one’s possessions and wife.

Continue reading “Bone Up On Your Multiplication Skills”