Portability | portable |
---|---|
Stability | experimental |
Maintainer | forsyde-dev@ict.kth.se |
Safe Haskell | Safe-Infered |
ForSyDe.Shallow.BitVector
Contents
Description
It defines the bit vector operations from/to integer.
- type BitVector = Vector Integer
- data Parity
- intToBitVector :: Int -> Integer -> BitVector
- bitVectorToInt :: BitVector -> Integer
- addEvenParityBit :: (Num a, Eq a) => Vector a -> Vector a
- addOddParityBit :: (Num a, Eq a) => Vector a -> Vector a
- addParityBit :: (Num a, Eq a) => Parity -> Vector a -> Vector a
- removeParityBit :: (Num t, Eq t) => Vector t -> Vector t
- isEvenParity :: (Num t, Eq t) => Vector t -> Bool
- isOddParity :: (Num t, Eq t) => Vector t -> Bool
- isBitVector :: (Num t, Eq t) => Vector t -> Bool
Polynomial data type
Bit-vector and integer transformations
To transform the input integer to a bit-vector with specified number of bits.
bitVectorToInt :: BitVector -> IntegerSource
To transform the input bit-vecotr to an integer.
Add even/odd parity bit
addEvenParityBit :: (Num a, Eq a) => Vector a -> Vector aSource
To add even parity bit on the bit-vector in the tail.
addOddParityBit :: (Num a, Eq a) => Vector a -> Vector aSource
To add odd parity bit on the bit-vector in the tail.