Using LPM_ADD_SUB: Signed Numbers
MegaWizard Assumes Signed Numbers
Sign Extend Data Width and Ignore Carry
- Example: Adding Two 8 Bit Signed Buses
- Sign extend to 9 Bit and use a 9-bit ¡°SIGNED¡± LPM_ADD_SUB
- Use the 9 bit result and ignore the carry out
- Example: Adding Two 8 Bit Unsigned Buses
- Set the 9th Bit to zero and use a 9-bit ¡°SIGNED¡± LPM_ADD_SUB
- Use the 9 bit result and ignore the carry out
Use LPM_ADD_SUB to access ¡°UNSIGNED¡± Numbers.
ADD_SUB port will increase the design size and reduce speed
If possible use ADD functions with sign extension