Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ac_types #52

Open
drom opened this issue Feb 14, 2019 · 0 comments
Open

ac_types #52

drom opened this issue Feb 14, 2019 · 0 comments

Comments

@drom
Copy link
Owner

drom commented Feb 14, 2019

Add support for ac_types

ac_int<W,S>

  • W - width of the number (non-negative interger number)
  • S - signed number (bool flag)
Type Numerical range Quantum
{W: 1, S: false} 0..1 1
{W: 1, S: true} -1..0 1
{W: 4, S: false} 0..15 1
{W: 4, S: true} -8..7 1

ac_int<W, S> === ac_fixed<W, W, S>

ac_fixed<W, I, S, Q, O>

  • W - width of the number (non-negative interger number)
  • I - integer width (non-negative interger number)
  • S - signed number (bool flag)
  • Q - rounding (bool flag)
  • O - overflow (bool flag)
Type Numerical range Quantum
{W: 4, I: 4, S: false} 0..15 1
{W: 4, I: 4, S: true} -8..7 1
{W: 4, I: 6, S: false} 0..60 4
{W: 4, I: 6, S: true} -32..28 4
{W: 4, I: 0, S: false} 0..15/16 1/16
{W: 4, I: 0, S: true} -1/2..7/16 1/16
{W: 4, I: -1, S: false} 0..15/32 1/32
{W: 4, I: -1, S: true} -0.25..7/32 1/32

ac_float<W, I, E, Q>

  • W - width of mantissa (non-negative interger number)
  • I - integer width (non-negative interger number)
  • E - exponent (non-negative interger number)
  • Q - rounding (bool flag)
Type Numerical range Quantum
{W: 54, I: 2, E: 11} IEEE 754 double
{W: 25, I: 2, E: 8} IEEE 754 float
{W: 12, I: 2, E: 5} IEEE 754 half

❓ should width be W+E-1 ❓

ac_complex

C: true flag makes two part complex number.

Type Numerical range Quantum
{W: 8, I: 4, S: false, C: true} 0..15 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant