resume in dmux4way
parent
fdc8f6831f
commit
b1afb39b78
@ -0,0 +1,28 @@
|
||||
#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))
|
@ -0,0 +1,23 @@
|
||||
#lang racket
|
||||
(require "DMux.hdl.rkt")
|
||||
(require rackunit)
|
||||
|
||||
(DMux-in 0)
|
||||
(DMux-sel 0)
|
||||
(check-equal? (DMux-a) 0)
|
||||
(check-equal? (DMux-b) 0)
|
||||
|
||||
(DMux-in 0)
|
||||
(DMux-sel 1)
|
||||
(check-equal? (DMux-a) 0)
|
||||
(check-equal? (DMux-b) 0)
|
||||
|
||||
(DMux-in 1)
|
||||
(DMux-sel 0)
|
||||
(check-equal? (DMux-a) 1)
|
||||
(check-equal? (DMux-b) 0)
|
||||
|
||||
(DMux-in 1)
|
||||
(DMux-sel 1)
|
||||
(check-equal? (DMux-a) 0)
|
||||
(check-equal? (DMux-b) 1)
|
Loading…
Reference in New Issue