Math operations from IEEE.1364-2005 *
Math operations from IEEE.1364-2005 *
A type class used to determine equality between 2 instances of the same type.
A type class used to determine equality between 2 instances of the same
type. Any 2 instances x
and y
are equal if eqv(x, y)
is true
.
Moreover, eqv
should form an equivalence relation.
Much of this is drawn from non/spire, but using Chisel Bools instead of Java Bools.
Much of this is drawn from non/spire, but using Chisel Bools instead of Java Bools. I suppose a more general solution would be generic in return type, but the use cases there seem obscure.
Defines basic math functions for FixedPoint numbers
Much of this is drawn from non/spire, but using Chisel Bools instead of Java Bools.
Much of this is drawn from non/spire, but using Chisel Bools instead of Java Bools. I suppose a more general solution would be generic in return type, but the use cases there seem obscure.
A simple type class for numeric types that are a subset of the reals.
The Order
type class is used to define a total ordering on some type A
.
The Order
type class is used to define a total ordering on some type A
.
An order is defined by a relation <=, which obeys the following laws:
- either x <= y or y <= x (totality) - if x <= y and y <= x, then x == y (antisymmetry) - if x <= y and y <= z, then x <= z (transitivity)
The truth table for compare is defined as follows:
x <= y x >= y Int true true = 0 (corresponds to x == y) true false < 0 (corresponds to x < y) false true > 0 (corresponds to x > y)
By the totality law, x <= y and y <= x cannot be both false.
The PartialOrder
type class is used to define a partial ordering on some type A
.
The PartialOrder
type class is used to define a partial ordering on some type A
.
A partial order is defined by a relation <=, which obeys the following laws:
- x <= x (reflexivity) - if x <= y and y <= x, then x === y (anti-symmetry) - if x <= y and y <= z, then x <= z (transitivity)
To compute both <= and >= at the same time, we use a Double number to encode the result of the comparisons x <= y and x >= y. The truth table is defined as follows:
x <= y x >= y Double true true = 0.0 (corresponds to x === y) false false = NaN (x and y cannot be compared) true false = -1.0 (corresponds to x < y) false true = 1.0 (corresponds to x > y)
Defines basic math functions for SInt
A simple ADT representing the Sign
of an object.
A trait for things that have some notion of sign and the ability to ensure something has a positive sign.
Defines basic math functions for UInt