Bits in your PC can flip randomly
Published: 2022-06-14 19:17:17

We are emerging into a world of intense digitalization, where digital data prevails every aspect of our life. From monetary transactions to social status, from casual shopping to stock trading we are so much dependent on our gadgets making us a preliminary cyborg.
We have much faith in our digital data, and rely on them to record our account balances and vital information. Although they seem to be incorruptible because binary bits are more reliable than analog signals, some events in history might say otherwise.

## Belgium Elections, 2003
On **May 18, 2003** as voting was held in **Schaerbeek**, it was done on computers where the voters used an electronic card to cast their vote by inserting the card into the system and making the selection on the screen. Their selection was saved both on the computer and on the _magnetic card_. The magnetic cards were then dropped into a box storing backup data. A simple technique but something interesting happened on this particular day. 
When the results were checked later on the system, an unexpected anomaly was detected. A candidate named _Maria Vindevogel_ received more votes than was mathematically possible. The vote count was _4610_. So the officials had to manually check all the digital cards counting the votes of each candidate.
It was found that all the votes were absolutely correct except for Maria. Her actual votes count was _514_. This means the system count was _4096_ votes higher than the actual count.
So how could this happen? Later computer experts were brought to run tests on the software. They did thorough contemplation through the codes, but couldn't find any bug. Later the computer involved for the error was checked for hardware issue, but nothing was found and the system seemed to be working perfectly.

But the weird part was that the actual results were off by exactly **4096** which is equal to **2^12**. Now if we consider the bits involved in storing the vote count, it looks something like this for _514_.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wvpddu88sr3vpz799325.jpg)

But if we flip value of the _13th_ bit, it makes the record go up by a difference of _2^12_ , i.e. _4096_.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47zd4nw6k3zylcu3e33p.jpg)

Now as we know bit values are stored by small transistors, where a state of the transistor decides the value of bit to be either 1 or 0. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/quaxyfm0pnb806rw79qf.jpg)

But this doesn't happen naturally. Bits don't flip unless we make them do.

## Airbus A330 Event, 2008
On **October 7, 2008**, an Airbus was on it's course from _Singapore_ to _Perth_ faced some anomalies which resulted to be have somewhat similar cause. After few hours in it's course, the plane suddenly dived down _200m_ in _20secs_. Multiple passengers were injured and the pilots had to do an emergency landing.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yj6hl1u8xc1ajlz40hiu.jpg)

Later when the source of the cause was found, it was from the security protocol of the flight system. The information holding the critical data in case of emergency was stored in a 32 bit binary word. Now because of a single bit alteration of the word, _the altitude indicator_ value was switched to _angle of attack indicator_. 

The software read the data as an emergency condition and dived down 200 meters as a response to the virtual attack to maintain safer altitude.

So even this happened because of the mysterious bits flipping of the digital memory.

## Intel Chips, 1978
In 1978 **Intel** reported some strange errors in the _16KB DRAMs_ they produced. Random bits were flipped to zeros as the produced the chips with all the bits as ones, with unknown causes. The problem turned out to be because of the ceramic packaging of the semiconductors. This packaging was manufactured in a plant near the Green River in Colorado. Now the plant was located near an old Uranium mill, which was the source of uranium particles polluting the ceramic packages and thus coming in contact with the DRAMs.
Intel scientists later researched on this, and they found out that even traces of uranium particles can cause problem in the transistors. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lrhigafprbpu9gi2g8c7.jpg)

The alpha particles when hitting the semiconductors are capable to flip the state of the transistors, as they were creating electron hole pairs and loading electrons into the tunnel of the transistor. Thus changing the bit from 1 to 0. This is known as a **Single Event Upset** (SEU), which is a soft error created without damaging the machine and leaving no trace.
So it was the alpha particles.

## The Cause
So as per the research by the Intel scientists, the radioactive Uranium was the cause. But what's with the Voting machine and the Airbus? Where did they get the Uranium from?

During the early **1900**s scientists found that radiations were not just found near to the ground due to ground radiation, but also in high altitudes. And actually above an altitude of _1000m_  the radiation actually starts increasing. It even increases higher by several scales. High energy radiations were detected coming from the sky, but such scales of radiations were impossible to be created from the Sun. So where did they come from?

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4cr0cwcsfphje3af9n1j.jpg)

Today we know that these radiations are not electromagnetic but particles of kind: **protons**, **alpha particles** and **heavier nuclei**. Even though we receive some of these from the Sun, but they have very low energy. Such high energy cosmic rays come from Super Novae, and even Super Massive Black Holes.
It was later concluded that it were these high energy particles that created the bit flips, specially the neutrons. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nugm7408fjv5rm6o8vvi.jpg)

This is what flipped the 13th bit in the Voting machine giving _Maria Vindevogel_ , 4096 extra votes.

## The Solution
Now a days there are ways to handle these kind of SEU events. Chips contain error correction codes and ECC memories. They are quite useful but it is still very tough to prevent bit flips. 

Problems occur more when such digital systems have more exposure to high energy cosmic radiations, like the computers in the rockets. So they are made resilient by having 4 different CPUs running in parallel, identically to each other. So if one computer faces a SEU events, the rest of the 3 computers will take over and correcting the bit of the 1st computer. The Perseverance Mars Rovers has a different strategy. It uses old models of Computer system with circuits and design system were hardened enough to face radiation 40 times stronger than what normal PCs can handle. Several subsequent space missions followed the same.

## Conclusion
So events like this make us wonder how cosmic rays travelling light years of distance for millions of years can actually someday hit a transistor in your system and crash it. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fh3pohp1yv224tit5g5y.png)

And not just your Personal Laptop, the Servers in a certain data station storing our vital information, maybe even our account balances.