Portability | portable |
---|---|
Stability | experimental |
Maintainer | forsyde-dev@ict.kth.se |
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 => Vector a -> Vector a
- addOddParityBit :: Num a => Vector a -> Vector a
- addParityBit :: Num a => Parity -> Vector a -> Vector a
- removeParityBit :: Num t => Vector t -> Vector t
- isEvenParity :: Num t => Vector t -> Bool
- isOddParity :: Num t => Vector t -> Bool
- isBitVector :: Num 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 => Vector a -> Vector aSource
To add even parity bit on the bit-vector in the tail.
addOddParityBit :: Num a => Vector a -> Vector aSource
To add odd parity bit on the bit-vector in the tail.
Remove parity bit
removeParityBit :: Num t => Vector t -> Vector tSource
To remove the parity bit in the tail.
Check the even/odd parity of the bit-vector
isEvenParity :: Num t => Vector t -> BoolSource
To check the even parity of the bit-vector.
isOddParity :: Num t => Vector t -> BoolSource
To check the odd parity of the bit-vector.
Judge the form sanity of the bit-vector
To judge whether the input bit-vector is in a proper form.