From 124c83d34e40011ea2882345237a42872870b396 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 19 May 2016 13:58:13 -0700 Subject: [PATCH] resume in dmux --- beautiful-racket/br/demo/hdl/Mux.hdl.rkt | 10 ++++------ beautiful-racket/br/demo/hdl/expander.rkt | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) 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