blarney-0.1.0.0
Copyright(c) Matthew Naylor 2024
LicenseMIT
Maintainermattfn@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageGHC2021

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.

dontCare :: Int -> Ternary Source #

Construct don't care bit-vector of given width

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

concat :: Ternary -> Ternary -> Ternary Source #

Concatenate ternary bit-vectors

take :: Int -> Ternary -> Ternary Source #

Obtain lower bits of bit vector

drop :: Int -> Ternary -> Ternary Source #

Drop lower bits of bit vector

select :: Int -> Int -> Ternary -> Ternary Source #

Bit-range selection of ternary bit-vector