English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I['m trying to design an even odd parity checker, but I don't know what is

2006-07-24 03:47:03 · 3 answers · asked by S G 1 in Computers & Internet Programming & Design

3 answers

It tells you if the number of 1 bits in some chunk if data is odd or even. The chunk is usually a byte (as in serial data).

In hardware, all you need to add is a D flipflop set up to toggle (fed Qbar back to D).
Clear (or set) it on start of byte.
Clocked by the AND product of the the data and clock. Each one will casue the FF to toggle - alternating, in effect, 'odd-even'.

In software, same idea
int oddparity( int byte )
{
int p = 0; /* initialize 0 for odd, 1 for even */
int mask = 0x080;
while( mask )
{
if( mask & byte )
{
p = 1 - p;
}
mask >>= 1;
}
return p;
}
(You can do a direct lookup for fatser results)

2006-07-24 04:00:27 · answer #1 · answered by sheeple_rancher 5 · 4 2

Not sure if it is even used anymore, but, it used to be used on RAM, back in the earlier days of computers.

2006-07-24 03:50:17 · answer #2 · answered by chuckufarley2a 6 · 0 1

the world loves it's own

2006-07-24 03:51:13 · answer #3 · answered by dale 5 · 0 1

fedest.com, questions and answers