Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

overflow by comparaison

Status
Not open for further replies.

maturainfankam

Newbie level 4
Joined
Aug 5, 2014
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Bremen
Activity points
90
hi,
i have design a priority Queuing for value comparaison, the heap is always the smaller value.
1 - the value to compare are update dynamic ( with some add operation)
2 - the value to compare are represented with 16 Bit => when i update the values, we can get a overflow and the comparaison is not anymore correct.
how can i deal with these problem.
Best regards.
maturain
 

If you get an overflow then 16 bits are obviously not enough. You can use 32-bit instead.
If you only have problems with the comparison operation, copy the values to compare in 32-bit operands before performing the operation.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top