You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket/br/demo/hdl/And.hdl

14 lines
332 B
Plaintext

#lang s-exp br/demo/hdl/expander
(chip And
(a b)
(out)
((Nand [a a] [b b] [out nand-out])
(Not [in nand-out] [out out])))
(module+ test
(require rackunit)
(check-equal? (And #:a 0 #:b 0) 0)
(check-equal? (And #:a 0 #:b 1) 0)
(check-equal? (And #:a 1 #:b 0) 0)
(check-equal? (And #:a 1 #:b 1) 1))