Do we add the parity bit to the front or the back of the bit set? A bit that acts as a check on a set of binary values, calculated in such a way that the number of 1s in the set plus the parity bit should always be even (or occasionally, should always be odd).

有帮助吗?

解决方案

It doesn't matter as long as you are consistent. If at the end, it can be computed and added 'on the fly' without having to make two passes through the data.

Parity is an extremely weak method of error detection. There are much better methods. Unless you are constrained to use parity, you should look for other choices that can catch more kinds of errors or even do error correction.

其他提示

At least traditionally in modem communications, the high bit of a byte was used as the parity bit, with the 7 lowest bits being used to encode an ASCII character.

So the letter A would be encoded as

01000001

Where the leading 0 is the parity bit (assuming even parity).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top