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

40 lines
622 B
Racket

#lang racket
(require "Mux.hdl.rkt")
(require rackunit)
(Mux-sel-write 0)
(Mux-a-write 0)
(Mux-b-write 0)
(check-equal? (Mux-out) (Mux-a))
(Mux-a-write 0)
(Mux-b-write 1)
(check-equal? (Mux-out) (Mux-a))
(Mux-a-write 1)
(Mux-b-write 0)
(check-equal? (Mux-out) (Mux-a))
(Mux-a-write 1)
(Mux-b-write 1)
(check-equal? (Mux-out) (Mux-a))
(Mux-sel-write 1)
(Mux-a-write 0)
(Mux-b-write 0)
(check-equal? (Mux-out) (Mux-b))
(Mux-a-write 0)
(Mux-b-write 1)
(check-equal? (Mux-out) (Mux-b))
(Mux-a-write 1)
(Mux-b-write 0)
(check-equal? (Mux-out) (Mux-b))
(Mux-a-write 1)
(Mux-b-write 1)
(check-equal? (Mux-out) (Mux-b))