Is addition(+) operation more complex than comparison operation (>), both in integer as well as floating point arithmetic? I would appreciate answer in the context of both microprocessor- and FPGA-based systems.
My thought:
I think comparison and addition are the same thing when we talk about microprocessor-based systems because comparison a>b can be solved by checking the sign bit of (a-b), i.e, an addition operation. But, in the context of FPGA-based systems, I guess the complexity of comparison operator can be reduced?
Comparison is a bit “simpler” for integers, because we only need to compare each bit from msb to lsb (without a carry bit, which is needed by addition). In terms of complexity, both are O(log n) though.
But I doubt you can actually measure this small difference in terms of resource usage (logic slices or power consumption).