sicp-ex-3.29



<< Previous exercise (3.28) | Index | Next exercise (3.30) >>


meteorgan

  
  
 ;; a 
 ;; (A or B) is equivalent to (not ((not A) and (not B))) 
 (define (or-gate a1 a2 output) 
   (let ((c1 (make-wire)) 
         (c2 (make-wire)) 
         (c3 (make-wire))) 
     (inverter a1 c1) 
     (inverter a2 c2) 
     (and-gate c1 c2 c3) 
     (inverter c3 output))) 
  
  
 ;; b 
 the delay is the sum of and-gate-delay plus twice inverter-delay.