Thread Closed

boolean help. adder and subtractor

 
Share Thread Thread Tools
Jan26-04, 04:25 PM   #1
 

boolean help. adder and subtractor


A boolean circuit has 4 inputs, a, b, cin and K. when K=0, the circuit is an adder. When K=1, the ciruit is a subtractor. WHere do I start? [o)] [*(] [g)] [?]
 
PhysOrg.com
PhysOrg
engineering news on PhysOrg.com

>> Researchers use light projector and single-pixel detectors to create 3-D images
>> GPS solution provides 3-minute tsunami alerts
>> Single-pixel power: Scientists make 3-D images without a camera
Jan26-04, 09:07 PM   #2
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Depends on what you're trying to do and what you already know. I imagine you want the circuit for your adder/subtractor, right?

There are lots of ways to go:

You could build an adder, a subtractor, and a chooser circuit.

You could make a truth table and build the circuit from that.

You could analyze the difference between the circuits of an adder and a subtractor and hack it to provide the toggling capability.
 
Jan26-04, 10:28 PM   #3
 
i'm not trying to make a REAL circuit, I just need to know the boolean equation and schematic. I already know what full adder and subtractor look like. I just don't know how to toggle between the two with a 4th input K.
 
Jan26-04, 10:35 PM   #4
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus

boolean help. adder and subtractor


Well, my post still applies if you replace "circuit" with "formula".
 
Jan27-04, 01:42 AM   #5
 
not helping[*(]
 
Jan27-04, 02:44 AM   #6
 
Originally posted by david90
A boolean circuit has 4 inputs, a, b, cin and K. when K=0, the circuit is an adder.
The inputs a and b are they 1 bit or buses?
 
Jan27-04, 06:34 AM   #7
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Well, there are two cases, right?

K is false and the formula gives the output of an adder
or
K is true and the formula gives the output of a subtractor
 
Jan27-04, 02:06 PM   #8
 
still not helping. ur just restating my question. I already know there are 2 cases and that k=0 then it is an adder.
 
Jan27-04, 02:14 PM   #9
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Consider the naive approach: multiplex the outputs of each, as Hurkyl said.

A two-bit multiplexor looks like this:

(m & s) | (n & ~s)

where & is AND, | is OR, and ~ is NOT. m and n are the two inputs, and s is the select signal.

Does this make sense?

If you want to make the simplest possible formula, replace m and n with the formulas for a 1-bit adder and a 1-bit subtractor. Finally, do all the boolean simplification you can.

Another approach would be to write out a truth table for the whole design -- a K-map -- and do the normal K-map stuff to get the equation.

- Warren
 
Jan27-04, 02:32 PM   #10
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
still not helping. ur just restating my question. I already know there are 2 cases and that k=0 then it is an adder.
There's something special about the way I restated your question; it's directly translatable into a formula!


K is false and the formula gives the output of an adder
or
K is true and the formula gives the output of a subtractor
Is the same as

(~K & (formula for adder)) | (K & (formula for subtractor))
 
Jan27-04, 02:45 PM   #11
 
Thanks i kinda get it now. what is "~"?
 
Jan28-04, 02:40 AM   #12
 
Originally posted by david90
what is "~"?
it is another way of saying not...
~a = !a = not(a)
 
Jan28-04, 12:19 PM   #13
 
not is an inverter right?
 
Jan28-04, 12:37 PM   #14
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Yes, it's an inverter. David, you seem to be completely unprepared to handle this problem. Why? Are you in a class where this was asked? Are you not paying any attention to the lectures?

- Warren
 
Jan28-04, 05:44 PM   #15
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Here, I'll give you a hint to get you started:

Think "2's compliment subtraction"
 
Jan30-04, 12:31 AM   #16
 
I have been paying attention in class. It is just that my prof. cares so much about me and the students about getting a job after grad. that he teaches some extra stuff that we're not suppose to learn in ece 204. I'm not sure if I should cuss him out or thank him.[g)]
 
Jan31-04, 02:07 AM   #17
 
what is a weighted code (BCD related) and how does it relates to gray code?
 
Thread Closed
Thread Tools


Similar Threads for: boolean help. adder and subtractor
Thread Forum Replies
Adder and Subtractor Unit Electrical Engineering 1
Boolean rings and Boolean algebras Set Theory, Logic, Probability, Statistics 2
How to use 4-bit parallel adders to perform 2Cs' subtraction? Electrical Engineering 2
4-bit binary subtractor Electrical Engineering 7
Full adder boolean logic question Electrical Engineering 3