Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Binary number
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Subtraction === {{further|signed number representations|two's complement}} [[Subtraction]] works in much the same way: :0 β 0 β 0 :0 β 1 β 1, borrow 1 :1 β 0 β 1 :1 β 1 β 0 Subtracting a "1" digit from a "0" digit produces the digit "1", while 1 will have to be subtracted from the next column. This is known as ''borrowing''. The principle is the same as for carrying. When the result of a subtraction is less than 0, the least possible value of a digit, the procedure is to "borrow" the deficit divided by the radix (that is, 10/10) from the left, subtracting it from the next positional value. * * * * (starred columns are borrowed from) 1 1 0 1 1 1 0 β 1 0 1 1 1 ---------------- = 1 0 1 0 1 1 1 * (starred columns are borrowed from) 1 0 1 1 1 1 1 β 1 0 1 0 1 1 ---------------- = 0 1 1 0 1 0 0 Subtracting a positive number is equivalent to ''adding'' a [[negative number]] of equal [[absolute value]]. Computers use [[signed number representations]] to handle negative numbersβmost commonly the [[two's complement]] notation. Such representations eliminate the need for a separate "subtract" operation. Using two's complement notation, subtraction can be summarized by the following formula: : {{math|1=A β B = A + not B + 1}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)