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

Safe HaskellNone




data Unsigned n Source

Arbitrary-width unsigned integer represented by n bits


KnownNat n => Bounded (Unsigned n) 
KnownNat n => Enum (Unsigned n) 
Eq (Unsigned n) 
KnownNat n => Integral (Unsigned n) 
KnownNat n => Num (Unsigned n) 
Ord (Unsigned n) 
KnownNat n => Real (Unsigned n) 
Show (Unsigned n) 
KnownNat n => Bits (Unsigned n) 
KnownNat n => FiniteBits (Unsigned n) 
KnownNat n => Default (Unsigned n) 
KnownNat n => Lift (Unsigned n) 
BitVector (Unsigned n) 
Pack (Unsigned n) 
KnownNat ((+) m n) => Mult (Unsigned m) (Unsigned n) 
KnownNat (Max m n) => Add (Unsigned m) (Unsigned n) 
type BitSize (Unsigned n) = n 
type SignalP (Unsigned n) = Signal (Unsigned n) 
type MResult (Unsigned m) (Unsigned n) = Unsigned ((+) m n) 
type AResult (Unsigned m) (Unsigned n) = Unsigned (Max m n) 

resizeU :: KnownNat m => Unsigned n -> Unsigned m Source

A resize operation that is zero-extends on extension, and wraps on truncation.

Increasing the size of the number extends with zeros to the left. Truncating a number of length N to a length L just removes the left (most significant) N-L bits.