计算机程序的构造和解释习题3.29
we know that A or B
is equivalent to not ((not A) and (not B)) from Using De-Morgan’s rules. the diagram is:
so, the code is:
- ;;;Exercise 3.29
- (define (or-gate in1 in2 out)
- (let ((a (make-wire))
- (b (make-wire))
- (c (make-wire)))
- (inverter in1 a)
- (inverter in2 b)
- (add-gate a b c)
- (inverter c out)
- 'ok))
the delay time of or-gate = the delay time of and-gate + the delay time of inverter * 2。