Question

Is it possible that a computer gives a wrong result due to hardware error? For example, if I told the CPU to calculate 6 times 9 (both integer) for many times, will all the calculations give the correct answer? If there is the possibility that some of the calculations go wrong, why is that, and is there any mechanism that blocks the wrong answer inside the CPU?

Was it helpful?

Solution

There are a few possibilities:

  1. Operating the CPU outside of specification could result in erratic behavior (such as too much heat, too much voltage)

  2. If an interrupt fires in the middle of a non-atomic operation, and the interrupt modifies the result, weird behavior could happen. (For example: if you're attempting a 16-bit operation on a 8-bit processor. Perhaps you are calculating A * B, but you have a timer that fires and changes the value of A halfway through the multiplication. This is really considered a software bug, not a fault.

  3. There's always cosmic rays. Chips are so small these days that you can't really blame any problems on them, but they are a concern if you have a multi-year autonomous system.

As for preventing faults, during the Space Race, the launch computer used triple-redundant logic to verify every computation. STMicroelectronics has a line of fault-tolerant dual-core microcontrollers that run both cores with the same code, and a fault condition arises if either core disagrees.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top