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

Click For Summary

Discussion Overview

The discussion revolves around designing a circuit that returns the absolute value of a 3-bit signed number using two's complement representation. Participants explore the requirements of the circuit design, including the use of logic gates and the creation of truth tables.

Discussion Character

  • Homework-related, Technical explanation, Conceptual clarification, Exploratory

Main Points Raised

  • Some participants express confusion about the homework question and seek clarification on what is required to design the circuit.
  • Participants discuss the concept of absolute value in the context of signed numbers and how it relates to two's complement notation.
  • There are suggestions to create a truth table that maps the 3-bit input values to their corresponding absolute values.
  • Some participants propose using Karnaugh maps to simplify the logic for each output, while others question the complexity of the equations derived from the K-maps.
  • There are differing opinions on how to define the outputs and the significance of the bits in the context of the circuit design.
  • Participants share their attempts at writing equations for the outputs based on their K-map results, leading to further discussion about their correctness and complexity.

Areas of Agreement / Disagreement

Participants generally agree on the need to create a truth table and use K-maps for simplification, but there is no consensus on the correctness of the equations derived or the approach to defining outputs.

Contextual Notes

Some participants note the potential confusion arising from the terminology used, such as "first output," which lacks clarity without further specification. The discussion also highlights the varying levels of familiarity with digital electronics concepts among participants.

Who May Find This Useful

This discussion may be useful for students in digital electronics courses, particularly those learning about circuit design, two's complement representation, and logic gate implementation.

Max0007
Messages
66
Reaction score
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
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?
 
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.
 
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?
 
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
 
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.
 
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.
 
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.
 
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.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 7 ·
Replies
7
Views
8K
Replies
16
Views
4K
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
19K
Replies
20
Views
4K
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K