Re: [問題] hw5

作者: kalawang (Out)   2010-05-18 17:54:06
※ 引述《ric2k1 (Ric)》之銘言:
: ※ 引述《pokia (幻影成風)》之銘言:
: : 第一題附的updateWatch()裡
: : isWatchedValue()指的是什麼意思?
: Gate::isWatchedValue(newIdx)
: 就是去檢查第 newIdx 個 watch pin (in _wCandidates) 的 value
: 是否 = watched value
: 比方說 3-input AND gate, 這個 gate 本身將會放在他的 _wCandidates 的第 0 個位置
: 而其他三個 fanins 會放在第 1 ~ 3 個位置.
: ==> isWatchedValue(0) 就會檢查這個 gate 的 value 是否為 0
: ==> isWatchedValue(1 ~ 3) 會檢查第 1 ~ 3 個 fanin 的 value 是否為 1
: : 還有最後一段的
: : if(!isWatchedValue(otherIdx))
: : return genIndexImp(otherIdx);
: : IMP_NEW? 這邊也不太懂...
: : 我只知道newIdx在找新的index,不可以和另一個watch衝突...
: : 剩下的就不太明白了!?
: : 有人知道這個function大概的意思嗎?
: 會到這裡表示要 update watch pin 但是找不到
: (沒有其他非 watch 的 pin 都是非 watch value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
這邊是指所有非watched(!=otherPin Idx)
的其他pin都是watch value嗎?
eg. (For OR gate, all fanins are 0 and fanout is 1)
: 所以傳入的 newIdx 必須 restore 回原來的值
: 同時去檢查另一個 watch pin,
: 如果它不是 watch value (e.g. 0 or x for AND's fanin),
: 那麼就是著去 generate new implication (genIndexImp(otherIdx)),
: 如果 other watch pin 的值是 known (e.g. 0 for AND's fanin)
: ==> return IMP_DONE (i.e. no new implication is generated)
: otherwise (e.g. x for AND's fanin)
: ==> return IMP_NEW (i.e. new implication is generated on this watch pin)
: 相反的,如果另一個 watch pin 也是 watch value 的話,
: 則所有的 pins 都是 watch value
: (i.e. AND gate has value 0 and all its fanins have value 1's)
: ==> return IMP_CONFLICT
: : 順便問一下,OR gate b 為什麼也要把自己放在watching-1??
: : 我忘記了...
: 因為 OR gate 的 output 是 watch 1,
: 所以如果 output 也是個 watched pin 的話,
: 自己 value 變成 1 的時候也要通知自己去 update watch pin
: 所以自己會在自己的 watching-1 list 上面
updateWatch()是為了做indirect implication吧(嗎)?
如果現在有個direct implication
(for eg. AND gate output 1 => all fanin's are ones)
會不會trigger updateWatch()這個function
是不是要看AND的每個fanin 是否有被它自己的gate
放在watching-1 (for eg. OR) or (watching-known for XOR) 裡呢?
再請問如果一個watched pin得到non Watch value(也就是有direct implication)
(for eg 0 for AND gate fanin) 是不是不用update這個pin的watch pointer
to a new index?

Links booklink

Contact Us: admin [ a t ] ucptt.com