bitadder.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <html>
  2. <head>
  3. <title>Bit Adder</title>
  4. </head>
  5. <body bgcolor="FFFFFF">
  6. <h1><img align="center" src="../../../icons/bitadder.gif" width="32" height="32">
  7. <em>Bit Adder</em></h1>
  8. <p><table>
  9. <tr><td><strong>Library:</strong></td>
  10. <td><a href="index.html">Arithmetic</a></td></tr>
  11. <tr><td><strong>Introduced:</strong></td>
  12. <td>2.6.0</td></tr>
  13. <tr><td valign="top"><strong>Appearance:</strong></td>
  14. <td valign="top"><img src="../../../img-libs/bitadder.png" width="44" height="42"></td></tr>
  15. </table></p>
  16. <h2>Behavior</h2>
  17. <p>The component determines how many 1 bits are in its input(s) and emits the
  18. total number of 1 bits on its output. For example, given the 8-bit input 10011101,
  19. the output would be 5, since there are five 1-bits in the input
  20. (the first, the last, and a string of three bits in the middle).</p>
  21. <p>If any of the input bits are floating or error values, then the output will
  22. contain error bits in the output corresponding to the range of possible outputs
  23. depending on whether those floating/error values are counted as zeroes or ones.
  24. For instance, if the 14-bit input is 111x10110x1101, then the output must be
  25. at least 9 (if the x's are interpreted as zeroes)
  26. and at most 11 (if they are interpreted as ones).
  27. Thus, the output will be 10EE: The upper two bits will be 1 and 0 since all integers
  28. between 9 and 11 have 1 and 0 as their top two bits, but the lower two bits are EE
  29. since integers between 9 and 11 vary within these bits.</p>
  30. <h2>Pins</h2>
  31. <dl>
  32. <dt>West edge (inputs, bit width matches Data Bits attribute)</dt>
  33. <dd>The inputs whose 1 bits are to be counted. The number of inputs is based
  34. on the Number of Inputs attribute.</dd>
  35. <dt>East edge (output, bit width computed as described below)</dt>
  36. <dd>The number of input bits which are 1. The bit width of the output is the
  37. minimum number of bits to store the maximum possible value (which would be
  38. the product of the Data Bits attribute and the Number of Inputs attribute).</dd>
  39. </dl>
  40. <h2>Attributes</h2>
  41. <p>When the component is selected or being added,
  42. the digits '0' through '9' alter its <q>Number of Inputs</q> attribute and
  43. Alt-0 through Alt-9 alter its <q>Data Bits</q> attribute.</p>
  44. <dl>
  45. <dt>Data Bits</dt>
  46. <dd>The bit width of the input(s).</dd>
  47. <dt>Number of Inputs</dt>
  48. <dd>The number of input values.</dd>
  49. </dl>
  50. <h2>Poke Tool Behavior</h2>
  51. <p>None.</p>
  52. <h2>Text Tool Behavior</h2>
  53. <p>None.</p>
  54. <p><a href="../index.html">Back to <em>Library Reference</em></a></p>
  55. </body>
  56. </html>