ForSyDe-3.1.1: ForSyDe's Haskell-embedded Domain Specific Language.

Portabilityportable
Stabilityexperimental
Maintainerforsyde-dev@ict.kth.se

ForSyDe.Shallow.BitVector

Contents

Description

It defines the bit vector operations from/to integer.

Synopsis

Polynomial data type

data Parity Source

Constructors

Even 
Odd 

Instances

Bit-vector and integer transformations

intToBitVectorSource

Arguments

:: Int

Num of the bits

-> Integer

The input integer

-> BitVector

The 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.

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

Arguments

:: Num t 
=> Vector t

Input bit-vector

-> Bool

Output boolean value

To judge whether the input bit-vector is in a proper form.