clash-prelude- CAES Language for Synchronous Hardware - Prelude library

Safe HaskellNone




data Signed n Source

Arbitrary-width signed integer represented by n bits, including the sign bit.

Uses standard 2-complements representation. Meaning that, given n bits, a Signed n number has a range of: [-(2^(n-1)) .. 2^(n-1)-1]

NB: The Num operators perform wrap-around on overflow. If you want saturation on overflow, check out the SaturatingNum class.


Resize Signed 
KnownNat n => Bounded (Signed n) 
KnownNat n => Enum (Signed n)

The functions: enumFrom, enumFromThen, enumFromTo, and enumFromThenTo, are not synthesisable.

Eq (Signed n) 
KnownNat n => Integral (Signed n) 
KnownNat n => Num (Signed n)

Operators do wrap-around on overflow

Ord (Signed n) 
KnownNat n => Real (Signed n) 
Show (Signed n) 
KnownNat n => Bits (Signed n) 
KnownNat n => FiniteBits (Signed n) 
KnownNat n => Default (Signed n) 
KnownNat n => Lift (Signed n) 
(KnownNat n, KnownNat ((+) 1 n), KnownNat ((+) n n)) => SaturatingNum (Signed n) 
KnownNat n => BitPack (Signed n) 
Bundle (Signed n) 
(KnownNat ((+) 1 (Max m n)), KnownNat ((+) m n)) => ExtendingNum (Signed m) (Signed n) 
Typeable (Nat -> *) Signed 
type Unbundled clk (Signed n) = CSignal clk (Signed n) 
type BitSize (Signed n) = n 
type AResult (Signed m) (Signed n) = Signed ((+) 1 (Max m n)) 
type MResult (Signed m) (Signed n) = Signed ((+) m n)