I've decided to start learning some logic design recently. I'm current at the very first unit in the book I'm using (Fundamentals of Logic Design - 5th Edition if it's of any importance) and it's given me a series of questions to answer. Prior to the actual question, it gave me the following: A - B = A (-B). Add the complement of a number with a regular number in place of actually subtracting those numbers directly.
I've gotten to a question where it's asking me to subtract 10110 (22) with 01101 (13) by adding 10110 (22) and the 1's complement of 01101 (10010) together. You'd assume that the answer would be 1001 (9), right? I did just that and did get 01001, but the solutions section of the book I'm using state that there is an overflow. I've even checked another version of the solutions section online, but it's still stated as an overflow. I just want to know why the book stated that this would result in an overflow, but still have the binary representation of the output be correct.
The solution from the book solution section
I'm still new with this whole logic design stuff. 1's and 2's complement did get me a bit hung up. Help would be appreciated.
CodePudding user response:
I believe the book is simply trying to state that you have to ignore the overflow when using this method of subtraction, that 01001
is the correct answer and not 101001
.
Are you unsure of what 'overflow' means? Can you perhaps try to restate what your actual question is?