Designing a Circuit to Return Absolute Value of 3-bit Number

In summary: Input | Output0 0 0 | 0 0 00 0 1 | 0 0 10 1 0 | 0 1 00 1 1 | 0 1 11 0 0 | 1 0 01 0 1 | 1 0 11 1 0 | 1 0 01 1 1 | 1 0 1Now, you have to figure out how to use logic gates to convert the output of the circuit to the absolute value. Can you
  • #1
Max0007
66
1

Homework Statement


Make the design of a circuit returning the absolute value of a number of 3 bits . The input and output
must be signed , use the complement 2. Show your approach and draw your track
using logic gates.

I seriously do not understand this at all. What am I supposed to do?

Homework Equations


N/A

The Attempt at a Solution


N/A
 
Physics news on Phys.org
  • #2
Max0007 said:

Homework Statement


Make the design of a circuit returning the absolute value of a number of 3 bits . The input and output
must be signed , use the complement 2. Show your approach and draw your track
using logic gates.

I seriously do not understand this at all. What am I supposed to do?

Homework Equations


N/A

The Attempt at a Solution


N/A

What is your background? How much have you studied logic and/or digital electronics? What kind of course is this for? How is it that you are being asked to do a problem and you don't even understand the problem, much less how to solve it?
 
  • #3
phinds said:
What is your background? How much have you studied logic and/or digital electronics? What kind of course is this for? How is it that you are being asked to do a problem and you don't even understand the problem, much less how to solve it?
This is electronic engineer first year Bach. Its a course about Digital electronics, we just started 1 month ago. I understand logic, gates, etc. I just do not understand what I actually have to do with the question, for me its not clear enough.

Some step on how I have to proceed would actually help me.

How I do the table of truth of it?

circuit returning the absolute value of a number of 3 bits // returning the absolute value? what does this mean? How can it be negative and return the absolute value at the same time if we want the output to be signed(negative)?
The input and output must be signed // signed? what does this actually mean, It must be negative?
use the complement 2 // I know what is complement 2.

This is all confusing me.
 
  • #4
Max0007 said:
This is electronic engineer first year Bach. Its a course about Digital electronics, we just started 1 month ago. I understand logic, gates, etc. I just do not understand what I actually have to do with the question, for me its not clear enough.

Some step on how I have to proceed would actually help me.

How I do the table of truth of it?
Well, can you write out all the possible numbers using 3 digits of two's complement notation? That's the first step. Then show what each of them have to be to represent the absolute value of the same number. Can you do that?
 
  • #5
phinds said:
Well, can you write out all the possible numbers using 3 digits of two's complement notation? That's the first step. Then show what each of them have to be to represent the absolute value of the same number. Can you do that?
Here:
A B C
0 0 0 = 0
0 0 1 = 1
0 1 0 = 2
0 1 1 = 3
1 0 0 = -4
1 0 1 = -3
1 1 0 = -2
1 1 1 = -1
 
  • #6
phinds said:
Well, can you write out all the possible numbers using 3 digits of two's complement notation? That's the first step. Then show what each of them have to be to represent the absolute value of the same number. Can you do that?
What I have to do after this?
Thanks for helping me I really appreciate it.
 
  • #7
Well, you've only answered half my question. You need to put what you have in a table and add what they need to become to be the absolute value. Then you have a pair of goals ... build the adder to get the first set then use logic gates to convert it to the second set. Better still would be to figure how to just combine the two.
 
  • #8
phinds said:
Well, you've only answered half my question. You need to put what you have in a table and add what they need to become to be the absolute value. Then you have a pair of goals ... build the adder to get the first set then use logic gates to convert it to the second set. Better still would be to figure how to just combine the two.
Can you give me an example of this please "You need to put what you have in a table and add what they need to become to be the absolute value."
I don't really understand.
 
  • #9
Do you know what "absolute value" IS? You have a value of +3 and you have a value for -3. How would the two relate when taking the absolute value of each?
 
  • #10
phinds said:
Do you know what "absolute value" IS? You have a value of +3 and you have a value for -3. How would the two relate when taking the absolute value of each?

A B C Absolute value
0 0 0 = 0 0 0 0
0 0 1 = 1 0 0 1
0 1 0 = 2 0 1 0
0 1 1 = 3 0 1 1
1 0 0 = -4 1 0 0
1 0 1 = -3 0 1 1
1 1 0 = -2 0 1 0
1 1 1 = -1 0 0 1

would this be correct?
 
  • #11
Good. Now can you map the input to the output. That is, skip the adder step and just write down the inputs and the outputs to your circuit.
 
  • #12
phinds said:
Good. Now can you map the input to the output. That is, skip the adder step and just write down the inputs and the outputs to your circuit.
Just so I understand better.

I have 3 intput and 3 output right?

For example my input is A B C, and I have 1 1 1 as my input, my output should be 0 0 1?
So to do that I have to make a logic circuit with AND / OR /NOT ?
 
  • #13
Max0007 said:
Just so I understand better.

I have 3 intput and 3 output right?

For example my input is A B C, and I have 1 1 1 as my input, my output should be 0 0 1?
So to do that I have to make a logic circuit with AND / OR /NOT ?
Yes, although what type(s) of gate(s) you use is sometimes a part of the problem statement. Since that does not seem to be the case here, then yes, I would stick to AND / OR / NOT types

So map the 3-bit input to the 3-bit output. Do you know how to use Karnaugh maps? That would be my personal preference for the next step but it's not the only way to go.
 
  • #14
phinds said:
Yes, although what type(s) of gate(s) you use is sometimes a part of the problem statement. Since that does not seem to be the case here, then yes, I would stick to AND / OR / NOT types

So map the 3-bit input to the 3-bit output. Do you know how to use Karnaugh maps? That would be my personal preference for the next step but it's not the only way to go.
I understand Karnaugh but in my case, I don't understand how to do it since I have 3 outputs.
Usually I do it with 1-5 inputs and 1 output only.
 
  • #15
Max0007 said:
I understand Karnaugh but in my case, I don't understand how to do it since I have 3 outputs.
Usually I do it with 1-5 inputs and 1 output only.
Well, maybe you could do a K-map for EACH of the 3 outputs ... might that work?
 
  • #16
phinds said:
Well, maybe you could do a K-map for EACH of the 3 outputs ... might that work?
So for the first Karnaugh would this be right? its for the first ouput.
6OGbttz.png
 
  • #17
Max0007 said:
So for the first Karnaugh would this be right? its for the first ouput.
6OGbttz.png
Since you have not defined what "first output" means, I wouldn't know. Do you mean the most significant bit or the least significant bit? Do you see how that designation is more meaningful than "first output" ?
 
  • #18
phinds said:
Since you have not defined what "first output" means, I wouldn't know. Do you mean the most significant bit or the least significant bit? Do you see how that designation is more meaningful than "first output" ?
---------------Outputs
A B C = ------1 2 3
0 0 0 = 0-----0 0 0
0 0 1 = 1-----0 0 1
0 1 0 = 2-----0 1 0
0 1 1 = 3-----0 1 1
1 0 0 = -4----1 0 0
1 0 1 = -3----0 1 1
1 1 0 = -2----0 1 0
1 1 1 = -1----0 0 1

Output1
jG5QEbh.png

Equation: A/B/C

Output2
v6Mae0k.png

Equation: /AB+A/BC+B/C

Output3
mCT4jt8.png

Equation: C

To put all this together I do this ? C + (/AB+A/BC+B/C) + (A/B/C)
 
Last edited:
  • #19
l
 
Last edited:
  • #20
Your equations at a quick glance appear (1) wrong, and (2) ridiculously complex.

For example, #3 obviously should be 3=C

You K-maps look nothing like what I am accustomed to. Is that how they are done these days? Here's mine.

kmap.jpg
 
  • #21
Max0007 said:
---------------Outputs
A B C = ------1 2 3
0 0 0 = 0-----0 0 0
0 0 1 = 1-----0 0 1
0 1 0 = 2-----0 1 0
0 1 1 = 3-----0 1 1
1 0 0 = -4----1 0 0
1 0 1 = -3----0 1 1
1 1 0 = -2----0 1 0
1 1 1 = -1----0 0 1

Alternatively, you could determine the logic by examining your table. Looking at output 2,
we see it's 1 when A=0,B=1,C=? and also when A=1,B=0,C=1 and when A=1,B=1,C=0
This gives rise to the equation: O2 = A' B + A B' C + A B C'
and maybe this can be simplified further.

By inspection, you can see that whenever C is 1 then O3 is 1, so we can write O3 = C, as phinds found.
 
Last edited:
  • #22
One last question.
If I want to write -2 in binary in Sign&magnitude format, is 110 correct? I have to use the least bit possible.
 
  • #23
The sign bit being on implies negative.
 
  • #24
phinds said:
The sign bit being on implies negative.
So it would be right to say its 110? Because my teacher puts 1010 and says to use least bit possible.
 
  • #25
Max0007 said:
So it would be right to say its 110? Because my teacher puts 1010 and says to use least bit possible.
Well, 1xx will allow a negative range -1...-3 and 1xxx will allow -1...-7
 
  • #26
Max0007 said:
So it would be right to say its 110? Because my teacher puts 1010 and says to use least bit possible.
Which part of "The sign bit being on implies negative." did you not understand?
 
Last edited:
  • #27
Max0007 said:
So it would be right to say its 110? Because my teacher puts 1010 and says to use least bit possible.
It would seem unwise to mix 3 bit and 4 bit representations in the same discussion. How is anyone to know that by 110 you actually intend them to understand it to be an abbreviation of 1010, when it's already quite conventional to abbreviate 0110 as 110. Similarly, 11 could be interpreted by most people as 0011, when you thought it was an economical abbreviation of -1.

I think your teacher is right. Preserve all 4 digits.
 

Related to Designing a Circuit to Return Absolute Value of 3-bit Number

1. What is a circuit?

A circuit is a collection of electronic components, such as resistors, capacitors, and transistors, connected together to create a specific function or operation. In this case, a circuit is being designed to return the absolute value of a 3-bit number.

2. Why is returning the absolute value of a number important?

The absolute value of a number is its distance from zero on a number line. It is important because it ensures that the output of the circuit will always be a positive value, regardless of whether the input number is positive or negative.

3. How does a circuit return the absolute value of a number?

A circuit can return the absolute value of a number by using logic gates, such as NOT, AND, and OR gates, to manipulate the bits of the input number. By applying the correct logic operations, the circuit can output the absolute value of the input number.

4. What are the key components needed to design a circuit for returning absolute value of a 3-bit number?

The key components needed to design a circuit for returning absolute value of a 3-bit number include logic gates, such as NOT, AND, and OR gates, as well as a power source, wires for connecting the components, and a 3-bit number input.

5. Can a circuit be designed to return the absolute value of numbers with more than 3 bits?

Yes, a circuit can be designed to return the absolute value of numbers with more than 3 bits. However, the complexity of the circuit will increase as the number of bits increases, and more logic gates will be needed to perform the necessary operations.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
985
  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
20
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
11
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
17K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top