{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Negative Numbers and Binary Subtraction

# Negative Numbers and Binary Subtraction - Negative Numbers...

This preview shows pages 1–3. Sign up to view the full content.

Negative Numbers and Binary Subtraction We have seen how simple logic gates can perform the process of binary addition . It is only logical to assume that a similar circuit could perform binary subtraction. If we look at the possibilites involved in subtracting one 1-bit number from another, we can quickly see that three of the four possible combinations are easy and straight-forward. The fourth one involves a bit more: 0 - 0 = 0 1 - 0 = 1 1 - 1 = 0 0 - 1 = 1, with a borrow bit. That borrow bit is just like a borrow in decimal subtraction: it subtracts from the next higher order of magnitude in the overall number. Let's see what the truth table looks like. INPUTS OUTPUTS This is an interesting result. The difference, A-B, is still an Exclusive-OR function, just as the sum was for addition. The borrow is still an AND function, but is A'B instead of AB. What we'd like to do, now, is find an easy way to use the binary adder to perform subtraction as well. We already have half of it working: the difference output. Can we simply invert the A input so the AND gate will have the right signals? No, we can't, because that would invert the sense of the Exclusive- OR function. What would be really nice is to convert B to the negative equivalent of its value, and then use the basic adder just as it stands. To see if we can do that, let's consider negative binary numbers below. A B BORROW A - B 0 0 0 0 0 1 1 1 1 0 0 1 1 1 0 0

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
As we discovered when looking at binary counters , once a full count is obtained, the next clock pulse will cause the counter to read zero again. Likewise if we set up a counter to count backwards , the first clock pulse will cause the count to go from all zeroes to all ones. Thinking along these
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern