In Praise Of RPN (with Python Or C)

HP calculators, slide rules, and Forth all have something in common: reverse polish notation or RPN. Admittedly, slide rules don’t really have RPN, but you work problems on them the same way you do with an RPN calculator. For whatever reason, RPN didn’t really succeed in the general marketplace, and you might wonder why it was ever a thing. The biggest reason is that RPN is very easy to implement compared to working through proper algebraic, or infix, notation. In addition, in the early years of computers and calculators, you didn’t have much to work with, and people were used to using slide rules, so having something that didn’t take a lot of code that matched how users worked anyway was a win-win.

What is RPN?

If you haven’t encountered RPN before, it is an easy way to express math without ambiguity. For example, what’s 5 + 3 * 6?  It’s 23 and not 48. By order of operations you know that you have to multiply before you add, even if you wrote down the multiplication second. You have to read through the whole equation before you can get started with math, and if you want to force the other result, you’ll need parentheses.

With RPN, there is no ambiguity depending on secret rules or parentheses, nor is there any reason to remember things unnecessarily. For instance, to calculate our example you have to read all the way through once to figure out that you have to multiply first, then you need to remember that is pending and add the 5. With RPN, you go left to right, and every time you see an operator, you act on it and move on. With RPN, you would write 3 6 * 5 +.

While HP calculators were the most common place to encounter RPN, it wasn’t the only place. Friden calculators had it, too. Some early computers and calculators supported it but didn’t name it. Some Soviet-era calculators used it, too, including the famous Elektronika B3-34, which was featured in a science fiction story in a Soviet magazine aimed at young people in 1985. The story set problems that had to be worked on the calculator.

Continue reading “In Praise Of RPN (with Python Or C)”

Fuel Cell Turns PET And Carbon Dioxide Into Useful Chemicals

The University of Cambridge has a novel fuel cell design that can grab CO2 from the atmosphere or industrial processes and, combined with waste PET plastic, provides syngas and glycolic acid, a product used in some cosmetics. You can read about the device in a recent paper.

The strange juxtaposition of CO2 and PET is no accident. The processes work together with solar energy. There is no external voltage required, but the cell operates as a photocell to produce electricity from the solar energy. Removing both CO2 and waste plastic from the environment is a good thing.

Syngas is hydrogen and carbon monoxide and finds use in producing methanol and ammonia. It also will work as a fuel that can replace gasoline when gasoline isn’t available. It has a few other uses, like reducing iron ore to sponge iron and even converting methanol to gasoline.

The technology has a ways to go to operate at scale, and we doubt this will ever be a consumer item since you are unlikely to need syngas or glycolic acid in your home or vehicle. But it still is a promising technique to reduce both greenhouse gas and plastic waste in one swoop.

We’ve looked at other ways to grab carbon dioxide and make it useful. If you want to make your own syngas, there are other ways to do it.

Cosmic Ray Navigation

GPS is a handy modern gadget — until you go inside, underground, or underwater. Japanese researchers want to build a GPS-like system with a twist. It uses cosmic ray muons, which can easily penetrate buildings to create high-precision navigation systems. You can read about it in their recent paper. The technology goes by MUWNS or wireless muometric navigation system — quite a mouthful.

With GPS, satellites with well-known positions beam a signal that allows location determination. However, those signals are relatively weak radio waves. In this new technique, the reference points are also placed in well-understood positions, but instead of sending a signal, they detect cosmic rays and relay information about what it detects to receivers.

The receivers also pick up cosmic rays, and by determining the differences in detection, very precise navigation is possible. Like GPS, you need a well-synchronized clock and a way for the reference receivers to communicate with the receiver.

Muons penetrate deeper than other particles because of their greater mass. Cosmic rays form secondary muons in the atmosphere. About 10,000 muons reach every square meter of our planet at any minute. In reality, the cosmic ray impacts atoms in the atmosphere and creates pions which decay rapidly into muons. The muon lifetime is short, but time dilation means that a short life traveling at 99% of the speed of light seems much longer on Earth and this allows them to reach deep underground before they expire.

Detecting muons might not be as hard as you think. Even a Raspberry Pi can do it.

Behind The X86 Pipeline Curtain

We’ve often heard that modern x86 CPUs don’t really execute x86 instructions. Instead, they decode them into RISC instructions that are easier to schedule, pipeline, and execute. But we never really looked into that statement to see if it is true. [Fanael] did, though, and the results are very interesting.

The post starts with a very simple loop containing four instructions. In a typical RISC CPU — RISC-V — the same loop requires six instructions. However, a modern CPU is likely to do much more than just blindly convert one instruction set to another.

Continue reading “Behind The X86 Pipeline Curtain”

Better Antennas Via Annealing (Simulated)

If you want to simulate a tic-tac-toe game, that’s easy. You can evaluate every possible move in a reasonable amount of time. Simulating antennas, however, is much harder. [Rosrislav] has been experimenting with using simulated annealing to iterate antenna designs, and he shares his progress in a recent blog post.

For many problems, it simply isn’t possible to try all possible inputs to determine what provides the “best” result. Instead of trying every single input or set of inputs, you can try random ones and discard all but the best guesses. Then you make small changes and try again. The only problem is that the algorithm may lock in on a “local maximum” — that is, a relatively high value that isn’t the highest because it forms a peak that isn’t the highest peak. Or, if you are looking for a minimum, you may lock on to a local minimum — same thing.

To combat that, simulated annealing works like annealing a metal. The simulation employs a temperature that cools over time. The higher the temperature, the more likely large changes to the input are to occur.

The Python program uses the PyNEC package to provide simulation. The program sets up random antenna lengths and finds the projected gain, attempting to optimize for maximum gain.

The post is long on code and short on details, so you will probably want to read the Python source to see exactly what it is doing. But it could probably serve as a template to do other simulated annealing simulations for other antennas or anything you had a simulation engine to evaluate.

Several techniques allow you to optimize things that are too hard to search exhaustively, and we’ve talked about simulated annealing and genetic algorithms before. However, lately, we’ve been more interested in annealing 3D prints.

Detecting Meteors With SDR

The simplest way to look for meteors is to go outside at night and look up — but it’s not terribly effective. Fortunately, there’s a better way: radio. With a software-defined radio and a little know-how from [Tech Minds], you can easily find them, as you can see in the video below.

This uses the UK meteor beacon we’ve looked at before. The beacon pushes an RF signal out so you can read the reflections from meteors. If you are too far from the beacon, you may need a special antenna or you might have to find another beacon altogether. We know of the Graves radar in France and we have to wonder if you couldn’t use some commercial transmitter with a little experimentation.

[Tech Minds] has some practical tips to share if you want to try doing it yourself. If you want to see what a detected meteor looks like, you can visit the UK beacon’s gallery page.

We saw another presentation on the UK beacon earlier this year. Using commercial transmitters sounds like it might be easy, but apparently, it isn’t.

Continue reading “Detecting Meteors With SDR”

If Not Ethernet…

It is hard to imagine today, but there was a time when there were several competing network technologies. There was Ethernet, of course. But you could also find token ring, DEC Net, EcoNet, and ARCNet. If you’ve never dug into ARCNet, [Retrobytes] has a comprehensive history you can watch that will explain it all.

Like token ring, ARCNet used a token-passing scheme to allow each station on the network to take turns sending data. Unlike token ring and Ethernet, the hardware setup was much less expensive. Along the way, you get a brief history of the Intel 8008 CPU, which, arguably, started the personal computer revolution.

Like most networking products of the day, ARCNet was proprietary. However, by the late 1980s, open standards were the rage, and Ethernet took advantage. Up until Ethernet was able to ride on twisted pairs, however, it was more expensive and less flexible than ARCNet.

The standard used RG-62/U coax and either passive or active hubs in a star configuration. The coax could be up to 2,000 feet away, so very large networks were feasible. It was also possible to share the coax with analog videoconferencing.

Looking back, ARCNet had a lot to recommend it, but we know that Ethernet would win the day. But [Retrobytes] explains what happened and why.

If you missed “old-style Ethernet,” we can show you how it worked. Or, check out EcoNet, which was popular in British schools.