Close-up of a CPU

Register Renaming: The Art Of Parallel Processing

In the quest for faster computing, modern CPUs have turned to innovative techniques to optimize instruction execution. One such technique, register renaming, is a crucial component that helps us achieve the impressive multi-tasking abilities of modern processors. If you’re keen on hacking or tinkering with how CPUs manage tasks, this is one concept you’ll want to understand. Here’s a breakdown of how it works and you can watch the video, below.

In a nutshell, register renaming allows CPUs to bypass the restrictions imposed by a limited number of registers. Consider a scenario where two operations need to access the same register at once: without renaming, the CPU would be stuck, having to wait for one task to complete before starting another. Enter the renaming trick—registers are reassigned on the fly, so different tasks can use the same logical register but physically reside in different slots. This drastically reduces idle time and boosts parallel tasking. Of course, you also have to ensure that the register you are using has the correct contents at the time you are using it, but there are many ways to solve that problem. The basic technique dates back to some IBM System/360 computers and other high-performance mainframes.

Register renaming isn’t the only way to solve this problem. There’s a lot that goes into a superscalar CPU.

Continue reading “Register Renaming: The Art Of Parallel Processing”

Signal Processing Shenanigans: The Createc SC 01 Pocket Oscilloscope

If you’re passionate about signal processing and retro tech, you’ll want to check out the Createc SC 01, a quirky handheld oscilloscope that recently caught the eye of [Thomas Scherrer] from OZ2CPU Teardown. This device, cheekily dubbed a “signal computer,” promises to be both intriguing and, perhaps, frustrating. You can view [Thomas]’ original teardown video here.

This device is packed with buttons and a surprisingly retro aesthetic that can make even the most seasoned hacker feel nostalgic. With a sample rate of 20 MHz and a bandwidth of up to 10 MHz, it’s a digital oscilloscope with a twist. Users may find its setup challenging, thanks to a somewhat convoluted manual that boasts numerous errors. However, beneath the confusion lies the potential for creative exploration: this signal computer can analyse analog signals, perform calculations, and even store data.

Despite its quirks, the SC 01 is sure the experience. Imagine troubleshooting a circuit while grappling with its unpredictable user interface—an adventure in itself for those who like a techy challenge.

The Createc SC 01 is not just another tool; it’s an invitation to embrace the imperfections of vintage tech. If you enjoy the hands-on learning process and don’t shy away from a few hiccups, this device might be something you’ll enjoy. Hackaday featured an article on similar devices last year.

Continue reading “Signal Processing Shenanigans: The Createc SC 01 Pocket Oscilloscope”

Cockroaches In Space: Waste Processing And A Healthy Protein Source Combined

As the current frontier of humanity in space, the International Space Station is heavily reliant on Earth not only for fresh supplies but also as a garbage disposal service for the various types of waste produced on the ISS by its human occupants. As future manned missions take humans further away from Earth, finding ways to reprocess this waste rather than chucking it out of the nearest airlock becomes a priority. One suggested solution comes from a Polish company, Astronika, with their insect bioreactor that can process organic material into useful biomass.

Interestingly, the cockroach species picked was the Madagascar hissing cockroach, one of the largest (5 – 7.5 cm) species. This is also a cockroach species which is often kept as a pet. In this closed-loop bioreactor that Astronika has developed, these cockroaches would chew their way through up to 3.6 kg of waste per week in the large version, with the adult cockroaches presumably getting turned into fresh chow and various materials at some point. Beyond the irrational ‘yuck’ factor that comes with eating insect protein, one of the biggest issues we can see with this system is that the long-duration mission crew may get attached to the cockroaches, as they are rather cute.

Continue reading “Cockroaches In Space: Waste Processing And A Healthy Protein Source Combined”

Colour Film Processing For The 2020s Hacker

We’re now somewhere over two decades since the mass adoption of digital photography made chemical film obsolete in a very short time, but the older technology remains in use by artists and enthusiasts. There’s no longer a speedy developing service at you local mall though, so unless you don’t mind waiting for one of the few remaining professional labs you’ll be doing it yourself. Black-and-white is relatively straightforward, but colour is another matter. [Jason Koebler] has set up his own colour processing lab, and takes us through the difficult and sometimes frustrating process.

From an exhaustive list of everything required, to a description of the ups and downs of loading a Patterson tank and the vagiuaries of developer chemicals, we certainly recognise quite a bit of his efforts from the Hackaday black-and-white lab. But this is 2024 so there’s a step from days past that’s missing. We no longer print our photos, instead we scan the negatives and process then digitally, and it’s here that some of the good advice lies.

What this piece shows us is that colour developing is certainly achievable even if the results in a home lab can be variable. If you’re up for trying it, you can always automate some of the process.

Linux Fu: Preprocessing Beyond Code

If you glanced at the title and thought, “I don’t care — I don’t write C code,” then hang on a minute. While it is true that C has a preprocessor and you can notoriously do strange and — depending on your point of view — horrible or wonderful things with it, there are actually other options and you don’t have to use any of them with a C program. You can actually use the C preprocessor with almost any kind of text file. And it’s not the only preprocessor you can abuse this way. For example, the m4 preprocessor is wildly complex, vastly underused, and can handle C source code or anything else you care to send to it.

Definitions

I’ll define a preprocessor as a program that transforms its input file into an output file, reacting to commands that are probably embedded in the file itself. Most often, that output is then sent to some other program to do the “real” work. That covers cpp, the C preprocessor. It also covers things like sed. Honestly, you can easily create custom preprocessors using C, awk, Python, Perl, or any other programming language. There are many other standard programs that you could think of as preprocessors, for example, tr. However, one of the most powerful is made to preprocess complex input files called m4. For some reason — maybe because of its complexity — you don’t see much m4 in the wild.

Continue reading “Linux Fu: Preprocessing Beyond Code”

The Python documentation for str.strip().

Faster String Processing With Bloom Filters

At first, string processing might seem very hard to optimize. If you’re looking for a newline in some text, you have to check every character in the string against every type of newline, right? Apparently not, as [Abhinav Upadhyay] tells us how CPython does some tricks in string processing.

The trick in question is based on bloom filters, used here to quickly tell whether a character possibly matches any in a predefined set. A bloom filter works by condensing a set of more complex data to a couple of bits in an array. When an element is added, a bit is set, the index of which is determined by a hash function. To test whether an element might be in the filter, the same is done but by testing the bit instead of setting it. This effectively allows a fast check of whether an element might be in the filter.

CPython doesn’t stop optimizing there: instead of a complicated hash function, it simply uses the lowest 6 bits. It also has a relatively small bit array at only 64 bits which allows it to avoid memory all together, which in turn makes the comparisons much faster. [Abhinav] goes far into more detail in his article, definitely worth a read for any computer scientists among us.

Nowadays there is ever increasing amounts of talk about AI (specifically large language models), so why not apply an LLM to Python to fix the bugs for you?

Fork And Run: The Definitive Guide To Getting Started With Multiprocessing

Since the early 2000s, the CPU industry has shifted from raw clock speed to core counts. Pat Gelsinger famously took the stage in 2002 and gave the talk the industry needed, stating processors needed specialty silicon or multiple cores to reduce power requirements and spread heat. A few years later, the Core series was introduced with two or four-core configurations to compete with the AMD Athlon 64 x2.

Nowadays, we’re seeing heterogeneous chip designs with big and little cores, chiplets, and other crazy fabrication techniques that are fundamentally the same concept: spread the thermal load across multiple pieces of silicon. This writer is willing to put good money into betting that you’ll see consumer desktop machines with 32 physical cores in less than five years. It might be hard to believe, but a 2013 Intel Haswell i7 came with just four cores compared to the twenty you’ll get in an i7 today. Even an ESP32 has two cores with support in FreeRTOS for pinning tasks to different cores. With so many cores, how to even write software for that? What’s the difference between processes and threads? How does this all work in straight vanilla C98?

Continue reading “Fork And Run: The Definitive Guide To Getting Started With Multiprocessing”