(defines (width-odd (quotient (+ (param "inputWidth") 1) 2)) (width-even (quotient (param "inputWidth") 2)) (plural (> (param "inputWidth") 1)) (odd (/= width-odd width-even)) ) (nodes ("elseAck" 1 0 1) ("inpComplete" width-odd 0 1) ("inpDone" 1 0 1) ("outDone" 1 0 1) ) (gates (if plural (or (slice 0 width-even (node "inpComplete")) (slice 0 width-even (req0 "inp")) (slice 0 width-even (req1 "inp")) (slice 0 width-even (req2 "inp")) (slice 0 width-even (req3 "inp")) ) ) (if odd (or (slice width-even 1 (node "inpComplete")) (slice width-even 1 (req0 "inp")) (slice width-even 1 (req1 "inp")) ) ) (c-element (node "inpDone") (smash (node "inpComplete"))) (if (complete-encoding? (param "specification") (param "inputWidth")) (gates (if plural (decode (c-or m-of-n-mapping one-of-four-implicant-mapping) (param "specification") (param "inputWidth") ((req0 "inp") (req1 "inp") (req2 "inp") (req3 "inp")) ((req (each "activateOut"))) ) (decode (c-or m-of-n-mapping one-of-four-implicant-mapping) (param "specification") (param "inputWidth") ((req0 "inp") (req1 "inp")) ((req (each "activateOut"))) ) ) (or (node "outDone") (ack (each "activateOut"))) ) (gates (if plural (decode (c-or m-of-n-mapping one-of-four-implicant-mapping) (param "specification") (param "inputWidth") ((req0 "inp") (req1 "inp") (req2 "inp") (req3 "inp")) ((combine (req (each "activateOut")) (node "elseAck"))) ) (decode (c-or m-of-n-mapping one-of-four-implicant-mapping) (param "specification") (param "inputWidth") ((req0 "inp") (req1 "inp")) ((combine (req (each "activateOut")) (node "elseAck"))) ) ) (or (node "outDone") (ack (each "activateOut")) (node "elseAck")) ) ) (c-element (ack "inp") (node "outDone") (node "inpDone")) )