Hash Functions With The Golden Ratio

In the realm of computer science, it’s hard to go too far without encountering hashing or hash functions. The concept appears throughout security, from encryption to password storage to crypto, and more generally whenever large or complex data must be efficiently mapped to a smaller, fixed-size set. Hashing makes the process of looking for data much faster for a computer than performing a search and can be incredibly powerful when mastered. [Malte] did some investigation into hash functions and seems to have found a method called Fibonacci hashing that not only seems to have been largely forgotten but which speeds up this lookup process even further.

In a typical hashing operation, the data is transformed in some way, with part of this new value used to store it in a specific location. That second step is often done with an integer modulo function. But the problem with any hashing operation is that two different pieces of data end up with the same value after the modulo operation is performed, resulting in these two different pieces of data being placed at the same point. The Fibonacci hash, on the other hand, uses the golden ratio rather than the modulo function to map the final location of the data, resulting in many fewer instances of collisions like these while also being much faster. It also appears to do a better job of using the smaller fixed-size set more evenly as a consequence of being based around Fibonacci numbers, just as long as the input data doesn’t have a large number of Fibonacci numbers themselves.

Going through the math that [Malte] goes over in his paper shows that, at least as far as performing the mapping part of a hash function, the Fibonacci hash performs much better than integer modulo. Some of the comments mention that it’s a specific type of a more general method called multiplicative hashing. For those using hash functions in their code it might be worth taking a look at either way, and [Malte] admits to not knowing everything about this branch of computer science as well but still goes into an incredible amount of depth about this specific method. If you’re more of a newcomer to this topic, take a look at this person who put an enormous bounty on a bitcoin wallet which shows why reverse-hashing is so hard.

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”

Stacking Solar Cells Is A Neat Trick To Maximise Efficiency

Solar power is already cheap and effective, and it’s taking on a larger role in supplying energy needs all over the world. The thing about humanity, though, is that we always want more! Too much, you say? It’s never enough!

The problem is that the sun only outputs so much energy per unit of area on Earth, and solar cells can only be so efficient thanks to some fundamental physical limits. However, there’s a way to get around that—with the magic of tandem solar cells!

Continue reading “Stacking Solar Cells Is A Neat Trick To Maximise Efficiency”

A Smarter Solar Water Heater

Installing solar power at a home is a great way to reduce electricity bills, especially as the cost of solar panels and their associated electronics continue to plummet. Not every utility allows selling solar back to the grid, though, so if you’re like [Rogan] who lives in South Africa you’ll need to come up with some clever tricks to use the solar energy each day while it’s available to keep from wasting any. He’s devised this system for his water heater that takes care of some of this excess incoming energy.

A normal water heater, at least one based on electric resistive heaters, attempts to maintain a small range of temperatures within the insulated tank. If the temperature drops due to use or loss to the environment, the heaters turn on to bring the temperature back up. This automation system does essentially the same thing, but allows a much wider range of temperatures depending on the time of day. Essentially, it allows the water heater to get much hotter during times when solar energy is available, and lets it drop to lower values before running the heater on utility electricity during times when it isn’t. Using a combination ESP32 and ATtiny to both control the heater and report its temperature, all that’s left is to program Home Assistant to get the new system to interact with the solar system’s battery charge state and available incoming solar energy.

While it’s an elegantly simple system that also affords ample hot water for morning showers, large efficiency gains like this can be low-hanging fruit to even more home energy savings than solar alone provides on paper. Effectively the water heater becomes another type of battery in [Rogan]’s home, capable of storing energy at least for the day in the form of hot water. There are a few other ways of storing excess renewable energy as well, although they might require more resources than are typically available at home.

British Hospital Blasts Through Waiting Lists By Slashing Surgeon Downtime

It feels like it doesn’t matter where you go, health systems are struggling. In the US, just about any procedure is super expensive. In the UK and Australia, waiting lists extend far into the future and patients are left sitting in ambulances as hospitals lack capacity. In France, staff shortages rage furiously, frustrating operations.

It might seem like hope is fruitless and there is little that can be done. But amidst this horrid backdrop, one London hospital is finding some serious gains with some neat optimizations to the way it handles surgery, as The Times reports.

Continue reading “British Hospital Blasts Through Waiting Lists By Slashing Surgeon Downtime”

Formation Flying Does More Than Look Good

Seeing airplanes fly in formation is an exciting experience at something like an air show, where demonstrations of a pilot’s skill and aircraft technology are on full display. But there are other reasons for aircraft to fly in formation as well. [Peter] has been exploring the idea that formation flight can also improve efficiency, and has been looking specifically at things like formation flight of UAVs or drones with this flight planning algorithm.

Aircraft flying in formation create vortices around the wing tips, which cause drag. However, another aircraft flying through those vortices will experience less drag and more efficient flight. This is the reason birds instinctively fly in formation as well. By planning paths for drones which will leave from different locations, meet up at some point to fly in a more efficient formation, and then split up close to their destinations, a significant amount of energy can potentially be saved. Continue reading “Formation Flying Does More Than Look Good”

Liquid Neural Networks Do More With Less

[Ramin Hasani] and colleague [Mathias Lechner] have been working with a new type of Artificial Neural Network called Liquid Neural Networks, and presented some of the exciting results at a recent TEDxMIT.

Liquid neural networks are inspired by biological neurons to implement algorithms that remain adaptable even after training. [Hasani] demonstrates a machine vision system that steers a car to perform lane keeping with the use of a liquid neural network. The system performs quite well using only 19 neurons, which is profoundly fewer than the typically large model intelligence systems we’ve come to expect. Furthermore, an attention map helps us visualize that the system seems to attend to particular aspects of the visual field quite similar to a human driver’s behavior.

 

Mathias Lechner and Ramin Hasani
[Mathias Lechner] and [Ramin Hasani]
The typical scaling law of neural networks suggests that accuracy is improved with larger models, which is to say, more neurons. Liquid neural networks may break this law to show that scale is not the whole story. A smaller model can be computed more efficiently. Also, a compact model can improve accountability since decision activity is more readily located within the network. Surprisingly though, liquid neural network performance can also improve generalization, robustness, and fairness.

A liquid neural network can implement synaptic weights using nonlinear probabilities instead of simple scalar values. The synaptic connections and response times can adapt based on sensory inputs to more flexibly react to perturbations in the natural environment.

We should probably expect to see the operational gap between biological neural networks and artificial neural networks continue to close and blur. We’ve previously presented on wetware examples of building neural networks with actual neurons and ever advancing brain-computer interfaces.

Continue reading “Liquid Neural Networks Do More With Less”