| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <html>
- <head>
- <title>Subtractor</title>
- </head>
- <body bgcolor="FFFFFF">
- <h1><img align="center" src="../../../../en/icons/subtractor.gif" width="32" height="32">
- <em>Subtractor</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.0 Beta 11</td></tr>
- <tr><td valign="top"><strong>Appearance:</strong></td>
- <td valign="top"><img src="../../../../en/img-libs/subtractor.png" width="44" height="45"></td></tr>
- </table></p>
- <h2>Behavior</h2>
- <p>This component subtracts values coming in via the west inputs
- (the upper minus the lower) and outputs the difference on the east
- output. The component is designed so that it can be cascaded with other
- subtractors to provide subtract more bits than is possible with a single
- subtractor: The borrow-in input provides a one-bit value to be borrowed
- out of the difference (if the borrow-in input is specified), and a
- borrow-out output indicates whether the component needs to borrow an
- upper-order bit to complete the subtraction without underflow (assuming
- unsigned subtraction).</p>
- <p>Internally, the subtractor simply performs a bitwise NOT on the
- subtrahend, and add this to the minuend along with the NOT of the
- borrow-in input. (The <em>minuend</em> is the first operand (upper
- input) to the subtraction, and the <em>subtrahend</em> is the second
- (lower input). I happen to like the antiquated terms.)</p>
- <p>If either of the operands contains some floating bits or some error
- bits, then the component will perform a partial subtraction. That is, it
- will compute as many low-order bits as possible. But above the floating
- or error bit, the result will have floating or error bits.</p>
- <h2>Pins</h2>
- <dl>
- <dt>West edge, north end (input, bit width matches Data Bits attribute)
- <dd>The minuend of the subtraction; that is, the number from which to
- subtract.
- <dt>West edge, south end (input, bit width matches Data Bits attribute)
- <dd>The subtrahend of the subtraction; that is, the number to subtract
- from the minuend.
- <dt>North edge, labeled <var>b in</var> (input, bit width 1)
- <dd>If 1, then 1 is borrowed out of the difference. If the value is
- unknown (i.e., floating), then it is assumed to be 0.
- <dt>East edge (output, bit width matches Data Bits attribute)
- <dd>The lower <var>dataBits</var> bits of the difference of the two
- values coming in the west edge, minus the
- <var>b</var><sub><var>in</var></sub> bit.
- <dt>South edge, labeled <var>b out</var> (output, bit width 1)
- <dd>The borrow bit computed for the difference. If the values subtracted
- as unsigned values yield a negative value, then this bit will be 1;
- otherwise, it will be 0.
- </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 values to be subtracted and of the result.</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>
|