ok, so in my computing class at college, we have just started doing binary and hex etc. im way ahead of my class although we have just moved onto parities and error checking when sending messages within a computer but what i was wondering was: Are parities done automaticly by the CPU or should they be built-in to the kernel to ensure all messages are correct?
I am also interested in if anyone knows how to to find if there is an error with the parity bits? all we have touched on is error checking when the error is in the actual data rather than the parities, mainly because there is a higher possibility of that to get an error.
hope this all makes sense. if not i can explain. it isn't difficult really.
Thanks in advance,
James.
parities and error checking
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: parities and error checking
Within a computer, signals are stable enough not to get corrupted in any way (imagine your code randomly changing!) However media external to the computer may not necessarily be. CDs can be scratched, floppies dislike magnets, network cables can pick up noise. What you have to do about these things depends on how they work. Some may not give you corrupt data at all, some will check and correct the data for you, and only for the remaining set will you have to check the data's integrity yourself.Are parities done automaticly by the CPU or should they be built-in to the kernel to ensure all messages are correct?
The problem with such scheme is that with one parity unit you can never detect the location of the error - you can always change exactly one of the units in the set at will to make the set appear correct again.I am also interested in if anyone knows how to to find if there is an error with the parity bits? all we have touched on is error checking when the error is in the actual data rather than the parities, mainly because there is a higher possibility of that to get an error.
Also, if you know the location of the error, you can attempt to fix it as well, making anything of that sort no longer error checking, but rather error correction.
Try the following scheme with parity bits (one of the simplest forms of error correction):
Code: Select all
0 1 1 0 1 1 0 0 | 0
1 0 1 0 1 0 0 1 | 0
1 1 1 0 0 0 1 1 | 1
----------------+--
0 0 1 0 0 1 1 0 | 1
Code: Select all
0 1 1 0 1 1 0 0 | 0 <- ok
1 0 1 0 1 0 0 1 | 0 <- ok
1 1 1 0 0 0 1 1 | 1 <- ok
----------------+--
0 0 1 0 1 1 1 0 | 1 <- wrong
v v v v X v v v v
Code: Select all
| | <- ok
| | <- ok
v | <- ok
------>(1)<-----|-- <- wrong
v v v v X v v v v
Code: Select all
0 1 1 0 1 1 0 0 | 0 <- ok
1 0 1 0 1 0 0 1 | 0 <- ok
1 1 1 1!1!0 1 1 | 1 <- ok
----------------+--
0 0 1 1!0 1 1 0 | 1 <- wrong
v v v v X v v v v
Re: parities and error checking
And if you really do want to check parities, the x86 cpu automatically calculates the parity of the result of every calculation. So you can test parity at any time you want.
Of course, that is a slight overgeneralization. One reason that your computer crashes every 8 months is precisely because an unfriendly gamma ray trashed an important bit in a program.Combuster wrote: Within a computer, signals are stable enough not to get corrupted in any way (imagine your code randomly changing!)
Re: parities and error checking
so, in conclusion, it would just be time consuming to run the checks everytime i send a signal anyway. and when it comes to making multimedia drivers, it would be worth my while to implement it?
thanks for the detailed reply combuster, that cleared things up alot.
and to bewing, thanks for the extra knowledge. i never knew gamma rays could do that!
thanks again,
James.
thanks for the detailed reply combuster, that cleared things up alot.
and to bewing, thanks for the extra knowledge. i never knew gamma rays could do that!
thanks again,
James.