Find the additive inverse of binary number
$begingroup$
My online assembly class doesn't really show us how to find the additive inverse of finding the additive inverse of binary, and I can't find much online. The question is: find the additive inverse of 0000 0000 1110 1111 1010 1101 0110 1100. Any insight on how to solve this or some steps would be great. Thanks.
inverse binary
$endgroup$
add a comment |
$begingroup$
My online assembly class doesn't really show us how to find the additive inverse of finding the additive inverse of binary, and I can't find much online. The question is: find the additive inverse of 0000 0000 1110 1111 1010 1101 0110 1100. Any insight on how to solve this or some steps would be great. Thanks.
inverse binary
$endgroup$
add a comment |
$begingroup$
My online assembly class doesn't really show us how to find the additive inverse of finding the additive inverse of binary, and I can't find much online. The question is: find the additive inverse of 0000 0000 1110 1111 1010 1101 0110 1100. Any insight on how to solve this or some steps would be great. Thanks.
inverse binary
$endgroup$
My online assembly class doesn't really show us how to find the additive inverse of finding the additive inverse of binary, and I can't find much online. The question is: find the additive inverse of 0000 0000 1110 1111 1010 1101 0110 1100. Any insight on how to solve this or some steps would be great. Thanks.
inverse binary
inverse binary
asked Dec 10 '18 at 0:18
Luke DLuke D
796
796
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
If we're dealing with $n$-bit binary numbers, i.e., only numbers in the range $0$--$2^n - 1$, and for a given $a$ we denote by $bar a$ that $2^n$ bit number whose every bit is the opposite to that in the same position in $a$, then
$a + bar a = underset{text{n bits}}{1 1 ldots 1}; tag 1$
then
$a + bar a + 1 = underset{text{n bits}}{0 0 ldots 0}; tag 2$
thus
$-a equiv bar a + 1; tag 3$
for example, with
$a = 1110, tag 4$
we have
$bar a = 0001, tag 5$
$-a = bar a + 1 = 0010; tag 6$
it is easy to check that
$-a + a = a + bar a + 1 = 1110 + 0010 = 0000; tag 7$
again, with
$a = 1010, tag 8$
$bar a = 0101, tag 9$
$-a = 1 + bar a = 0110, tag{10}$
and we see that
$1010 + 0110 = 0000. tag{11}$
The reader may easily try this out/check it for larger values of $n$ than $4$.
It is important to remember that we are really dealing with arithmetic $mod 2^n$, i.e., in $Bbb Z_{2^n}$, where the elements are written in binary representation.
$endgroup$
2
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
1
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
add a comment |
$begingroup$
In mathematics, you just put a minus sign in front of it like you do a base $10$ number. In computer science, there are a number of ways to represent negative integers. I believe the most common is two's complement. You invert all the bits and add $1$. Another is sign-magnitude where you just change the first bit to $1$. Whoever is posing the question should define what format is being used. Without that, you cannot answer.
$endgroup$
1
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3033235%2ffind-the-additive-inverse-of-binary-number%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
If we're dealing with $n$-bit binary numbers, i.e., only numbers in the range $0$--$2^n - 1$, and for a given $a$ we denote by $bar a$ that $2^n$ bit number whose every bit is the opposite to that in the same position in $a$, then
$a + bar a = underset{text{n bits}}{1 1 ldots 1}; tag 1$
then
$a + bar a + 1 = underset{text{n bits}}{0 0 ldots 0}; tag 2$
thus
$-a equiv bar a + 1; tag 3$
for example, with
$a = 1110, tag 4$
we have
$bar a = 0001, tag 5$
$-a = bar a + 1 = 0010; tag 6$
it is easy to check that
$-a + a = a + bar a + 1 = 1110 + 0010 = 0000; tag 7$
again, with
$a = 1010, tag 8$
$bar a = 0101, tag 9$
$-a = 1 + bar a = 0110, tag{10}$
and we see that
$1010 + 0110 = 0000. tag{11}$
The reader may easily try this out/check it for larger values of $n$ than $4$.
It is important to remember that we are really dealing with arithmetic $mod 2^n$, i.e., in $Bbb Z_{2^n}$, where the elements are written in binary representation.
$endgroup$
2
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
1
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
add a comment |
$begingroup$
If we're dealing with $n$-bit binary numbers, i.e., only numbers in the range $0$--$2^n - 1$, and for a given $a$ we denote by $bar a$ that $2^n$ bit number whose every bit is the opposite to that in the same position in $a$, then
$a + bar a = underset{text{n bits}}{1 1 ldots 1}; tag 1$
then
$a + bar a + 1 = underset{text{n bits}}{0 0 ldots 0}; tag 2$
thus
$-a equiv bar a + 1; tag 3$
for example, with
$a = 1110, tag 4$
we have
$bar a = 0001, tag 5$
$-a = bar a + 1 = 0010; tag 6$
it is easy to check that
$-a + a = a + bar a + 1 = 1110 + 0010 = 0000; tag 7$
again, with
$a = 1010, tag 8$
$bar a = 0101, tag 9$
$-a = 1 + bar a = 0110, tag{10}$
and we see that
$1010 + 0110 = 0000. tag{11}$
The reader may easily try this out/check it for larger values of $n$ than $4$.
It is important to remember that we are really dealing with arithmetic $mod 2^n$, i.e., in $Bbb Z_{2^n}$, where the elements are written in binary representation.
$endgroup$
2
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
1
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
add a comment |
$begingroup$
If we're dealing with $n$-bit binary numbers, i.e., only numbers in the range $0$--$2^n - 1$, and for a given $a$ we denote by $bar a$ that $2^n$ bit number whose every bit is the opposite to that in the same position in $a$, then
$a + bar a = underset{text{n bits}}{1 1 ldots 1}; tag 1$
then
$a + bar a + 1 = underset{text{n bits}}{0 0 ldots 0}; tag 2$
thus
$-a equiv bar a + 1; tag 3$
for example, with
$a = 1110, tag 4$
we have
$bar a = 0001, tag 5$
$-a = bar a + 1 = 0010; tag 6$
it is easy to check that
$-a + a = a + bar a + 1 = 1110 + 0010 = 0000; tag 7$
again, with
$a = 1010, tag 8$
$bar a = 0101, tag 9$
$-a = 1 + bar a = 0110, tag{10}$
and we see that
$1010 + 0110 = 0000. tag{11}$
The reader may easily try this out/check it for larger values of $n$ than $4$.
It is important to remember that we are really dealing with arithmetic $mod 2^n$, i.e., in $Bbb Z_{2^n}$, where the elements are written in binary representation.
$endgroup$
If we're dealing with $n$-bit binary numbers, i.e., only numbers in the range $0$--$2^n - 1$, and for a given $a$ we denote by $bar a$ that $2^n$ bit number whose every bit is the opposite to that in the same position in $a$, then
$a + bar a = underset{text{n bits}}{1 1 ldots 1}; tag 1$
then
$a + bar a + 1 = underset{text{n bits}}{0 0 ldots 0}; tag 2$
thus
$-a equiv bar a + 1; tag 3$
for example, with
$a = 1110, tag 4$
we have
$bar a = 0001, tag 5$
$-a = bar a + 1 = 0010; tag 6$
it is easy to check that
$-a + a = a + bar a + 1 = 1110 + 0010 = 0000; tag 7$
again, with
$a = 1010, tag 8$
$bar a = 0101, tag 9$
$-a = 1 + bar a = 0110, tag{10}$
and we see that
$1010 + 0110 = 0000. tag{11}$
The reader may easily try this out/check it for larger values of $n$ than $4$.
It is important to remember that we are really dealing with arithmetic $mod 2^n$, i.e., in $Bbb Z_{2^n}$, where the elements are written in binary representation.
answered Dec 10 '18 at 0:46
Robert LewisRobert Lewis
46.6k23067
46.6k23067
2
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
1
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
add a comment |
2
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
1
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
2
2
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
$begingroup$
Perfect explantation. thanks.
$endgroup$
– Luke D
Dec 10 '18 at 0:52
1
1
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
$begingroup$
@LukeD: my pleasure, sir!
$endgroup$
– Robert Lewis
Dec 10 '18 at 0:52
add a comment |
$begingroup$
In mathematics, you just put a minus sign in front of it like you do a base $10$ number. In computer science, there are a number of ways to represent negative integers. I believe the most common is two's complement. You invert all the bits and add $1$. Another is sign-magnitude where you just change the first bit to $1$. Whoever is posing the question should define what format is being used. Without that, you cannot answer.
$endgroup$
1
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
add a comment |
$begingroup$
In mathematics, you just put a minus sign in front of it like you do a base $10$ number. In computer science, there are a number of ways to represent negative integers. I believe the most common is two's complement. You invert all the bits and add $1$. Another is sign-magnitude where you just change the first bit to $1$. Whoever is posing the question should define what format is being used. Without that, you cannot answer.
$endgroup$
1
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
add a comment |
$begingroup$
In mathematics, you just put a minus sign in front of it like you do a base $10$ number. In computer science, there are a number of ways to represent negative integers. I believe the most common is two's complement. You invert all the bits and add $1$. Another is sign-magnitude where you just change the first bit to $1$. Whoever is posing the question should define what format is being used. Without that, you cannot answer.
$endgroup$
In mathematics, you just put a minus sign in front of it like you do a base $10$ number. In computer science, there are a number of ways to represent negative integers. I believe the most common is two's complement. You invert all the bits and add $1$. Another is sign-magnitude where you just change the first bit to $1$. Whoever is posing the question should define what format is being used. Without that, you cannot answer.
answered Dec 10 '18 at 0:27
Ross MillikanRoss Millikan
296k23198371
296k23198371
1
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
add a comment |
1
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
1
1
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
From the examples he included (which dont explain it in anyway) I'm pretty sure you invert the bits and add 1. But I cannot get a straight answer so I'll email him.
$endgroup$
– Luke D
Dec 10 '18 at 0:39
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
$begingroup$
The neat thing about twos complement is you can do arithmetic ignoring the fact that the numbers might have different signs. You can read about it in Wikipedia.
$endgroup$
– Ross Millikan
Dec 10 '18 at 0:42
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3033235%2ffind-the-additive-inverse-of-binary-number%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown