123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <html>
- <head>
- <title>Bit Finder</title>
- </head>
- <body bgcolor="FFFFFF">
- <h1><img align="center" src="../../../icons/bitfindr.gif" width="32" height="32">
- <em>Bit Finder</em></h1>
- <p><table>
- <tr><td><strong>Library:</strong></td>
- <td><a href="index.html">Arithmetic</a></td></tr>
- <tr><td><strong>Introduced:</strong></td>
- <td>2.6.1</td></tr>
- <tr><td valign="top"><strong>Appearance:</strong></td>
- <td valign="top"><img src="../../../img-libs/bitfindr.png" width="44" height="43"></td></tr>
- </table></p>
- <h2>Behavior</h2>
- <p>The component takes a multi-bit input and determines the the index of a bit,
- where the index is computed by counting from 0 as the lowest-order bit.
- Exactly which index it computes depends on the Type attribute, as illustrated
- by the examples in the below table for the 8-bit sample input 11010100.</p>
- <blockquote><table><thead>
- <tr><th>Type</th><th>Output for 11010100</th></td></tr>
- </thead><tbody>
- <tr><td>Lowest-order 1</td><td align="center">2</td></tr>
- <tr><td>Highest-order 1</td><td align="center">7</td></tr>
- <tr><td>Lowest-order 0</td><td align="center">0</td></tr>
- <tr><td>Highest-order 0</td><td align="center">5</td></tr>
- </tbody></table></blockquote>
- <p>For the lowest-order 1, the output is 2 because if you index the bits
- starting from 0 for the lowest-order bit, the first 1 you will find is
- at index 2. (The bits at indices 0 and 1 are both 0.)
- For the highest-order 1, the output is 7 because the topmost 1 bit is at index 7
- (again counting from the lowest-order bit as 0).</p>
- <p>The component's output on the south edge indicates whether the desired bit
- was found at all. In the above examples involving the input 11010100,
- the south output is 1 in all cases.
- But if the input were 00000000 and the component is to find the
- lowest-order 1, then the south output would be 0 — and the output on the
- east edge would be 0 as well.</p>
- <p>If while searching for the desired value, a value that is neither 0 or 1 is
- found (the bit could be floating or an error value),
- then both outputs will consist entirely of error bits.
- Note that this occurs only if the problematic bit is encountered before finding
- the desired bit: For the input x1010100, the output would still be 2 if
- the lowest-order 1 is desired; but we would get error values if the component's
- type indicates to search for the highest-order 1 or the highest-order 0, since
- there is an erroneous bit in a higher-order bit than either the highest-order 0
- or the highest-order 1.</p>
- <h2>Pins</h2>
- <dl>
- <dt>West edge (input, bit width matches Data Bits attribute)</dt>
- <dd>The multibit input that is to be searched for the desired bit.</dd>
- <dt>East edge (output, bit width computed as described below)</dt>
- <dd>The index of the desired bit, counting from 0 for the lowest-order bit.
- The bit width is the
- minimum number of bits to store the maximum possible index, which is one
- less than the value of the Data Bits attribute.</dd>
- <dt>South edge (output, bit width 1)</dt>
- <dd>1 if the desired bit is found, 0 if all input bits are the inverse of the
- desired bit, and the error value if a non-0, non-1 value is found before the
- desired bit.</dd>
- </dl>
- <h2>Attributes</h2>
- <p>When the component is selected or being added,
- Alt-0 through Alt-9 alter its <q>Data Bits</q> attribute.</p>
- <dl>
- <dt>Data Bits</dt>
- <dd>The bit width of the input.</dd>
- <dt>Type</dt>
- <dd>Indicates which bit to search for — the lowest-order 0,
- the highest-order 0, the lowest-order 1, or the highest-order 1.</dd>
- </dl>
- <h2>Poke Tool Behavior</h2>
- <p>None.</p>
- <h2>Text Tool Behavior</h2>
- <p>None.</p>
- <p><a href="../index.html">Back to <em>Library Reference</em></a></p>
- </body>
- </html>
|