Constructing Overflow Detection Circuit with Logic Works

  • Thread starter mathrocks
  • Start date
  • Tags
    Lost
In summary: Basically the circuit shown on page 8 is exactly what I need to compare the sign bits, but I'm having trouble understanding how they did this exactly. Like what do the AND and OR gates accomplish and if the output of the overflow is a 0 what does the zero mean?
  • #1
mathrocks
106
0
My teacher assigned this problem for homework and I'm completely lost in what exactly I'm supposed to do. Btw "logic works" is a program we use to implement the circuits.

Using Logic Works, construct a circuit to detect overflow in 4-bit signed-2’s complement addition. Connect your circuit (in Logic Works) to the 4-bit adder included with your kit.

As discussed in class, overflow detection can be accomplished by comparing the sign of the addition inputs to the sign of the output. If the two inputs share the same sign and the output has a different sign, then overflow has occurred.

Hint: Can overflow occur if the two inputs have a different sign? No.

Use only parts available in your pencil box:
4-bit adder – 74_283
NANDs – 74_00
NOTs – 74_04

Further hint: Tie the carry input (C0) of the 4-bit adder to logic zero (or GND) lest you see a lot of unknown values in your output. Ignore the carry out bit (C4).

Test your circuit using a timing file for several different cases (at least 4), which clearly show examples of overflow and non-overflow. For each case explain what is happening in the circuit (i.e. “we are trying to add minus five to minus four and thus overflow because the circuit can only represent down to minus eight”).

I don't really understand what he wants me to do. Do I just build a circuit and the inputs are two 4 bit values and the adder adds the two binary numbers and somehow I detect to see if overflow occured?
I don't understand what the output to the circuit would be? If overflow occurs what will happen? And how do I even detect overflow in my circuit in the first place.

I'm sorry if this is too detailed to answer, but I'm really confused about this whole thing.
Thanks a lot!
 
Engineering news on Phys.org
  • #2
mathrocks said:
Do I just build a circuit and the inputs are two 4 bit values and the adder adds the two binary numbers and somehow I detect to see if overflow occured?
Thats what the task description says.

mathrocks said:
I don't understand what the output to the circuit would be?
The sum of two numbers.

mathrocks said:
If overflow occurs what will happen?
The sum will be wrong.

mathrocks said:
And how do I even detect overflow in my circuit in the first place.
The task description actually tells you. Try reading it again.
 
  • #3
NoTime said:
Thats what the task description says.

The sum of two numbers.

The sum will be wrong.

The task description actually tells you. Try reading it again.

I understand the concept of "overflow" but I don't understand how to actually implement it as a circuit. How do I make a circuit that understands how to compare the signs of the two inputs? That's where I'm getting stuck.
 
  • #4
I'm going to attempt to make my question more clearer.

In order for overflow to occur the inputs must have the same signs or the last two carries are supposed to be the same. So in order to make this circuit I will need to compare the signs of the inputs since the adder I'm using ties all the internal carries together. Do I just look at the left most bit of the 4 digit value for both inputs and if they are equal then an overflow has occured?
 
  • #5
wow, when you say sign do you mean "not vs true"? part numbers seem a little short can you post diagrams?
i am intrigued, and trying to learn something. i have never heard of (or don't recall) anything about 4 bit signed 2's compliment addition for overflow detection with the co (?) input tied to gnd. (is co the trigger?).
please provide the answers when taken up in class.
thanks don
 
  • #6
don rigby said:
wow, when you say sign do you mean "not vs true"? part numbers seem a little short can you post diagrams?
i am intrigued, and trying to learn something. i have never heard of (or don't recall) anything about 4 bit signed 2's compliment addition for overflow detection with the co (?) input tied to gnd. (is co the trigger?).
please provide the answers when taken up in class.
thanks don

http://www.ece.vt.edu/cel/ece2504/lab-manual-spring-2004.pdf

that's the link for the pdf with the part diagrams. The full adder chip is listed on page 9 while the other ones start on page 7. I believe C0 is the initial carry input.

And by sign I mean postive(0) value for negative(1) value. If both inputs are negative or both are postive then there will be a overflow I believe. I'm just confused on how to make the circuit reflect this.

Thanks!
 
Last edited by a moderator:
  • #7
http://engineering.dartmouth.edu/~engs031/hansen/outlines/21Arithmetic.pdf

Basically the circuit shown on page 8 is exactly what I need to compare the sign bits, but I'm having trouble understanding how they did this exactly. Like what do the AND and OR gates accomplish and if the output of the overflow is a 0 what does the zero mean?

Thank you
 
Last edited by a moderator:
  • #8
Do you understand that the maximum absolute number value allowed is 7?
 

Related to Constructing Overflow Detection Circuit with Logic Works

1. What is an overflow detection circuit?

An overflow detection circuit is a digital circuit designed to prevent errors when working with numbers that are too large to be represented accurately by a computer. It detects when the result of a calculation exceeds the maximum or minimum value that can be stored in the computer's memory, and triggers corrective action to prevent data loss or incorrect calculations.

2. How does an overflow detection circuit work?

An overflow detection circuit typically uses comparators and logic gates to compare the calculated result with the maximum and minimum values that can be stored in the computer's memory. If the result is larger than the maximum value, the circuit will trigger an overflow flag or exception. If the result is smaller than the minimum value, the circuit will trigger an underflow flag or exception.

3. Why is an overflow detection circuit important?

An overflow detection circuit is important because it helps to ensure the accuracy and reliability of calculations performed by a computer. Without it, large numbers could be incorrectly represented, leading to incorrect results and errors in data analysis or other important computations.

4. Can an overflow detection circuit be built using Logic Works?

Yes, an overflow detection circuit can be built using Logic Works, which is a digital circuit design software. Logic Works provides a user-friendly interface for designing and simulating digital circuits, making it an ideal tool for constructing an overflow detection circuit.

5. Are there any limitations to using an overflow detection circuit?

One limitation of using an overflow detection circuit is that it only detects overflow and underflow errors after they have occurred. Therefore, it cannot prevent the calculation of incorrect results, but it can help to identify and handle them appropriately. Additionally, an overflow detection circuit may add some computational overhead, which can affect the speed and efficiency of calculations.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
847
  • Programming and Computer Science
Replies
1
Views
697
  • Electrical Engineering
Replies
12
Views
799
  • Electrical Engineering
Replies
13
Views
1K
Replies
7
Views
1K
Replies
9
Views
4K
  • Set Theory, Logic, Probability, Statistics
2
Replies
45
Views
3K
  • Electrical Engineering
Replies
1
Views
3K
Replies
5
Views
3K
  • Electrical Engineering
Replies
12
Views
1K
Back
Top