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

40 lines
622 B
Racket

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