Copyright | (c) ForSyDe Group KTH 2007-2008 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | forsyde-dev@ict.kth.se |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
It defines the bit vector operations from/to integer.
Synopsis
- 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 -> Integer Source #
To transform the input bit-vecotr to an integer.
Add even/odd parity bit
addEvenParityBit :: (Num a, Eq a) => Vector a -> Vector a Source #
To add even parity bit on the bit-vector in the tail.
addOddParityBit :: (Num a, Eq a) => Vector a -> Vector a Source #
To add odd parity bit on the bit-vector in the tail.
Remove parity bit
removeParityBit :: (Num t, Eq t) => Vector t -> Vector t Source #
To remove the parity bit in the tail.
Check the even/odd parity of the bit-vector
isEvenParity :: (Num t, Eq t) => Vector t -> Bool Source #
To check the even parity of the bit-vector.