« Tech Support: Brought to you by the letter T | Main | Good Samaritan needed! »

Tech Support: Counting bits

Kell asked:

Hi David,
Is there anything in SPLat which will tell you if more than one bit has changed in a byte, like when you are reading grey code ? I have got 5 inputs and only one can change at any one time.

The easiest would be to XOR old and new bytes. This will leave bits set wherever there's a change. Then use a 32 byte table in NVEM0 to translate the bit pattern to a count of changed bits.

TrackBack

TrackBack URL for this entry:
http://www.splatco.com/cgi-sys/cgiwrap/microcon/managed-mt/mt-tb.cgi/63

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


About

This page contains a single entry from the blog posted on August 8, 2007 1:05 PM.

The previous post in this blog was Tech Support: Brought to you by the letter T.

The next post in this blog is Good Samaritan needed!.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.33