Last updated by Roedy Green ©1996-1999 Canadian Mind Products.
Stuck in a frame? Click here to break out.
Most memory sold now-a-days does not have even error detection logic, much less error correction. When you get an error, the program continues, but with wrong information. This may not be all that important if you are just playing a game, but it could be crucial if you are doing an income tax return. Parity memory is a very simple form of error detection without correction. Because of alpha particle emissions, memory can be expected to make errors every so often, even when it is functioning perfectly.
It may seem like magic, but this will give you the gist of how it works. Imagine I had ten slips of paper each with a number written on them. I made an eleventh slip with the sum of the numbers. I then hand out the slips to people in the audience. Then, at random we select a person and they destroy their slip without showing it to anyone. How would you reconstruct the missing slip from the information on the remaining ten? Hint: add up the remaining slips and compare it with the total.
The actual schemes use much more complicated math than simple addition, but work on the same general principle.
Encoding name | Description |
---|---|
8859_1 | Latin-1 ASCII (the default). This just takes the low order 8 bits and tacks on a high order 0 byte. |
Big5 | Chinese |
Cp1250 .. Cp1258 | Windows code pages. Code sets for various versions of Windows. For example, the Microsoft J++ JVM uses cp1252 for the English version of NT. |
Default | 7-bit ASCII (not the actual default!) Strips off the high order bit 7 and tacks on a high order 0 byte. |
GB2312 | Chinese |
JIS | Japanese |
JIS0208 | Japanese |
KSC5601 | Korean |
SingleByte | This does not expand low order eight-bits with high order zero as its name implies. It looks to be a complex encoding for some Asian language. |
SJIS | Shift JIS. Japanese. A Microsoft code that extends csHalfWidthKatakana to include kanji by adding a second byte when the value of the first byte is in the ranges 81-9F or E0-EF. |
UTF8 | counted strings |
public class Vegetable { public static final int unknown = 0; public static final int beet = 1; public static final int brocolli = 2; public static final int carrot = 3; } // end class Vegetable public class JuiceBar { public void mixIn (int v) { switch (v) { case Vegetable.brocolli: ... break; case Vegetable.carrot: ... break; default: ... } } // end mixIn } // end class Juicebar
public class Vegetable { protected Vegetable () { /* constructor has no fields to initialise */ } public static final Vegetable unknown = new Vegetable(); public static final Vegetable beet = new Vegetable(); public static final Vegetable brocolli = new Vegetable(); public static final Vegetable carrot = new Vegetable(); } // end class Vegetable public class JuiceBar { public void mixIn (Vegetable v) { if (v == Vegetable.brocolli) ... } ... } // end class JuiceBar
![]() |
![]() |
![]() | |
![]() |
Canadian Mind Products | You can get an updated copy of this page from http://mindprod.com/jglosse.html | The Mining Company's
Focus on Java Best of the Net Award |