diff --git a/beautiful-racket/br/demo/hdl/Mux.hdl.rkt b/beautiful-racket/br/demo/hdl/Mux.hdl.rkt index 755d75f..f94e6d9 100644 --- a/beautiful-racket/br/demo/hdl/Mux.hdl.rkt +++ b/beautiful-racket/br/demo/hdl/Mux.hdl.rkt @@ -16,10 +16,8 @@ CHIP Mux { OUT out; PARTS: - Not(in=sel, out=sel-opposite); - Not(in=a, out=not-a); - Or(a=not-a, b=sel-opposite, out=maybe-a); - Not(in=b, out=not-b); - Or(a=not-b, b=sel, out=maybe-b); - Or(a=maybe-a, b=b, out=out); + Not(in=sel, out=not-sel); + And(a=a, b=not-sel, out=a-and-not-sel); + And(a=b, b=sel, out=b-and-sel); + Or(a=a-and-not-sel, b=b-and-sel, out=out); } diff --git a/beautiful-racket/br/demo/hdl/expander.rkt b/beautiful-racket/br/demo/hdl/expander.rkt index a61d82d..81ab9b1 100644 --- a/beautiful-racket/br/demo/hdl/expander.rkt +++ b/beautiful-racket/br/demo/hdl/expander.rkt @@ -1,6 +1,6 @@ #lang br (require "helper.rkt" (for-syntax racket/base racket/syntax "helper.rkt" racket/list racket/require-transform)) -(provide #%top-interaction (rename-out [mb #%module-begin]) #%app #%datum (all-defined-out)) +(provide #%top-interaction (rename-out [mb #%module-begin]) #%app #%datum and or (all-defined-out)) (define #'(mb _arg ...) #'(#%module-begin