From: tmoran@acm.org
Subject: Re: Calculate and set Parity
Date: Tue, 17 Sep 2002 01:36:50 GMT
Date: 2002-09-17T01:36:50+00:00 [thread overview]
Message-ID: <wgqh9.442487$me6.52285@sccrnsc01> (raw)
In-Reply-To: 3D8629D3.2040603@acm.org
> array of Boolean seems like a good way to go. You then simply add up the
> Boolean'Pos of each element and determine if the result is even or odd
> ("rem 2"). You could do an unchecked conversion to a 16-bit modular type
> and use shifts and masks to isolate the individual bits, but using
> Booleans seems simpler.
If speed is a consideration, and memory is available, convert to an
array of a 16 or an 8 bit type and look up the parity of each element in a
lookup table, then XOR the parities together.
next prev parent reply other threads:[~2002-09-17 1:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-16 16:42 Calculate and set Parity Sebastian
2002-09-16 18:14 ` Stephen Leake
2002-09-16 18:58 ` Jeffrey Carter
2002-09-16 19:51 ` tmoran
2002-09-17 1:36 ` tmoran [this message]
2002-09-17 22:05 ` Nick Roberts
2002-09-17 23:23 ` tmoran
2002-09-18 0:17 ` tmoran
2002-09-18 20:25 ` Nick Roberts
2002-09-18 2:52 ` SteveD
2002-09-18 18:29 ` Parity using 'Write, was " tmoran
2002-09-18 18:47 ` David C. Hoos
2002-09-18 22:17 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox