| Copyright | (c) Matthew Naylor 2024 |
|---|---|
| License | MIT |
| Maintainer | mattfn@gmail.com |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
Blarney.Core.Ternary
Description
Synopsis
Documentation
type Ternary = [(Int, Maybe Integer)] Source #
Ternary bit vectors represented as a list of width/value pairs.
Nothing values represent don't care values. Least significant
bits come first.
integerToTernary :: Int -> Integer -> Ternary Source #
Convert non-negative integer to ternary bit-vector of given width
ternaryToInteger :: Ternary -> Integer Source #
Convert ternary bit-vector to an integer, with don't cares converted to 0s