clash-prelude-1.6.4: Clash: a functional hardware description language - Prelude library

Clash.Num.Zeroing

Synopsis

# Documentation

data Zeroing a Source #

A zeroing number type is one where all operations return zero if they go out of bounds for the underlying type.

Numbers can be converted to zero by default using toZeroing.

#### Instances

Instances details
 Bounded a => Bounded (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methods (Enum a, SaturatingNum a) => Enum (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methodssucc :: Zeroing a -> Zeroing a #pred :: Zeroing a -> Zeroing a #toEnum :: Int -> Zeroing a #fromEnum :: Zeroing a -> Int #enumFrom :: Zeroing a -> [Zeroing a] #enumFromThen :: Zeroing a -> Zeroing a -> [Zeroing a] #enumFromTo :: Zeroing a -> Zeroing a -> [Zeroing a] #enumFromThenTo :: Zeroing a -> Zeroing a -> Zeroing a -> [Zeroing a] # Eq a => Eq (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methods(==) :: Zeroing a -> Zeroing a -> Bool #(/=) :: Zeroing a -> Zeroing a -> Bool # (Fractional a, Ord a, SaturatingNum a) => Fractional (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methods(/) :: Zeroing a -> Zeroing a -> Zeroing a #recip :: Zeroing a -> Zeroing a # (Integral a, SaturatingNum a) => Integral (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methodsquot :: Zeroing a -> Zeroing a -> Zeroing a #rem :: Zeroing a -> Zeroing a -> Zeroing a #div :: Zeroing a -> Zeroing a -> Zeroing a #mod :: Zeroing a -> Zeroing a -> Zeroing a #quotRem :: Zeroing a -> Zeroing a -> (Zeroing a, Zeroing a) #divMod :: Zeroing a -> Zeroing a -> (Zeroing a, Zeroing a) #toInteger :: Zeroing a -> Integer # (Bounded a, Ord a, SaturatingNum a) => Num (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methods(+) :: Zeroing a -> Zeroing a -> Zeroing a #(-) :: Zeroing a -> Zeroing a -> Zeroing a #(*) :: Zeroing a -> Zeroing a -> Zeroing a #negate :: Zeroing a -> Zeroing a #abs :: Zeroing a -> Zeroing a #signum :: Zeroing a -> Zeroing a # Ord a => Ord (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methodscompare :: Zeroing a -> Zeroing a -> Ordering #(<) :: Zeroing a -> Zeroing a -> Bool #(<=) :: Zeroing a -> Zeroing a -> Bool #(>) :: Zeroing a -> Zeroing a -> Bool #(>=) :: Zeroing a -> Zeroing a -> Bool #max :: Zeroing a -> Zeroing a -> Zeroing a #min :: Zeroing a -> Zeroing a -> Zeroing a # (Real a, SaturatingNum a) => Real (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methods (RealFrac a, SaturatingNum a) => RealFrac (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing MethodsproperFraction :: Integral b => Zeroing a -> (b, Zeroing a) #truncate :: Integral b => Zeroing a -> b #round :: Integral b => Zeroing a -> b #ceiling :: Integral b => Zeroing a -> b #floor :: Integral b => Zeroing a -> b # Show a => Show (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing MethodsshowsPrec :: Int -> Zeroing a -> ShowS #show :: Zeroing a -> String #showList :: [Zeroing a] -> ShowS # Bits a => Bits (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methods(.&.) :: Zeroing a -> Zeroing a -> Zeroing a #(.|.) :: Zeroing a -> Zeroing a -> Zeroing a #xor :: Zeroing a -> Zeroing a -> Zeroing a #complement :: Zeroing a -> Zeroing a #shift :: Zeroing a -> Int -> Zeroing a #rotate :: Zeroing a -> Int -> Zeroing a #bit :: Int -> Zeroing a #setBit :: Zeroing a -> Int -> Zeroing a #clearBit :: Zeroing a -> Int -> Zeroing a #complementBit :: Zeroing a -> Int -> Zeroing a #testBit :: Zeroing a -> Int -> Bool #bitSize :: Zeroing a -> Int #isSigned :: Zeroing a -> Bool #shiftL :: Zeroing a -> Int -> Zeroing a #unsafeShiftL :: Zeroing a -> Int -> Zeroing a #shiftR :: Zeroing a -> Int -> Zeroing a #unsafeShiftR :: Zeroing a -> Int -> Zeroing a #rotateL :: Zeroing a -> Int -> Zeroing a #rotateR :: Zeroing a -> Int -> Zeroing a #popCount :: Zeroing a -> Int # FiniteBits a => FiniteBits (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing MethodsfiniteBitSize :: Zeroing a -> Int # Binary a => Binary (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methodsput :: Zeroing a -> Put #get :: Get (Zeroing a) #putList :: [Zeroing a] -> Put # NFData a => NFData (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methodsrnf :: Zeroing a -> () # Hashable a => Hashable (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing MethodshashWithSalt :: Int -> Zeroing a -> Int #hash :: Zeroing a -> Int # NFDataX a => NFDataX (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing MethodsrnfX :: Zeroing a -> () Source # ShowX a => ShowX (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing MethodsshowsPrecX :: Int -> Zeroing a -> ShowS Source #showListX :: [Zeroing a] -> ShowS Source # BitPack a => BitPack (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Associated Typestype BitSize (Zeroing a) :: Nat Source # Methodspack :: Zeroing a -> BitVector (BitSize (Zeroing a)) Source #unpack :: BitVector (BitSize (Zeroing a)) -> Zeroing a Source # Parity a => Parity (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing Methodseven :: Zeroing a -> Bool Source #odd :: Zeroing a -> Bool Source # Resize f => Resize (Compose Zeroing f) Source # Instance detailsDefined in Clash.Num.Zeroing Methodsresize :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Zeroing f a -> Compose Zeroing f b Source #extend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Zeroing f a -> Compose Zeroing f (b + a) Source #zeroExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Zeroing f a -> Compose Zeroing f (b + a) Source #signExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Zeroing f a -> Compose Zeroing f (b + a) Source #truncateB :: forall (a :: Nat) (b :: Nat). KnownNat a => Compose Zeroing f (a + b) -> Compose Zeroing f a Source # type BitSize (Zeroing a) Source # Instance detailsDefined in Clash.Num.Zeroing type BitSize (Zeroing a) = BitSize a