Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on 2 bit subtractor using full subtractor

Post

2 bit subtractor using full subtractor

+2
−1

Can we make a n-bit subtractor using full subtractors or if we want do subtract one binary from another we must use full adders and use the complement of the 2nd number to do the subtraction?

I have only found examples which we use the complement of the second number and using full adders if it is possible to create a n-bit substractor using only full subtractors and without any adders or complements i would really appreciate it if he/she posted the circuit because i am stuck.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Just an aside: In terms of circuit/chip design, there is rarely a reason to want separate adders and subtractors... (6 comments)
Just an aside: In terms of circuit/chip design, there is rarely a reason to want separate adders and subtractors...
elgonzo‭ wrote over 3 years ago · edited over 3 years ago

Just as an aside, the reason you usually only find adders and not subtractors is because using two's complement, you only need one instance of logic block (adder) in a circuit to do both operations. Consider that die space is usually prime real estate that to a large extent determines the price of a chip together with the amount of process steps required for manufacturing, and it should be no surprise that (usually) no space is wasted on superfluous stuff...

MissMulan‭ wrote over 3 years ago

I have heard that for division of binary numbers you need to understand well subtraction so just like we can multiply 2 numbers with full adders maybe we can divide 2 numbers with full subtractors thats why I want to know how to edo subtraction using full subtractors.

elgonzo‭ wrote over 3 years ago · edited over 3 years ago

Multiplication in hardware is a combination of adders and bit shifting. Thus multiplying two 64-bit numbers, however large, only takes 64 bit shifts plus at max. 64 additions. This is not only incredibly fast, but also cheap in circuitry. You only need an 128 bit adder, a 128-bit shift register, another 64-bit shift register (or an interconnect fabric that provides the bit-shifted operands), a 128-bit result register, a little glue logic and possibly an intermediary 128-bit register (that loops the intermediary adding result back into the adder). Division will involve additional logic (not just bit shifting and adding/subtracting).

elgonzo‭ wrote over 3 years ago · edited over 3 years ago

Actually, trying to brute-force division with a bunch of subtractions alone is slow like molasses (like it would if doing multiply with adders alone). For some idea wrt to hardware division look for example here: https://electronics.stackexchange.com/questions/155899/implementing-integer-division-in-hardware. It is somewhat similar to multiplication in that it also involves bit shifting, but note the additional comparison logic required...

elgonzo‭ wrote over 3 years ago · edited over 3 years ago

That said, fast division in HW is still a topic for research papers. As an example here a paper from 2005: https://www.researchgate.net/publication/4156467_A_hardware_algorithm_for_integer_division (disclaimer: I haven't read that paper, so i don't know whether it is a good paper or just hot garbage. Me linking to it is not an endorsement or judgement of its quality. I only linked to it to demonstrate that HW integer division is still a subject for academic and/or scientific papers even in this day and age...)

MissMulan‭ wrote over 3 years ago

I think multiplication can be done without bit shifting just by using full adders and taking advantage of the vertical addition of 2 binary numbers.However we are missing the point here.Is there a similar 'function' which does the same for vertical subtraction?