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

Safe HaskellNone
LanguageHaskell2010

CLaSH.Sized.BitVector

Contents

Synopsis

Datatypes

data BitVector n Source

A vector of bits.

  • Bit indices are descending
  • Num instance performs unsigned arithmetic.

Instances

Accessors

Length information

Construction

Initialisation

high :: Bit Source

logic '1'

low :: Bit Source

logic '0'

bLit :: KnownNat n => String -> Q (TExp (BitVector n)) Source

Create a binary literal

>>> $$(bLit "1001") :: BitVector 4
1001
>>> $$(bLit "1001") :: BitVector 3
001

NB: Will be removed once GHC 7.10 is released which has support for binary literals. Once GHC 7.10 is released you can just write:

>>> 0b1001 :: BitVector 4
1001

Concatenation

(++#) :: KnownNat m => BitVector n -> BitVector m -> BitVector (n + m) Source

Concatenate two BitVectors