Forum Discussion
Altera_Forum
Honored Contributor
13 years agoAdvantages of LPM_COMPARE vs. LPM_XOR vs. XOR when comparing two 32 bit numbers
Hi, I need to compare two numbers in a combinational circuit. The inputs are two 32 bit numbers. The output is a single bit and should be "1" when both inputs are equal and 0 when they are not....
Altera_Forum
Honored Contributor
13 years agoWhat Dave said.
I would also take a look at the "Quartus II integrated synthesis handbook" and, if you're really into it, the "Advanced Synthesis Cookbook". Other than that, I suspect that "literature" has a hard time keeping up with the continuous evolution of the synthesis tools and FPGA architectures. One advice, valid for both FPGAs and custom silicon: Do not go aim straight for low level"optimized constructs. Modern synthesis tools can recognize a large number of common high level constructs and convert them into highly optimized designs. As kaz said, "a == b" is probably going to work out as efficiently as anything else you can write. Sometimes, you'll find that the tools don't produce what you expect/need or that they're being unbelievably stupid and you need to get deep down into the details. But that's more the exception than the norm.