Simplifying Slide Rule Calculations With Trig

[Bob the Science Guy] remembers how to use a slide rule. Even after all these years, it is pretty easy to remember how to multiply and divide. If you can’t remember, you can usually work it out, as long as you understand how slide rules work. But what about sine, cosine, and quadratics? [Bob’s] been making videos about topics like this, and if you’ve wanted to put your slide rule collection to practical use, you’ll enjoy these videos. You can see one below.

The trick to the slide rule is that it is deceptively simple. You are in effect adding logarithms and then taking an antilog. The issue is that you still have to have some intuition about the scale of the answer since 2×3 works out the same as 2×3000 or 200×300.

Continue reading “Simplifying Slide Rule Calculations With Trig” →

The 10€ Gamepad

We aren’t sure what [Lazy_Duck] is doing with video games, but it must require a lot of controllers. Dismayed at the cost and complexity of commercial gamepads, they started soldering and 3D printing to get a cheaper basic controller.

The emphasis is on throwing things together, so there’s no dedicated PCB. Just a protoboard with an RP2040-Zero, a joystick, a few buttons, and a microswitch. A 3D-printed case rounds out the project.

Continue reading “The 10€ Gamepad” →

What’s A Nonius?

If you already know what a nonius is, you can probably skip this post. But, if like us, you would have to look it up, we’ll tell you what we found out. It turns out, a translation mistake taught us a new word and some history we weren’t aware of.

In the manual, this is captioned: Figure 4-7 Nonius Display (Standard Mode)

Have a look at the adjacent graphic from a waveform display. What would you call the vertical red lines at positions 139 and 200?

We’d probably call them markers. Or maybe cursors. The manual, however, calls each one a “nonius”. It refers to them that way multiple times.

Oddly, the manual also has sentences like “Select one nonius and right-click, and then select ‘Remove Marker’ in the next window to delete the nonius.”

So, clearly, a nonius is the vertical line marker or cursor. But that, of course, begs a question…

What is a Nonius?

“Nonio originale” by [Henrique Leitão]
Have you ever heard of the vernier scale? If you’ve done navigation, used a traditional caliper, or tuned an old shortwave receiver, you probably have. [Pierre Vernier] developed it in 1631 as a way to better interpolate values on a scale.

However, there was an earlier version used to improve measurements on astrolabes. A Portuguese navigator named [Pedro Nunes] created this type of astrolabe in 1542. The Latinized version of his name is [Petrus Nonius]. What are the odds of him inventing… oh wait, they named it after him. That does make more sense.

The nonius is a series of concentric circles traced on the instrument. Working towards the center, each circle has fewer divisions than the previous one. In fact, if the outer ring had 90 marks for 90 degrees, the next ring would have 89, and the following one would have 88.

Continue reading “What’s A Nonius?” →

The FPGA Chronicles: Ready To Probe

In the last few installments, we looked at using the Tang Nano 20K with both the GOWIN tools and some open-source tools. The open-source tools certainly had the advantage of letting you simulate and debug your design before sending it to the actual chip. However, as we’ll see, the GOWIN tools include a very easy-to-use, capable logic analyzer.

Setup

First, you’ll need a GAO config file. When you create one in the editor, you are given a number of complex options. With an active GAO file, the tool builds a logic analyzer into your design, and the file sets the trigger conditions.

Here’s a tip. You can only have one active GAO file. Sometimes you don’t want the logic analyzer. Other times you might want an alternate configuration. If you right-click almost any file in the IDE’s Design tab, you’ll see you can disable it. That gives it a big red X and excludes it from future builds. Well, at least until you enable it again. This lets you pick between multiple GAO files, or even multiple Verilog files, for a particular build (e.g., one for tests and another for production).

If you create a GAO file from scratch, it will ask you if you want “Lite Mode.” As far as I can tell, you will never want this mode. Always use Standard Mode. In addition, you nearly always want RTL mode, which shows you (mostly) the symbols you’ve defined and not the ones added during processing.

You can find the entire manual online, of course. However, the video below and the rest of the post will get you started quickly.

GAO Basics

To set up probing, we need to understand the design, so the rest of this post covers the Verilog we’ll use to test the logic analyzer feature, and you’ll see how the analyzer works in a video. Here are a few sneak peeks at what the analyzer output we’ll see at the end looks like:

The left-hand image shows the pulse that flips the LEDs, which is tricky because the sampling clock is 27 MHz. The right-hand side shows serial data and uses a slower clock specifically used for debugging.

Continue reading “The FPGA Chronicles: Ready To Probe” →

Your Computer Memory Is A Lie

When you first learn to program, memory seems pretty straightforward. You have a bunch of bytes, each with an address. If you want to read or write something, you specify the address, and the computer goes to that place and does your bidding. Sure, some addresses might be reserved for hardware or the operating system, but the general idea is simple: memory is a big array of bytes.

Just like we pretend that a wire is a perfect conductor, the big array of memory model used to be a slight twisting of the truth. On a modern computer, however, it is almost entirely a lie. The address you use probably isn’t a physical address. The data you read might not come from RAM at all. Even if it does, it might be sitting in one of several caches. And if you follow the rabbit hole far enough, you discover that your SSD is arguably just another level in the memory hierarchy.

The Need For Speed

The fundamental problem is that processors have gotten much faster than memory. A modern processor can execute several instructions per clock cycle, but accessing ordinary DRAM can take hundreds of cycles. If the processor had to wait for RAM every time it needed data, much of that impressive computing power would go to waste.

The solution is caching. Keep copies of frequently used data in smaller, faster memories closer to the processor. Most modern desktop processors have at least three levels of cache. The L1 cache is tiny but extremely fast, and often split between instructions and data. L2 is larger and somewhat slower, while L3 is even larger and usually slower as well.

Continue reading “Your Computer Memory Is A Lie” →

A Free Cloud AI

If you would like an AI “personal agent” but don’t want your data on some opaque cloud computer, there’s a new option that appears to be somewhat nicer: [rociiu] has talorys, an AI agent that runs in your Cloudflare account. True, it is still on a cloud computer, but it is your account on a cloud computer. It is designed so you can use it on Cloudflare’s free account with reasonable limits, and the code running is all on GitHub, so you can — if you are so inclined — look to see what it is doing. The data, too, is all in your cloud instance.

This seems like a reasonable compromise. Cloudflare provides the hosting, and the software in your virtual computer does all the work. At least, that’s how it is promoted. Honestly, we haven’t combed over the code, but the assertion is “Free-tier friendly… no telemetry.”

We are fairly sure they are using Cloudflare’s AI engines, too, so it would be interesting to see how much of your data they could, in theory, harvest in transit. Of course, your data is still in the cloud, so if you are really worried about privacy, this might not be for you. But since everything is in your account and open, you can at least have more control over what’s there. For example, you can easily download or delete your data. You can even see exactly what prompts it uses.

Continue reading “A Free Cloud AI” →

Thorium Clocks Start Ticking With Lasers

Atomic clocks are super accurate. But, unsurprisingly, some atomic clocks are better than others, depending on your definition of better. Researchers at Vienna University claim to have a superior thorium-based atomic clock. It isn’t necessarily more accurate than other atomic clocks, but it is self-regulating.

Apparently, prior atomic clocks need help to stay stable. But scientists have thought that thorium, with its very narrow gap between two states, would make an excellent clock with the help of a laser. However, the laser has to have precise properties that, at least in early experiments, were provided by another nuclear clock.

Obviously, you’d like to be able to use a laser to excite the source — a thorium crystal in this case — and then use the output of that to adjust the laser. That’s apparently what the team has done. If the laser drifts, the thorium nuclei absorb less light, and that adjusts the output frequency to compensate. If you can follow the physics, you can read the source paper in Nature.

Optical atomic clocks are the way to go for time standards, but this research has promise to provide even more accurate results in the future.