Library of Arithmetic Units
SystemVerilog Edition!
Based on the VHDL library written by Reto Zimmermann.
The library contains various arithmetic operations with multiple architectural choices for different speed requirements. All operations are parametrized in width and performance grade.
Disclaimer
This project is still under active development; some parts may not yet be fully functional, and existing interfaces, toolflows, and conventions may be broken without prior notice. We target a stable release as soon as possible.
License
All code checked into this repository is licensed under the permissive Solderpad Hardware License 0.51 (See LICENSE).
Available Operations
Adders
| Name | Description | unsigned | signed | slow | medium | fast |
|---|
| Add | Adder | X | X | S | M | F |
| AddC | Adder with carry-in, carry-out | X | | S | M | F |
| AddCfast | Adder with fast carry-in, carry-out | X | | S | M | F |
| AddV | Adder with carry-in, 2’s compl. overflow flag | | X | S | M | F |
| AddMod2Nm1 | Adder modulo 2^n - 1 (double zero representation) | X | | S | M | F |
| AddMod2Nm1s0 | Adder modulo 2^n - 1 (single zero representation) | X | | S | M | F |
| AddMod2Np1 | Adder modulo 2^n + 1 | X | | S | M | F |
| AddCsv | Carry-save adder (3 operands) | X | X | | | F |
| AddMop | Multi-operand adder | X | X | S | M | F |
| AddMopCsv | Carry-save multi-operand adder | X | X | S | | F |
Subtractors, Complementers
| Name | Description | unsigned | signed | slow | medium | fast |
|---|
| Sub | Subtractor | X | X | S | M | F |
| SubC | Subtractor with carry-in, carry-out | X | | S | M | F |
| SubCZ | Subtractor with carry-in, carry-out, zero flag | X | | S | M | F |
| SubV | Subtractor with carry-in, 2’s compl. overflow flag | | X | S | M | F |
| SubVZ | Subtractor with carry-in, 2’s compl. ovl. & zero flag | | X | S | M | F |
| Neg | 2’s complementer (negation) | | X | S | M | F |
| NegC | 2’s complementer, conditional | | X | S | M | F |
| AbsVal | Absolute value for 2’s complement numbers | | X | S | M | F |
Adder-Subtractors
| Name | Description | unsigned | signed | slow | medium | fast |
|---|
| AddSub | Adder-subtractor | X | X | S | M | F |
| AddSubC | Adder-subtractor with carry-in, carry-out | X | | S | M | F |
| AddSubV | Adder-subtractor with carry-in, 2’s compl. ovl. flag | | X | S | M | F |
Incrementers, Decrementers
| Name | Description | unsigned | signed | slow | medium | fast |
|---|
| Inc | Incrementer | X | X | S | M | F |
| IncC | Incrementer with carry-in, carry-out | X | | S | M | F |
| Dec | Decrementer | X | X | S | M | F |
| DecC | Decrementer with carry-in, carry-out | X | | S | M | F |
| IncDec | Incrementer-decrementer | X | X | S | M | F |
| IncDecC | Incrementer-decrementer with carry-in, carry-out | X | | S | M | F |
Comparators
| Name | Description | unsigned | signed | slow | medium | fast |
|---|
| CmpEQ | Equality comparator | X | X | | | F |
| CmpGE | Magnitude comparator | X | | S | M | F |
| CmpEQGE | Equality and magnitude comparator | X | X | S | M | F |
Multipliers
| Name | Description | unsigned | signed | slow | medium | fast |
|---|
| DivArrSgn | Signed array divider | | X | S | | |
| DivArrUns | Unsigned array divider | X | | S | | |
| SqrtArrUns | Unsigned array square-root extractor | X | | S | | |
Detectors
Encoders, Decoders, Gray
Miscellaneous