This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LSB(main) where | |
import Data.Word | |
import Data.Array.Unboxed | |
import Data.Bits | |
import Data.SBV | |
-- Kmett's implementation of finding the least significant bit set in a 64 bit word | |
-- Adapted from the original implementation at: | |
-- http://github.com/ekmett/algebra/blob/master/Numeric/Coalgebra/Geometric.hs#L72 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.SBV | |
import Control.Exception as E | |
-- Node indexes, support upto 2^16 entries (no of inputs + no of AND gates) | |
type Node = SWord16 | |
-- Values that flow through the AND gates |
NewerOlder