SICP Exercise 3.29

SICP Exercise 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:

SICP Exercise 3.29_第1张图片

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))
From the diagram, we can get that :

the delay time of or-gate = the delay time of and-gate + the delay time of inverter * 2


你可能感兴趣的:(c,delay)