subtractor.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <html>
  2. <head>
  3. <title>Subtractor</title>
  4. </head>
  5. <body bgcolor="FFFFFF">
  6. <h1><img align="center" src="../../../../en/icons/subtractor.gif" width="32" height="32">
  7. <em>Subtractor</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.0 Beta 11</td></tr>
  13. <tr><td valign="top"><strong>Appearance:</strong></td>
  14. <td valign="top"><img src="../../../../en/img-libs/subtractor.png" width="44" height="45"></td></tr>
  15. </table></p>
  16. <h2>Behavior</h2>
  17. <p>This component subtracts values coming in via the west inputs
  18. (the upper minus the lower) and outputs the difference on the east
  19. output. The component is designed so that it can be cascaded with other
  20. subtractors to provide subtract more bits than is possible with a single
  21. subtractor: The borrow-in input provides a one-bit value to be borrowed
  22. out of the difference (if the borrow-in input is specified), and a
  23. borrow-out output indicates whether the component needs to borrow an
  24. upper-order bit to complete the subtraction without underflow (assuming
  25. unsigned subtraction).</p>
  26. <p>Internally, the subtractor simply performs a bitwise NOT on the
  27. subtrahend, and add this to the minuend along with the NOT of the
  28. borrow-in input. (The <em>minuend</em> is the first operand (upper
  29. input) to the subtraction, and the <em>subtrahend</em> is the second
  30. (lower input). I happen to like the antiquated terms.)</p>
  31. <p>If either of the operands contains some floating bits or some error
  32. bits, then the component will perform a partial subtraction. That is, it
  33. will compute as many low-order bits as possible. But above the floating
  34. or error bit, the result will have floating or error bits.</p>
  35. <h2>Pins</h2>
  36. <dl>
  37. <dt>West edge, north end (input, bit width matches Data Bits attribute)
  38. <dd>The minuend of the subtraction; that is, the number from which to
  39. subtract.
  40. <dt>West edge, south end (input, bit width matches Data Bits attribute)
  41. <dd>The subtrahend of the subtraction; that is, the number to subtract
  42. from the minuend.
  43. <dt>North edge, labeled <var>b in</var> (input, bit width 1)
  44. <dd>If 1, then 1 is borrowed out of the difference. If the value is
  45. unknown (i.e., floating), then it is assumed to be 0.
  46. <dt>East edge (output, bit width matches Data Bits attribute)
  47. <dd>The lower <var>dataBits</var> bits of the difference of the two
  48. values coming in the west edge, minus the
  49. <var>b</var><sub><var>in</var></sub> bit.
  50. <dt>South edge, labeled <var>b out</var> (output, bit width 1)
  51. <dd>The borrow bit computed for the difference. If the values subtracted
  52. as unsigned values yield a negative value, then this bit will be 1;
  53. otherwise, it will be 0.
  54. </dl>
  55. <h2>Attributes</h2>
  56. <p>When the component is selected or being added,
  57. Alt-0 through Alt-9 alter its <q>Data Bits</q> attribute.</p>
  58. <dl>
  59. <dt>Data Bits</dt>
  60. <dd>The bit width of the values to be subtracted and of the result.</dd>
  61. </dl>
  62. <h2>Poke Tool Behavior</h2>
  63. <p>None.</p>
  64. <h2>Text Tool Behavior</h2>
  65. <p>None.</p>
  66. <p><a href="../index.html">Back to <em>Library Reference</em></a></p>
  67. </body>
  68. </html>