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-demo/hdl-demo/Nand2.hdl.rkt

21 lines
429 B
Racket

#lang br
(provide (prefix-out Nand2- (all-defined-out)))
(require "helper.rkt")
(define a (make-input))
(define b (make-input))
(define (out)
(if (< (+ (a) (b)) 2)
1
0))
(module+ test
(require rackunit)
(check-equal? (begin (a 0) (b 0) (out)) 1)
(check-equal? (begin (a 0) (b 1) (out)) 1)
(check-equal? (begin (a 1) (b 0) (out)) 1)
(check-equal? (begin (a 1) (b 1) (out)) 0))
#;(define n (make-Nand))