ForSyDe-3.0: ForSyDe's Haskell-embedded Domain Specific Language.Source codeContentsIndex
ForSyDe.Shallow.BitVector
Portabilityportable
Stabilityexperimental
Maintainerforsyde-dev@ict.kth.se
Contents
Polynomial data type
Bit-vector and integer transformations
Add even/odd parity bit
Remove parity bit
Check the even/odd parity of the bit-vector
Judge the form sanity of the bit-vector
Description
It defines the bit vector operations from/to integer.
Synopsis
type BitVector = Vector Integer
data Parity
= Even
| Odd
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
type BitVector = Vector IntegerSource
data Parity Source
Constructors
Even
Odd
show/hide Instances
Bit-vector and integer transformations
intToBitVectorSource
:: IntNum of the bits
-> IntegerThe input integer
-> BitVectorThe output bit-vector
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.
addParityBit :: Num a => Parity -> Vector a -> Vector aSource
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
isBitVectorSource
:: Num t
=> Vector tInput bit-vector
-> BoolOutput boolean value
To judge whether the input bit-vector is in a proper form.
Produced by Haddock version 2.1.0