Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

1 bit Full Subtractor

This topic is 2950 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am really confused on how to construct a truth table for a one b!t Fu11 Subtr4ct0r
....everywhere i've looked, i see them using 3 inputs(borrow in,input A,input B) and for output there is 2(sum bit,borrow out). I dont understand the borrow out bit. I know if u subtract bit 0-1 you cannot and must perform a borrow in from the bit in front of it. but What the heck is a borrow out used for in subtraction? if anyone could give a binary subtraction example + decimal subtraction example showing how borrowin and borrow outs are both used id be greatly appreciated.

-thx

[Edited by - Sneftel on October 25, 2010 12:26:15 PM]

Share this post


Link to post
Share on other sites
Advertisement
Borrow out is how the Nth bit tells the N+1th bit "I'm borrowing from you". Borrow in is how the Nth bit finds out from the N-1th bit "I borrowed from you". It's very similar to the carry bit in the full adder.



Bit3 Bit2 Bit1 Bit0
1 1 0 0
- 0 0 0 1
------------------
1 0 1 1

Bit0 has to subtract 1, but only has a 0 to subtract from. He sets borrow-out to 1, (his borrow-in is 0, since he's the lowest bit), meaning he's borrowing a 2, and 2-1=1. Bit1 was going to subtract 0-0 and get 0, but now his borrow-in is 1 (because it's connected to Bit0's borrow-out), so now he has 0-0-1, which again can't be done. So he also borrows 2, this time from Bit2, by setting borrow-out, and thus performs (2+0)-0-1=1. Bit2 gets the borrow-in from Bit1, and does 1-0-1=0; he doesn't have to borrow, so his borrow-out is 0. Bit3 doesn't have borrow-in set, so he just does 1-0=1.

Share this post


Link to post
Share on other sites

This topic is 2950 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!