| 이전 주제 보기 :: 다음 주제 보기 |
| 글쓴이 |
메시지 |
조현창
가입: 2012년 9월 7일 올린 글: 8
|
올려짐: 2012년10월27일 4:07 주제: 실습 5번 질문입니다. |
|
|
| 코드: | (define w1 (make-wire "w1"))
(define w2 (make-wire "w2"))
(define w3 (make-wire "w3"))
(define and1 (and-gate w1 w2 w3))
(define not1 (not-gate w3 w1))
(define switch1 (switch w2))
(define circuit1 (add-gate-to-circuit "and1" and1 empty-circuit))
(define circuit2 (add-gate-to-circuit "not1" not1 citcuit1))
(define circuit3 (add-gate-to-circuit "switch1" switch1 circuit2))
(define circuit-state
(set-wire-volts
(list (cons "w1" zero) (cons "w2" zero) (cons "w3" one))
circuit3))
(print (run circuit-state 3))
> w1 0
> w2 1
> w3 0 |
문서의 예제인데요
답이 w1 1 / w2 0 / w3 0 아닌가요? |
|
| 위로 |
|
 |
최민아
가입: 2009년 9월 28일 올린 글: 236
|
올려짐: 2012년10월27일 16:25 주제: |
|
|
| 코드: | (define w1 (make-wire "w1"))
(define w2 (make-wire "w2"))
(define w3 (make-wire "w3"))
(define and1 (and-gate w1 w2 w3))
(define not1 (not-gate w3 w1))
(define switch1 (switch w2))
(define circuit1 (add-gate-to-circuit "and1" and1 empty-circuit))
(define circuit2 (add-gate-to-circuit "not1" not1 citcuit1))
(define circuit3 (add-gate-to-circuit "switch1" switch1 circuit2))
(define circuit-state
(set-wire-volts
(list (cons w1 one) (cons w2 one) (cons w3 zero))
circuit3))
(print (run circuit-state 3)) |
으로 테스트셋을 수정하였습니다. 죄송합니다. |
|
| 위로 |
|
 |
|