Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Parity checking

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
From a textbook:

"The parity bit is chosen so that the total number of 1's in a coded frame is even. We say that the coded frame has even parity."

From a basic explanation in a Web site:

"Computing parity involves counting the number of ones in a unit of data, and adding either a zero or a one (called a parity bit) to make the count even (for even parity) or odd (for odd parity).

For example, 1001 is a 4-bit data unit containing two one bits; since that is an even number, a zero would be added to maintain even parity,...."

To my surprise, :!: from AN 160 from Linx Technologies:

"A parity check is accomplished by adding all of the '1's in a string of bits. For even parity, if the number is even, then the parity bit is set, otherwise it is not."

(Bold formatting is mine)

Comments anyone?
 
That last bit can only be true if they are talking about a status bit in a status register. A status bit can be chosen to indicate either even or odd parity.
 
Sorry, I should have added the whole text. The AN it's not mentioning any status register but the byte to be xmitted.


The simplest form of error detection is the parity check. A parity check is accomplished by adding all of the '1's in a string of bits. For Even Parity, if the number is even, then the parity bit is set, otherwise it is not. For Odd Parity, if the number is odd, then
the parity bit is set.

Example 1:

In this example, we will calculate the parity of a byte that is to be transmitted using Even Parity. During transmission, one of the bits gets reversed. The
receiver catches this through the parity check at the reception end.

Transmitter:

10101010

There is an even number of '1's, so the parity bit is set and the byte is transmitted as follows:

101010101 <<<here you have a 5th bit which contradicts the concept of even counting
Receiver:

001010101

The last bit is not used in the parity calculation since it is the parity bit from the transmitter. Calculating parity on the received byte yields an odd number of
'1's and the parity is '0'. Since the receiver's parity calculation does not match the transmitter's calculation, the byte is determined to be errant and is thrown out.
 
Are you planning using a parity bit for something?, you should be aware that it offers the least amount of checking possible - and isn't really worth bothering with?.
 
Nigel Goodwin said:
Are you planning using a parity bit for something?, you should be aware that it offers the least amount of checking possible - and isn't really worth bothering with?.

No. Hamming code 7,4 instead, complemented with repetition (thrice) followed with majority vote. Could sound overkill for my IR link between two PICs but they are easily implemented in software.
 
atferrari said:
Nigel Goodwin said:
Are you planning using a parity bit for something?, you should be aware that it offers the least amount of checking possible - and isn't really worth bothering with?.

No. Hamming code 7,4 instead, complemented with repetition (thrice) followed with majority vote. Could sound overkill for my IR link between two PICs but they are easily implemented in software.

As you're writing both ends of the link, then you can deal with the parity bit exactly as you wish - but it seems rather pointless?.
 
Nigel Goodwin said:
As you're writing both ends of the link, then you can deal with the parity bit exactly as you wish...

Sure. I'am the 100% of the development team, :( only using parity check to build the 7,4 Hamming code, later complemented as described.

BTW, NIgel, could you suggest a simple / practical way to check the error correction part :?: keeping in mind it is a non-outdoors bot where the "one way" IR link between the brains and each leg is aimed basically to control motors.

Gracias.
 
atferrari said:
Nigel Goodwin said:
As you're writing both ends of the link, then you can deal with the parity bit exactly as you wish...

Sure. I'am the 100% of the development team, :( only using parity check to build the 7,4 Hamming code, later complemented as described.

BTW, NIgel, could you suggest a simple / practical way to check the error correction part :?: keeping in mind it is a non-outdoors bot where the "one way" IR link between the brains and each leg is aimed basically to control motors.

You might try sending a checksum - it doesn't have the capability of correcting errors, but it is a good way of showing an error exists.

I'm presuming you're continuously sending data?, the robot should enter a 'safe mode' if it doesn't get valid data within a certain time - this means it will 'fail safe'.

However, because you can continually send data (which will mostly be the same), missing the occasional byte or two doesn't really matter.

Your TV remote does no error checking, does that work well enough or not?.
 
Error checking/correction

The brains will tell the legs when to start / stop / reverse. No continuous emision planned. Too much power to save in that way!

No TV remote used, just an IR link based in the SIRC protocol from brains to legs.
 
Re: Error checking/correction

atferrari said:
The brains will tell the legs when to start / stop / reverse. No continuous emision planned. Too much power to save in that way!

In that case I suggest you use transceivers and a two way link!.

No TV remote used, just an IR link based in the SIRC protocol from brains to legs.

I meant on your TV! - that works fine doesn't it?, and no error checking!.
 
Re: Error checking/correction

Nigel Goodwin said:
I meant on your TV! - that works fine doesn't it?, and no error checking!.

Oh, yes. You are right :!: There is hope after all... :)

Thanks for your time and good disposition.

Sure I will post the outcome.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top