https://github.com/dawsonjon/verilog-math
Mathematical Functions in Verilog
https://github.com/dawsonjon/verilog-math
Last synced: 6 months ago
JSON representation
Mathematical Functions in Verilog
- Host: GitHub
- URL: https://github.com/dawsonjon/verilog-math
- Owner: dawsonjon
- License: mit
- Created: 2017-04-03T17:55:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-07T15:05:24.000Z (almost 5 years ago)
- Last Synced: 2025-03-23T21:47:06.806Z (9 months ago)
- Language: Verilog
- Size: 2.1 MB
- Stars: 91
- Watchers: 10
- Forks: 29
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: COPYING.txt
Awesome Lists containing this project
README
[](https://github.com/psf/black)

# IEEE 754 floating point functions
Synthesiseable IEEE 754 floating point library in Verilog.
- Fully pipelined, high performance
- Arithmetic: Divider, Multiplier, Adder, Subtracter and Square Root
- Conversions: float_to_int and int_to_float
- Rounding Functions: floor, ceil, truncate and nearest
- Supports Denormal Numbers
- Round-to-nearest (ties to even)
- Double and single precision versions of each function
# IP Cores
The library uses a python script to automatically generate and pipeline logic
functions. Pre-generated IP cores written in Verilog can be found in the components
folder. Each component is fully pipelined and the output value is expected after a
fixed number of clock cycles. The latency of each block can be found in a comment in
the Verilog code.
# Run Test Suite
Requires Python 3 and Icarus Verilog. On Ubuntu based systems these can be installed as follows:
``` bash
sudo apt-get install python iverilog
```
To run the full test suite, run the following:
``` bash
cd components
python test_cores.py # for the single precision test suite
...
python test_double_cores.py # for the double precision test suite
...
```