| Copyright | (C) 2013-2016, University of Twente |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
| Extensions | MagicHash |
CLaSH.Sized.BitVector
Description
Datatypes
A vector of bits.
- Bit indices are descending
Numinstance performs unsigned arithmetic.
Instances
Accessors
Length information
Construction
Initialisation
bLit :: KnownNat n => String -> Q (TExp (BitVector n)) Source
Create a binary literal
>>>$$(bLit "1001") :: BitVector 41001>>>$$(bLit "1001") :: BitVector 3001
NB: You can also just write:
>>>0b1001 :: BitVector 41001
The advantage of bLit is that you can use computations to create the
string literal:
>>>import qualified Data.List as List>>>$$(bLit (List.replicate 4 '1')) :: BitVector 41111