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.

fastest way to compare numbers

Status
Not open for further replies.

kuntul

Newbie level 6
Joined
May 1, 2010
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,379
What is the fastest possible way to compare two 32 bit numbers? As of now I am using verilog '==' and when I synthesize it the delays are enormous.
 

Are you constraining the design, such that the synthesis tools optimize for speed?
 

and how do I do that in xilinx?
 

Try to find a logic that can support your functionality such that it compares only part of the 32 bit word instead of comparing whole word.
Then write the HDL code accordingly.
If you use 32-bit word for comparing, then a 32-bit comparator is implemented in synthesis due to which delay also increases accordingly.
 

Make sure that the two inputs are registered, otherwise you get the input calc delay added to the == calc delay. If that still isnt enough, you may have to pipeline, taking several clock cycles to calculate a mid result (such as doing four single-byte == compares) then combining to get a final result. (some synth tools will do this 'automatically' if you add a few series flip-flops and enable re-timing.)

All assuming you gave your tools a good freq constraint.
 

If possible, you can pipeline your design, and compare say 8 bits at a time or even less if your throughput rate allows you. You can bump up the clock speed to 4 times and pipeline the comparison so you look at a byte each clock cycle (4x fast) and the result will be ready at the slower clock speed.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top