Browse Prior Art Database

Mapping a 1 Out Of 8 Code into the Integers 1 To 8

IP.com Disclosure Number: IPCOM000052710D
Original Publication Date: 1981-Jul-01
Included in the Prior Art Database: 2005-Feb-11
Document File: 2 page(s) / 24K

Publishing Venue

IBM

Related People

Chroust, G: AUTHOR

Abstract

Frequently, information, particularly sensor information, available as a 1-out-of-N code (exactly 1 bit in a word is ON) has to be translated into a dense sequence of integers for further processing, such as table look-up. The algorithm specified below provides a fast method for translating a 1-out-of-8 code into the (dense sequence of) integers 1 to 8.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 74% of the total text.

Page 1 of 2

Mapping a 1 Out Of 8 Code into the Integers 1 To 8

Frequently, information, particularly sensor information, available as a 1-out- of-N code (exactly 1 bit in a word is ON) has to be translated into a dense sequence of integers for further processing, such as table look-up. The algorithm specified below provides a fast method for translating a 1-out-of-8 code into the (dense sequence of) integers 1 to 8.

For a 1-out-of-8 code, the halfbyte L can be interpreted as one of the integers 0, 1, 2, 4, and 8. In this halfbyte, at most 1 bit is ON. Halfbyte H is inverted, so that it always contains three bits which are ON. Masking of the high-order bit must still leave at least 2 bits ON (values 3, 5, 6 or 7). Thus, the value of H must be different from that of L. Accordingly, the above-described method causes the input byte to be split into two halfbytes. One halfbyte is interpreted as a 4-bit integer, so that it is mapped into integers 0, 1, 2, 4, or 8. The second halfbyte is inverted, and the high-order bit is suppressed. Thus, this halfbyte is mapped into integers 3, 5, 6, 7.

Let H and L be respectively the high and low halfbytes of the byte B: Byte B: ##

Assuming that H and L are interpreted both as 4-bit strings and 4-bit unsigned integers, then the desired integer J can be computed as follows: ##

The resulting mapping is as follows: ##

The algorithm has the following useful properties: 1. If no bit is ON, the value of B is mapped into O. 2. If both L and H contain...