About the ECC simulation

Andy Phelps
University of Wisconsin, Madison
November 15, 2006

This simulation allows you to specify a check matrix and see how well it behaves as an error correcting code.

All the clickable areas of the applet are outlined in colored rectangles. Feel free to click in any of these areas and see what they do.

Be aware that if you navigate away from the applet, and then back again, any changes you have made will be lost. There is no way to save your work with this applet, so plan accordingly.

Use the buttons "Fewer Data Bits", "More Data Bits", Fewer Checkbits", and "More Checkbits" to set the simulation to the desired size. If you're unsure, start with the default size of eight data and five checkbits.

To start with, look at the data flowing from the upper left rectangle (labeled, of course, "Data") across the top to the upper right. Try clicking a data bit; it will change, and the new value will be propagated to right side. To get there, it goes through a rectangle labeled "Harm's Way". This represents some unreliable storage or transmission medium (such as DRAM) that randomly flips bits in the data. If you click in this area, you can cause errors (shown by a little lightning bolt). Try this; now the data on the right side does not match the original data (shown with a red "X").

How to prevent that bad data? Well, you'll need an Error Correcting Code. Assuming you've already gotten the idea behind these codes from another document, here's how you'll set one up here.

Click in the "Check bit matrix" area. This adds or removes connections from the data bits into the XOR gates that form the checkbits. Each data bit should have a unique pattern of connections along its (vertical) wire.

Try this out: Starting with an empty matrix, click on the top two connections in the rightmost wire. This pattern, "1 1", is a binary 3, and indicates that the rightmost data bit now has the "name" of 3. On the syndrome decoder (on the right), you will see a wire added to the "3" output, which goes up and corrects the data bit. Thus a syndrome of "3" indicates that that data bit was in error.

You may optionally click on the output of each XOR gate in the check matrix, to invert the output. This changes the starting pattern (the all-zeros-data pattern) for the checkbits. It does not affect the meaning of the syndromes, but if you don't do this, the "hints" button (below) will complain mildly.

Once you've specified the complete check matrix, you will see a connections from the decoder to the correction XOR gates for each unique data name. Unused patterns are all OR'd together to indicate uncorrectable errors.

(If you have a large number of checkbits, the decoder will eventually get too big to draw. It's still there in the simulation, though.)

Now try out your error correcting code. Select some data to try sending by clicking on the data bits in the upper-left rectangle. Inject errors into data and/or check bits by clicking in the "harm's way" rectangle. If you cause a single error, your code (if it's working) will correct it and you will still see the original data reappear in the upper right. If your code isn't working, you'll see a red "X".

If your code does double error detection (SECDED instead of just SEC), try causing more than one error. The "UNCORRECTABLE" wire in the lower right should light up if your code has properly detected the errors. You may try causing three or more errors if you wish.

Seems to be working? Give it a real tryout -- click on "Try all single errors" or "Try all double errors". These will try all possible errors of the selected type, with a variety of data patterns. It will stop if some pattern fails; otherwise it will end with an "OK" message.

If you're not sure how to make your code work, or would like to make it better, try clicking on "Hints & Suggestions". Your configuration will be analyzed and one of a variety of helpful messages will appear. If your code is working, this button also prints a "checksum" in the lower left corner; this is really just a condensed representation of your check matrix which may be useful for reference purposes.