method of long division based on 10s complement
$begingroup$
There are two ways of performing subtraction using ten's complement, using an algorithm similar to two's complement on most (practically all?) CPUs. Is there a good way to structure a division problem so it's convenient to use this algorithm?
Here's a sample of the first way:
145
- 67
-------- complement of minuend
854
+ 67
-------- addition
921
-------- complement of result
078
Here's a sample of the second way, as a bonus it demonstrates what happens when the minuend has fewer digits than the subtrahend and how carries are resolved.
145
- 67
--------- complement of subtrahend
145
+ 932
--------- addition
1077
--------- "complement" of result (subtract 1000 and add 1).
78
Despite the vertical space they consume here, these methods are fairly convenient for pencil and paper use, with one glaring exception.
Used as a "subroutine" in long division, the constant need to swap digits with difference-from-9 counterparts is very impractical, as is the fact that the "implicit zeroes" to the right of the current partial quotient need to be complemented and changed into 9
s.
28r8
_______
31 ) 876 0 #1 start
62 20 #2 partial quotient
876 #3 dup #1
379 #4 complement #2
1255 #5 add #4, #5
256 #6 complement #5
248 8 #7 partial quotient
256 #8 dup #6
751 #9 complement of #7
1007 #10 add #8, #9
8 #11 complement of #10
Is there a way of doing long division with this method of subtraction that doesn't involve repeating digits so many times?
arithmetic
$endgroup$
add a comment |
$begingroup$
There are two ways of performing subtraction using ten's complement, using an algorithm similar to two's complement on most (practically all?) CPUs. Is there a good way to structure a division problem so it's convenient to use this algorithm?
Here's a sample of the first way:
145
- 67
-------- complement of minuend
854
+ 67
-------- addition
921
-------- complement of result
078
Here's a sample of the second way, as a bonus it demonstrates what happens when the minuend has fewer digits than the subtrahend and how carries are resolved.
145
- 67
--------- complement of subtrahend
145
+ 932
--------- addition
1077
--------- "complement" of result (subtract 1000 and add 1).
78
Despite the vertical space they consume here, these methods are fairly convenient for pencil and paper use, with one glaring exception.
Used as a "subroutine" in long division, the constant need to swap digits with difference-from-9 counterparts is very impractical, as is the fact that the "implicit zeroes" to the right of the current partial quotient need to be complemented and changed into 9
s.
28r8
_______
31 ) 876 0 #1 start
62 20 #2 partial quotient
876 #3 dup #1
379 #4 complement #2
1255 #5 add #4, #5
256 #6 complement #5
248 8 #7 partial quotient
256 #8 dup #6
751 #9 complement of #7
1007 #10 add #8, #9
8 #11 complement of #10
Is there a way of doing long division with this method of subtraction that doesn't involve repeating digits so many times?
arithmetic
$endgroup$
add a comment |
$begingroup$
There are two ways of performing subtraction using ten's complement, using an algorithm similar to two's complement on most (practically all?) CPUs. Is there a good way to structure a division problem so it's convenient to use this algorithm?
Here's a sample of the first way:
145
- 67
-------- complement of minuend
854
+ 67
-------- addition
921
-------- complement of result
078
Here's a sample of the second way, as a bonus it demonstrates what happens when the minuend has fewer digits than the subtrahend and how carries are resolved.
145
- 67
--------- complement of subtrahend
145
+ 932
--------- addition
1077
--------- "complement" of result (subtract 1000 and add 1).
78
Despite the vertical space they consume here, these methods are fairly convenient for pencil and paper use, with one glaring exception.
Used as a "subroutine" in long division, the constant need to swap digits with difference-from-9 counterparts is very impractical, as is the fact that the "implicit zeroes" to the right of the current partial quotient need to be complemented and changed into 9
s.
28r8
_______
31 ) 876 0 #1 start
62 20 #2 partial quotient
876 #3 dup #1
379 #4 complement #2
1255 #5 add #4, #5
256 #6 complement #5
248 8 #7 partial quotient
256 #8 dup #6
751 #9 complement of #7
1007 #10 add #8, #9
8 #11 complement of #10
Is there a way of doing long division with this method of subtraction that doesn't involve repeating digits so many times?
arithmetic
$endgroup$
There are two ways of performing subtraction using ten's complement, using an algorithm similar to two's complement on most (practically all?) CPUs. Is there a good way to structure a division problem so it's convenient to use this algorithm?
Here's a sample of the first way:
145
- 67
-------- complement of minuend
854
+ 67
-------- addition
921
-------- complement of result
078
Here's a sample of the second way, as a bonus it demonstrates what happens when the minuend has fewer digits than the subtrahend and how carries are resolved.
145
- 67
--------- complement of subtrahend
145
+ 932
--------- addition
1077
--------- "complement" of result (subtract 1000 and add 1).
78
Despite the vertical space they consume here, these methods are fairly convenient for pencil and paper use, with one glaring exception.
Used as a "subroutine" in long division, the constant need to swap digits with difference-from-9 counterparts is very impractical, as is the fact that the "implicit zeroes" to the right of the current partial quotient need to be complemented and changed into 9
s.
28r8
_______
31 ) 876 0 #1 start
62 20 #2 partial quotient
876 #3 dup #1
379 #4 complement #2
1255 #5 add #4, #5
256 #6 complement #5
248 8 #7 partial quotient
256 #8 dup #6
751 #9 complement of #7
1007 #10 add #8, #9
8 #11 complement of #10
Is there a way of doing long division with this method of subtraction that doesn't involve repeating digits so many times?
arithmetic
arithmetic
asked Dec 16 '18 at 2:33
Gregory NisbetGregory Nisbet
734612
734612
add a comment |
add a comment |
0
active
oldest
votes
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%2f3042175%2fmethod-of-long-division-based-on-10s-complement%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f3042175%2fmethod-of-long-division-based-on-10s-complement%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