| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
ReWire.BitWord
Synopsis
- type Vec (n :: Nat) a = Vector n a
- type Bit = Bool
- zero :: Bit
- one :: Bit
- toInt :: Bit -> Int
- notBit :: Bit -> Bit
- (>&&<) :: Bit -> Bit -> Bit
- (>||<) :: Bit -> Bit -> Bit
- (>^<) :: Bit -> Bit -> Bit
- (>==<) :: Bit -> Bit -> Bit
- (>~&<) :: Bit -> Bit -> Bit
- (>~|<) :: Bit -> Bit -> Bit
- (>~^<) :: Bit -> Bit -> Bit
- rca :: Bit -> Bit -> Bit -> (Bit, Bit)
- int2bin :: Int -> [Bit]
- carryadd' :: [Bool] -> [Bool] -> Bool -> ([Bool], Bool)
- msBit' :: [Bool] -> Bool
- lsBit' :: [Bool] -> Bool
- bitwiseXor' :: [Bool] -> [Bool] -> [Bool]
- bitwiseAnd' :: [Bool] -> [Bool] -> [Bool]
- bitwiseOr' :: [Bool] -> [Bool] -> [Bool]
- bitwiseNot' :: [Bool] -> [Bool]
- bitwiseXNor' :: [Bool] -> [Bool] -> [Bool]
- rAnd' :: [Bool] -> Bool
- rOr' :: [Bool] -> Bool
- rNand' :: [Bool] -> Bool
- rNor' :: [Bool] -> Bool
- rXor' :: [Bool] -> Bool
- rXnor' :: [Bool] -> Bool
- int2bits' :: Integer -> [Bool]
- lit' :: Integer -> [Bool]
- pad' :: Int -> [Bool] -> [Bool]
- padTrunc' :: Int -> [Bool] -> [Bool]
- toIntLE' :: [Bool] -> Int
- toInt' :: [Bool] -> Int
- fromBool :: Bool -> Integer
- toInteger' :: forall (n :: Nat). Vec n Bool -> Integer
- bitsToInteger' :: [Bool] -> Integer
- intToBits' :: Int -> Integer -> [Bool]
- resize' :: Int -> [Bool] -> [Bool]
- false' :: [Bool] -> Bool
- toBit' :: [Bool] -> Bool
- zero' :: [Bool]
- one' :: [Bool]
- negate' :: [Bool] -> [Bool]
- plus' :: [Bool] -> [Bool] -> [Bool]
- minus' :: [Bool] -> [Bool] -> [Bool]
- nudgeL' :: ([Bool], Bool) -> (Bool, [Bool])
- nudgeR' :: (Bool, [Bool]) -> ([Bool], Bool)
- rNudge' :: ([Bool], [Bool]) -> ([Bool], [Bool], Bool)
- boothround :: ([Bool], [Bool], Bool, [Bool]) -> ([Bool], [Bool], Bool, [Bool])
- booth' :: ([Bool], [Bool]) -> ([Bool], [Bool])
- times' :: [Bool] -> [Bool] -> [Bool]
- shiftL1' :: [Bool] -> [Bool]
- shiftR1' :: [Bool] -> [Bool]
- arithShiftR1' :: [Bool] -> [Bool]
- decr' :: [Bool] -> [Bool]
- iter' :: [Bool] -> ([Bool] -> [Bool]) -> [Bool] -> [Bool]
- shiftAmount' :: [Bool] -> [Bool] -> Int
- shiftL' :: [Bool] -> [Bool] -> [Bool]
- shiftR' :: [Bool] -> [Bool] -> [Bool]
- arithShiftR' :: [Bool] -> [Bool] -> [Bool]
- padMax' :: [Bool] -> [Bool] -> ([Bool], [Bool])
- power' :: [Bool] -> [Bool] -> [Bool]
- nonrestoringDivide' :: [Bool] -> [Bool] -> [Bool] -> ([Bool], [Bool])
- divCounter' :: [Bool] -> [Bool] -> Int
- divide' :: [Bool] -> [Bool] -> [Bool]
- mod' :: [Bool] -> [Bool] -> [Bool]
- fours :: a -> [a] -> [(a, a, a, a)]
- toHex :: (Bool, Bool, Bool, Bool) -> Char
- toBin :: Bool -> Char
- hexify :: [Bool] -> String
- binify :: [Bool] -> String
Documentation
bitwiseNot' :: [Bool] -> [Bool] Source #
bitsToInteger' :: [Bool] -> Integer Source #
The unsigned value of a big-endian bit list, as an Integer (exact at
any width, unlike toInt').
intToBits' :: Int -> Integer -> [Bool] Source #
Materialize an Integer as exactly d bits, big-endian, reducing mod 2^d (so a negative value takes its d-bit two's-complement form).
arithShiftR1' :: [Bool] -> [Bool] Source #
shiftAmount' :: [Bool] -> [Bool] -> Int Source #
The shift amount as an Int, saturated to the word length (the guard compares in Integer, so amounts too wide for Int cannot wrap).
padMax' :: [Bool] -> [Bool] -> ([Bool], [Bool]) Source #
For (Unsigned!) comparison: we assume that the input words are the same length so we can use (lexicographic) ordering as defined on lists so we need a function pad the shorter word
power' :: [Bool] -> [Bool] -> [Bool] Source #
Modular exponentiation by squaring over the exponent's bits, so wide dynamic exponents evaluate in O(width) multiplies instead of O(value) (the result cycles mod 2^(length w) regardless).