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/DMux4Way-test.rkt

29 lines
698 B
Racket

#lang racket
(require "DMux4Way.hdl.rkt")
(require rackunit)
(DMux4Way-in (random 2))
(DMux4Way-sel #b00)
(check-equal? (DMux4Way-a) (DMux4Way-in))
(check-equal? (DMux4Way-b) 0)
(check-equal? (DMux4Way-c) 0)
(check-equal? (DMux4Way-d) 0)
(DMux4Way-sel #b01)
(check-equal? (DMux4Way-a) 0)
(check-equal? (DMux4Way-b) (DMux4Way-in))
(check-equal? (DMux4Way-c) 0)
(check-equal? (DMux4Way-d) 0)
(DMux4Way-sel #b10)
(check-equal? (DMux4Way-a) 0)
(check-equal? (DMux4Way-b) 0)
(check-equal? (DMux4Way-c) (DMux4Way-in))
(check-equal? (DMux4Way-d) 0)
(DMux4Way-sel #b11)
(check-equal? (DMux4Way-a) 0)
(check-equal? (DMux4Way-b) 0)
(check-equal? (DMux4Way-c) 0)
(check-equal? (DMux4Way-d) (DMux4Way-in))