All About Circuits Forum  

Go Back   All About Circuits Forum > Abstract Forums > Math


Math Discussion forum for anything math related.

Reply   Post New Thread
Thread Tools Display Modes
Old 10-13-2011, 03:31 AM
Papabravo's Avatar
Papabravo Papabravo is offline
Senior Member
Join Date: Feb 2006
Location: Michigan, USA (GMT-5)
Posts: 5,850

The end-around-carry means that you take the carry bit and add it to the result of the addition. In 4-bit words
   0 1 1 1  -->  7
+  1 1 1 0  --> -1
 1 0 1 0 1       6
Select All
So here we have a 4-bit result of 0101 == 5 and a carry
   0 1 0 1  --> Result of 5
+  0 0 0 1  --> Carry from the original addition
   0 1 1 0  --> True result of 6
Select All
That was an end-around-carry
We never have time to do it right,
But we always have time to do it over.
Reply With Quote
The Following User Says Thank You to Papabravo For This Useful Post:
PG1995 (10-18-2011)
Old 10-18-2011, 12:32 PM
PG1995's Avatar
PG1995 PG1995 is offline
Senior Member
Join Date: Apr 2011
Posts: 753

Thank you very much, GeoRacer, MrChips, Papabravo.

I'm sorry to say this but I'm still a bit confused. But the good thing is I can understand the topic in my book. What I'm inquiring about here is for my personal learning. But as advised by GeoRacer I won't pursue the topic further after finishing this discussion. Please be patient! Thanks.

In binary system 2's complement is the maximum complement one can find. I mean to say you can't think of finding 3's complement in base 2. As I have been told 2's complement doesn't give create any problem as compared to 1's complement which has two representation for 0. I'm just curious to know if this also happens in other bases such as base 10 that using, say, 4's complement gives problems such as two representation for 0.

Originally Posted by Georacer View Post
Lemme take a shot at it: 0029+5532=5561. Obviously there is an overflow and thus the result must be negative. We will complement the result to find the results absolute value: |5555-5561|=|-6|=6
Bingo! (Didn't think that would work so well)
For example, in 2's complement in the binary, MSB is a sign bit. We can know by looking at the binary if it's a negative one or a positive (assuming we know that we are using complementary method). Here, in the decimal, you have overflow condition to infer the negativity of the number. Is this so?

Do we discard carry in case of decimal too if there is one?

Originally Posted by Georacer View Post
Lastly, your book reference wasn't at fault. It's just that it only applies to the <base>'s complement of a number in the <base> numbering system. Check these two examples:
10's complement of 3 is 6 (by his method) which makes it
We disregard 1 as instructed by step 3 and the answer is 5.

10's complement of 7 is 2.
There is no carry thus the answer is
If I was using doing this: 9-3. I would do it as follows: 3's complement is 7 because 3+7=10 (discard the "1"), now 9+7=16. Obviously, my method doesn't work here. Where am I going wrong? Please help me.

Originally Posted by MrChips View Post
Here we go again.
If you want to use a single digit of base 10, the numerals are 0,1,2,3,4,5,6,7,8,9.
But you are mixing up unsigned with signed numbers. If you want signed numbers then the conversion is:
0 0
1 1
2 2
3 3
4 4
5 -5
6 -4
7 -3
8 -2
9 -1

Therefore the value 9 does not exist. 9 is really -1. So your result is -1, the correct answer.
So, we have two side by side sets. MrChips, I have a big confusion here. So, please don't mind my question. Suppose we want to use double digits of base 10, then I think we have numbers from 0 - 99.

Suppose I want to do (-4 x 2 = 8) using complementary method. What would be -4's complement? 96 or 6? I'm saying this because (4+96=100) and (4+6=10).
Reply With Quote
Old 10-18-2011, 12:58 PM
MrChips's Avatar
MrChips MrChips is offline
Super Moderator
Join Date: Oct 2009
Posts: 9,315
Blog Entries: 24

If you want signed numbers, you will have to either divide your value range in half or double the number of states.
So if we want 0 to 99 in both positive and negative:

0 0
1 1
99 99
100 -100
101 -99
191 -9
192 -8
193 -7
194 -6
195 -5
196 -4
197 -3
198 -2
199 -1

So -4 x 2 is 196 x 2 = 392 = -8
Most computer problems can be attributed to a simple problem - a loosewire behind the keyboard.

Reply With Quote
Old 10-18-2011, 01:57 PM
Georacer's Avatar
Georacer Georacer is offline
Super Moderator
Join Date: Nov 2009
Location: Athens, Greece (GMT +2)
Posts: 4,875


You quoted it yourself:
To find the complement of a n-digit long number: (base)^n - 1 - number. This is how subtraction is done using complementary method: 1. Find the complement of the subtrahend. 2. Add the complement to minuend. 3. If there is a carry of 1, add it to obtain the result; if there is no carry, re-complement the sum and attach a negative sign to obtain the result.
That said, the complement of 3 is 10-1-3=6 and 9-3->9+6->15->1+5->6

What you did wrong is the calculation of the complement. I know that 3+6 isn't equal to 10, but your source's method works, so I 'll stick to it.
As I said, I don't master the art of enumeration methods and numerical analysis.
I am a prisoner of high standards and low social skills

I wish I was the best at what I would do, and what I would do wouldn't be pretty.
Reply With Quote
Reply   Post New Thread

, ,

Related Site Pages
Section Title
Worksheet Digital codes
Worksheet Binary math
Worksheet Numeration systems
Textbook Finite-state machines : Principles Of Digital Computing
Textbook Binary count sequence : Sequential Circuits Counters
Textbook 7-segment display : Digital Integrated Circuits
Textbook Overflow : Binary Arithmetic
Textbook Subtraction : Binary Arithmetic
Textbook Negative binary numbers : Binary Arithmetic
Textbook Octal and hexadecimal numeration : Numeration Systems

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 07:04 AM.

User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.