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.

agorithm to finding smallest signed number in array

Status
Not open for further replies.

david90

Advanced Member level 1
Advanced Member level 1
Joined
May 5, 2004
Messages
423
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Activity points
3,611
What is the best way to do comparison between signed numbers? Is there a way to convert a signed number into an unsigned form? For example, If I have -50, is there way to convert it so that it becomes 50? It would be easier to compare wih other numbers. Hope I making sense.
 

What hardware and which programming language? Equality comparison or magnitude comparison? In most systems, signed and unsigned comparisons are equally fast.

You can convert -50 to 50 by using an absolute value operator or fuction. However, that's no good for comparing signed numbers, because two numbers such as -33 and 33 would then appear to be equal.
 

i'm using pcspim. It is a mips emu.

Comparing signed number is direct until I get to 128. After it is backward. I need help on developing an algorithm that will let me compare signed numbers to see which is bigger or smaller

Thanks
 

Sounds like you want to code an 8-bit signed compare in MIPS32 assembler language. You may have better luck asking your question in a MIPS discussion forum, instead of this PC forum.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top