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

Copyright | (C) 2013-2016 University of Twente 2016 Myrtle Software Ltd 2021-2024 QBayLogic B.V.
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Unsafe
Language | Haskell2010

Extensions

- Cpp
- UndecidableInstances
- MonoLocalBinds
- TemplateHaskell
- TemplateHaskellQuotes
- ScopedTypeVariables
- BangPatterns
- TypeFamilies
- ViewPatterns
- DataKinds
- InstanceSigs
- StandaloneDeriving
- DeriveDataTypeable
- DeriveFunctor
- DeriveTraversable
- DeriveFoldable
- DeriveGeneric
- DefaultSignatures
- DeriveAnyClass
- DeriveLift
- DerivingStrategies
- ConstrainedClassMethods
- MultiParamTypeClasses
- MagicHash
- KindSignatures
- RoleAnnotations
- PostfixOperators
- TupleSections
- TypeOperators
- ExplicitNamespaces
- ExplicitForAll
- MultiWayIf
- BinaryLiterals
- TypeApplications

Clash.Sized.Internal.Unsigned

Contents

- Datatypes
- Accessors
  - Length information
- Type classes
  - BitPack
  - Eq
  - Ord
  - Enum
  - Enum (not synthesizable)
  - Bounded
  - Num
  - ExtendingNum
  - Integral
  - Bits
  - Resize
  - Conversions

Description

Synopsis

- data Unsigned (n :: Nat) = U {
  - unsafeToNatural :: !Natural
  }
- size# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int
- pack# :: forall (n :: Nat). Unsigned n -> BitVector n
- unpack# :: forall (n :: Nat). KnownNat n => BitVector n -> Unsigned n
- eq# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool
- neq# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool
- lt# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool
- ge# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool
- gt# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool
- le# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool
- toEnum# :: forall (n :: Nat). KnownNat n => Int -> Unsigned n
- fromEnum# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int
- enumFrom# :: forall (n :: Nat). KnownNat n => Unsigned n -> [Unsigned n]
- enumFromThen# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> [Unsigned n]
- enumFromTo# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> [Unsigned n]
- enumFromThenTo# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n -> [Unsigned n]
- minBound# :: forall (n :: Nat). Unsigned n
- maxBound# :: forall (n :: Nat). KnownNat n => Unsigned n
- (+#) :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n
- (-#) :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n
- (*#) :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n
- negate# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n
- fromInteger# :: forall (n :: Nat). KnownNat n => Integer -> Unsigned n
- plus# :: forall (m :: Nat) (n :: Nat). Unsigned m -> Unsigned n -> Unsigned (Max m n + 1)
- minus# :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => Unsigned m -> Unsigned n -> Unsigned (Max m n + 1)
- times# :: forall (m :: Nat) (n :: Nat). Unsigned m -> Unsigned n -> Unsigned (m + n)
- quot# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n
- rem# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n
- toInteger# :: forall (n :: Nat). Unsigned n -> Integer
- and# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n
- or# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n
- xor# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n
- complement# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n
- shiftL# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n
- shiftR# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n
- rotateL# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n
- rotateR# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n
- resize# :: forall (n :: Nat) (m :: Nat). KnownNat m => Unsigned n -> Unsigned m
- unsignedToWord :: Unsigned 64 -> Word
- unsigned8toWord8 :: Unsigned 8 -> Word8
- unsigned16toWord16 :: Unsigned 16 -> Word16
- unsigned32toWord32 :: Unsigned 32 -> Word32

# Datatypes

data Unsigned (n :: Nat) Source #

Arbitrary-width unsigned integer represented by `n` bits

Given `n` bits, an `Unsigned` `n` number has a range of: [0 .. 2^`n`-1]

- NB: The usual Haskell method of converting an integral numeric type to another, `fromIntegral`, is not well suited for Clash as it will go through `Integer` which is arbitrarily bounded in HDL. Instead use `bitCoerce` and the `Resize` class.
- NB: The `Num` operators perform `wrap-around` on overflow. If you want saturation on overflow, check out the `SaturatingNum` class.

    >>> maxBound :: Unsigned 3
    7
    >>> minBound :: Unsigned 3
    0
    >>> read (show (maxBound :: Unsigned 3)) :: Unsigned 3
    7
    >>> 1 + 2 :: Unsigned 3
    3
    >>> 2 + 6 :: Unsigned 3
    0
    >>> 1 - 3 :: Unsigned 3
    6
    >>> 2 * 3 :: Unsigned 3
    6
    >>> 2 * 4 :: Unsigned 3
    0
    >>> (2 :: Unsigned 3) `mul` (4 :: Unsigned 3) :: Unsigned 6
    8
    >>> (2 :: Unsigned 3) `add` (6 :: Unsigned 3) :: Unsigned 4
    8
    >>> satAdd SatSymmetric 2 6 :: Unsigned 3
    7
    >>> satSub SatSymmetric 2 3 :: Unsigned 3
    0

Unsigned has the type role

    >>> :i Unsigned
    type role Unsigned nominal
    ...

as it is not safe to coerce between different width Unsigned. To change the width, use the functions in the `Resize` class.

Constructors

U | The constructor, `U`, and the field, `unsafeToNatural`, are not synthesizable.

Fields

- unsafeToNatural :: !Natural

#### Instances

Instances details

Resize Unsigned Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

resize :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Unsigned a -> Unsigned b Source #

extend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Unsigned a -> Unsigned (b + a) Source #

zeroExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Unsigned a -> Unsigned (b + a) Source #

signExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Unsigned a -> Unsigned (b + a) Source #

truncateB :: forall (a :: Nat) (b :: Natural). KnownNat a => Unsigned (a + b) -> Unsigned a Source #

KnownNat n => Lift (Unsigned n :: Type) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods lift :: Quote m => Unsigned n -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Unsigned n -> Code m (Unsigned n) Source #
KnownNat n => Arbitrary (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods arbitrary :: Gen (Unsigned n) Source # shrink :: Unsigned n -> [Unsigned n] Source #
KnownNat n => CoArbitrary (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods coarbitrary :: Unsigned n -> Gen b -> Gen b Source #
KnownNat n => PrintfArg (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods formatArg :: Unsigned n -> FieldFormatter Source # parseFormat :: Unsigned n -> ModifierParser Source #
AutoReg (Unsigned n) Source # |
Instance details Defined in Clash.Class.AutoReg.Internal Methods autoReg :: forall (dom :: Domain). (HasCallStack, KnownDomain dom) => Clock dom -> Reset dom -> Enable dom -> Unsigned n -> Signal dom (Unsigned n) -> Signal dom (Unsigned n) Source #
KnownNat n => BitPack (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Associated Types

type BitSize (Unsigned n) |
Instance details Defined in Clash.Sized.Internal.Unsigned type BitSize (Unsigned n) = n

Methods

pack :: Unsigned n -> BitVector (BitSize (Unsigned n)) Source #

unpack :: BitVector (BitSize (Unsigned n)) -> Unsigned n Source #

KnownNat n => Counter (Unsigned n) Source # |
Instance details Defined in Clash.Class.Counter.Internal Methods countMin :: Unsigned n Source # countMax :: Unsigned n Source # countSuccOverflow :: Unsigned n -> (Bool, Unsigned n) Source # countPredOverflow :: Unsigned n -> (Bool, Unsigned n) Source #
KnownNat m => Exp (Unsigned m) Source # |
Instance details Defined in Clash.Class.Exp Methods (^) :: forall (n :: Nat). Unsigned m -> SNat n -> ExpResult (Unsigned m) n Source #
KnownNat n => SaturatingNum (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

satAdd :: SaturationMode -> Unsigned n -> Unsigned n -> Unsigned n Source #

satSub :: SaturationMode -> Unsigned n -> Unsigned n -> Unsigned n Source #

satMul :: SaturationMode -> Unsigned n -> Unsigned n -> Unsigned n Source #

satSucc :: SaturationMode -> Unsigned n -> Unsigned n Source #

satPred :: SaturationMode -> Unsigned n -> Unsigned n Source #

KnownNat n => Parity (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods even :: Unsigned n -> Bool Source # odd :: Unsigned n -> Bool Source #
Bundle (Unsigned n) Source # |
Instance details Defined in Clash.Signal.Bundle Methods bundle :: forall (dom :: Domain). Unbundled dom (Unsigned n) -> Signal dom (Unsigned n) Source # unbundle :: forall (dom :: Domain). Signal dom (Unsigned n) -> Unbundled dom (Unsigned n) Source #
Bundle (Unsigned n) Source # |
Instance details Defined in Clash.Signal.Delayed.Bundle Methods bundle :: forall (dom :: Domain) (d :: Nat). Unbundled dom d (Unsigned n) -> DSignal dom d (Unsigned n) Source # unbundle :: forall (dom :: Domain) (d :: Nat). DSignal dom d (Unsigned n) -> Unbundled dom d (Unsigned n) Source #
NFDataX (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods deepErrorX :: String -> Unsigned n Source # hasUndefined :: Unsigned n -> Bool Source # ensureSpine :: Unsigned n -> Unsigned n Source # rnfX :: Unsigned n -> () Source #
ShowX (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods showsPrecX :: Int -> Unsigned n -> ShowS Source # showX :: Unsigned n -> String Source # showListX :: [Unsigned n] -> ShowS Source #
Default (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods def :: Unsigned n #
NFData (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods rnf :: Unsigned n -> () Source #
KnownNat n => Bits (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

(.&.) :: Unsigned n -> Unsigned n -> Unsigned n Source #

(.|.) :: Unsigned n -> Unsigned n -> Unsigned n Source #

xor :: Unsigned n -> Unsigned n -> Unsigned n Source #

complement :: Unsigned n -> Unsigned n Source #

shift :: Unsigned n -> Int -> Unsigned n Source #

rotate :: Unsigned n -> Int -> Unsigned n Source #

zeroBits :: Unsigned n Source #

bit :: Int -> Unsigned n Source #

setBit :: Unsigned n -> Int -> Unsigned n Source #

clearBit :: Unsigned n -> Int -> Unsigned n Source #

complementBit :: Unsigned n -> Int -> Unsigned n Source #

testBit :: Unsigned n -> Int -> Bool Source #

bitSizeMaybe :: Unsigned n -> Maybe Int Source #

bitSize :: Unsigned n -> Int Source #

isSigned :: Unsigned n -> Bool Source #

shiftL :: Unsigned n -> Int -> Unsigned n Source #

unsafeShiftL :: Unsigned n -> Int -> Unsigned n Source #

shiftR :: Unsigned n -> Int -> Unsigned n Source #

unsafeShiftR :: Unsigned n -> Int -> Unsigned n Source #

rotateL :: Unsigned n -> Int -> Unsigned n Source #

rotateR :: Unsigned n -> Int -> Unsigned n Source #

popCount :: Unsigned n -> Int Source #

KnownNat n => FiniteBits (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods finiteBitSize :: Unsigned n -> Int Source # countLeadingZeros :: Unsigned n -> Int Source # countTrailingZeros :: Unsigned n -> Int Source #
KnownNat n => Data (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Unsigned n -> c (Unsigned n) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Unsigned n) Source #

toConstr :: Unsigned n -> Constr Source #

dataTypeOf :: Unsigned n -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Unsigned n)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Unsigned n)) Source #

gmapT :: (forall b. Data b => b -> b) -> Unsigned n -> Unsigned n Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unsigned n -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unsigned n -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Unsigned n -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Unsigned n -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Unsigned n -> m (Unsigned n) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Unsigned n -> m (Unsigned n) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Unsigned n -> m (Unsigned n) Source #

KnownNat n => Bounded (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods minBound :: Unsigned n Source # maxBound :: Unsigned n Source #
KnownNat n => Enum (Unsigned n) Source # | The functions: `enumFrom`, `enumFromThen`, `enumFromTo`, and `enumFromThenTo`, are not synthesizable.

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

succ :: Unsigned n -> Unsigned n Source #

pred :: Unsigned n -> Unsigned n Source #

toEnum :: Int -> Unsigned n Source #

fromEnum :: Unsigned n -> Int Source #

enumFrom :: Unsigned n -> [Unsigned n] Source #

enumFromThen :: Unsigned n -> Unsigned n -> [Unsigned n] Source #

enumFromTo :: Unsigned n -> Unsigned n -> [Unsigned n] Source #

enumFromThenTo :: Unsigned n -> Unsigned n -> Unsigned n -> [Unsigned n] Source #

Generic (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Associated Types

type Rep (Unsigned n) |
Instance details Defined in Clash.Sized.Internal.Unsigned type Rep (Unsigned n) = D1 ('MetaData "Unsigned" "Clash.Sized.Internal.Unsigned" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "U" 'PrefixI 'True) (S1 ('MetaSel ('Just "unsafeToNatural") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))

Methods

from :: Unsigned n -> Rep (Unsigned n) x Source #

to :: Rep (Unsigned n) x -> Unsigned n Source #

KnownNat n => Ix (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

range :: (Unsigned n, Unsigned n) -> [Unsigned n] Source #

index :: (Unsigned n, Unsigned n) -> Unsigned n -> Int Source #

unsafeIndex :: (Unsigned n, Unsigned n) -> Unsigned n -> Int Source #

inRange :: (Unsigned n, Unsigned n) -> Unsigned n -> Bool Source #

rangeSize :: (Unsigned n, Unsigned n) -> Int Source #

unsafeRangeSize :: (Unsigned n, Unsigned n) -> Int Source #

KnownNat n => Num (Unsigned n) Source # | NB: `fromInteger`/`fromIntegral` can cause unexpected truncation, as `Integer` is arbitrarily bounded during synthesis. Prefer `bitCoerce` and the `Resize` class.

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

(+) :: Unsigned n -> Unsigned n -> Unsigned n Source #

(-) :: Unsigned n -> Unsigned n -> Unsigned n Source #

(*) :: Unsigned n -> Unsigned n -> Unsigned n Source #

negate :: Unsigned n -> Unsigned n Source #

abs :: Unsigned n -> Unsigned n Source #

signum :: Unsigned n -> Unsigned n Source #

fromInteger :: Integer -> Unsigned n Source #

KnownNat n => Read (Unsigned n) Source # | None of the `Read` class' methods are synthesizable.
Instance details Defined in Clash.Sized.Internal.Unsigned Methods readsPrec :: Int -> ReadS (Unsigned n) Source # readList :: ReadS [Unsigned n] Source # readPrec :: ReadPrec (Unsigned n) Source # readListPrec :: ReadPrec [Unsigned n] Source #
KnownNat n => Integral (Unsigned n) Source # | NB: `toInteger`/`fromIntegral` can cause unexpected truncation, as `Integer` is arbitrarily bounded during synthesis. Prefer `bitCoerce` and the `Resize` class.

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

quot :: Unsigned n -> Unsigned n -> Unsigned n Source #

rem :: Unsigned n -> Unsigned n -> Unsigned n Source #

div :: Unsigned n -> Unsigned n -> Unsigned n Source #

mod :: Unsigned n -> Unsigned n -> Unsigned n Source #

quotRem :: Unsigned n -> Unsigned n -> (Unsigned n, Unsigned n) Source #

divMod :: Unsigned n -> Unsigned n -> (Unsigned n, Unsigned n) Source #

toInteger :: Unsigned n -> Integer Source #

KnownNat n => Real (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods toRational :: Unsigned n -> Rational Source #
Show (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods showsPrec :: Int -> Unsigned n -> ShowS Source # show :: Unsigned n -> String Source # showList :: [Unsigned n] -> ShowS Source #
Eq (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods (==) :: Unsigned n -> Unsigned n -> Bool Source # (/=) :: Unsigned n -> Unsigned n -> Bool Source #
Ord (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Methods

compare :: Unsigned n -> Unsigned n -> Ordering Source #

(<) :: Unsigned n -> Unsigned n -> Bool Source #

(<=) :: Unsigned n -> Unsigned n -> Bool Source #

(>) :: Unsigned n -> Unsigned n -> Bool Source #

(>=) :: Unsigned n -> Unsigned n -> Bool Source #

max :: Unsigned n -> Unsigned n -> Unsigned n Source #

min :: Unsigned n -> Unsigned n -> Unsigned n Source #

KnownNat n => Ixed (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned Methods ix :: Index (Unsigned n) -> Traversal' (Unsigned n) (IxValue (Unsigned n)) Source #
(KnownNat m, KnownNat n) => ExtendingNum (Unsigned m) (Unsigned n) Source # |

Instance details

Defined in Clash.Sized.Internal.Unsigned

Associated Types

type AResult (Unsigned m) (Unsigned n) |
Instance details Defined in Clash.Sized.Internal.Unsigned type AResult (Unsigned m) (Unsigned n) = Unsigned (Max m n + 1)
type MResult (Unsigned m) (Unsigned n) |
Instance details Defined in Clash.Sized.Internal.Unsigned type MResult (Unsigned m) (Unsigned n) = Unsigned (m + n)

Methods

add :: Unsigned m -> Unsigned n -> AResult (Unsigned m) (Unsigned n) Source #

sub :: Unsigned m -> Unsigned n -> AResult (Unsigned m) (Unsigned n) Source #

mul :: Unsigned m -> Unsigned n -> MResult (Unsigned m) (Unsigned n) Source #

type Unbundled dom d (Unsigned n) Source # |
Instance details Defined in Clash.Signal.Delayed.Bundle type Unbundled dom d (Unsigned n) = DSignal dom d (Unsigned n)
type TryDomain t (Unsigned n) Source # |
Instance details Defined in Clash.Class.HasDomain.HasSingleDomain type TryDomain t (Unsigned n) = 'NotFound
type Unbundled dom (Unsigned n) Source # |
Instance details Defined in Clash.Signal.Bundle type Unbundled dom (Unsigned n) = Signal dom (Unsigned n)
type BitSize (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned type BitSize (Unsigned n) = n
type Rep (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned type Rep (Unsigned n) = D1 ('MetaData "Unsigned" "Clash.Sized.Internal.Unsigned" "clash-prelude-1.8.4-1CKHk9HHRNIGPqhYHQsmcW" 'False) (C1 ('MetaCons "U" 'PrefixI 'True) (S1 ('MetaSel ('Just "unsafeToNatural") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))
type Index (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned type Index (Unsigned n) = Int
type IxValue (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned type IxValue (Unsigned n) = Bit
type ExpResult (Unsigned m) n Source # |
Instance details Defined in Clash.Class.Exp type ExpResult (Unsigned m) n = Unsigned (Max 1 (m * n))
type AResult (Unsigned m) (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned type AResult (Unsigned m) (Unsigned n) = Unsigned (Max m n + 1)
type MResult (Unsigned m) (Unsigned n) Source # |
Instance details Defined in Clash.Sized.Internal.Unsigned type MResult (Unsigned m) (Unsigned n) = Unsigned (m + n)

# Accessors

## Length information

size# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int Source #

# Type classes

## BitPack

pack# :: forall (n :: Nat). Unsigned n -> BitVector n Source #

unpack# :: forall (n :: Nat). KnownNat n => BitVector n -> Unsigned n Source #

## Eq

eq# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool Source #

neq# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool Source #

## Ord

lt# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool Source #

ge# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool Source #

gt# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool Source #

le# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Bool Source #

## Enum

toEnum# :: forall (n :: Nat). KnownNat n => Int -> Unsigned n Source #

fromEnum# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int Source #

## Enum (not synthesizable)

enumFrom# :: forall (n :: Nat). KnownNat n => Unsigned n -> [Unsigned n] Source #

enumFromThen# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> [Unsigned n] Source #

enumFromTo# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> [Unsigned n] Source #

enumFromThenTo# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n -> [Unsigned n] Source #

## Bounded

minBound# :: forall (n :: Nat). Unsigned n Source #

maxBound# :: forall (n :: Nat). KnownNat n => Unsigned n Source #

## Num

(+#) :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n Source #

(-#) :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n Source #

(*#) :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n -> Unsigned n Source #

negate# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n Source #

fromInteger# :: forall (n :: Nat). KnownNat n => Integer -> Unsigned n Source #

## ExtendingNum

plus# :: forall (m :: Nat) (n :: Nat). Unsigned m -> Unsigned n -> Unsigned (Max m n + 1) Source #

minus# :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => Unsigned m -> Unsigned n -> Unsigned (Max m n + 1) Source #

times# :: forall (m :: Nat) (n :: Nat). Unsigned m -> Unsigned n -> Unsigned (m + n) Source #

## Integral

quot# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n Source #

rem# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n Source #

toInteger# :: forall (n :: Nat). Unsigned n -> Integer Source #

## Bits

and# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n Source #

or# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n Source #

xor# :: forall (n :: Nat). Unsigned n -> Unsigned n -> Unsigned n Source #

complement# :: forall (n :: Nat). KnownNat n => Unsigned n -> Unsigned n Source #

shiftL# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n Source #

shiftR# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n Source #

rotateL# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n Source #

rotateR# :: forall (n :: Nat). KnownNat n => Unsigned n -> Int -> Unsigned n Source #

## Resize

resize# :: forall (n :: Nat) (m :: Nat). KnownNat m => Unsigned n -> Unsigned m Source #

## Conversions

unsignedToWord :: Unsigned 64 -> Word Source #

unsigned8toWord8 :: Unsigned 8 -> Word8 Source #

unsigned16toWord16 :: Unsigned 16 -> Word16 Source #

unsigned32toWord32 :: Unsigned 32 -> Word32 Source #