Skip to content

Instantly share code, notes, and snippets.

@oskarth
Created November 1, 2012 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oskarth/3995321 to your computer and use it in GitHub Desktop.
Save oskarth/3995321 to your computer and use it in GitHub Desktop.
chipper.gates
;; nand* is not defined in terms of other gates
;; read the source to find out how we deal with that
(defgate not* [in] => [out]
(nand* [in in] => [out]))
(defgate and* [a b] => [out]
(nand* [a b] => [w])
(not* [w] => [out]))
(defgate dmux* [in sel] => [a b]
(not* [sel] => [nsel])
(and* [in nsel] => [a])
(and* [in sel] => [b]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment