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

Dashboard
Notifications
Mark all as read
Q&A

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.

Why does this post require moderator attention?
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)

1 answer

+3
−0

We don't just give direct answers to homework (or homework-like) questions here, but can help you work thru the problem on your own.

You might consider trying to synthesize a subtractor from scratch, just like you would an adder. The fundamental building block of an adder is the half-adder. It takes in two bits to add, and produces the sum and carry bits. Since there are only 4 possible combinations of inputs, a truth table nicely describes its operation exhaustively:

  In1   In2   Sum   Car
  ---   ---   ---   ---
    0     0     0     0
    0     1     1     0
    1     0     1     0
    1     1     0     1

That should be enough to create a circuit of basic logic gates to implement the half-adder. You then chain together two of these per bit to make the full adder. This process is well documented in many place out there, very likely in your textbook too.

Now consider doing the same thing for subtraction. You have two input bits, and two output bits. In this case the output bits are the difference and the borrow.

When you get done with this, it might be instructive to compare that result to constructing a subtractor by complementing one of the input numbers, adding it to the other input number, and adding 1 to the result. Note that adding 1 to the result is the same as if the carry input to the first bit were 1.


I know how to make a full subtractor i just dont know how to connect multiple of them in order to make subtraction of 2 binary numbers with more than 1 bit

That makes little sense. If you really had a full subtractor, then you'd know what the input and output signals were, and then it would be obvious how to chain them to subtract wide numbers.

A full subtractor has three inputs and two outputs. The inputs are the two data bits to subtract, and the borrow input. The outputs are the resulting difference bit and the borrow output. You really should be able to figure out how to chain such blocks to subtract multi-bit numbers.


I cant understand which pins to connect with which pins.

Pins of what exactly? What exactly do you think the pins of this thing are?

Again, we are not here to do your homework for you. You have to put in some effort and be trying to learn. Show a block diagram of this thing, its input and output signals, and explain what you think each of these signals do. You may realize how to hook it up in the process of trying to explain it. Or, if there is a misconception, we'll know better how to help you understand it.

This is getting away from the original question. Instead of adding this to your existing question (and thereby causing confusion), it is probably better to show the diagram, input and output signals, and ask about connecting up the block in a separate question.

Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

I know how to make a full subtractor i just dont know how to connect multiple of them in order to mak... (2 comments)

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!