邏輯門

出自Terraria Wiki
前往: 導覽搜尋
此頁面的(部分)內容需要被翻譯。
你可以幫助我們來翻譯此頁面
電腦版主機版移動版 電腦版/主機版/移動版獨有內容:此的信息適用於電腦版主機版、和移動版泰拉瑞亞
邏輯門
  • 邏輯門的物品外觀
自動使用
Stack digit 9.pngStack digit 9.pngStack digit 9.png
屬性
類型
可放置是 (1 格寬 × 1 格高)
使用時間15(很快速度)
稀有度01*稀有度級別:1
買入2
賣出40
研究需要 5 份
邏輯門(與)的使用示範。

邏輯門是提供線路邏輯的機械。使用一個或多個邏輯門燈放在邏輯門上做為信號源。邏輯門的開關狀態視其輸入源而定,且每次改變狀態時會發送一次信號。

邏輯門和邏輯門燈都以每個2的價格出售自蒸汽朋克人

行為[編輯 | 編輯原始碼]

所有的邏輯門在初次放置時都會是關閉狀態。每次加入、移除、或開關邏輯門燈,邏輯門會依以下規則行動:


邏輯門 規則
邏輯門(與)邏輯門(與)
內部物品 ID:3603
當所有的燈都激活時輸出信號。
邏輯門(與非)邏輯門(與非)
內部物品 ID:3605
除非所有燈都激活,否則輸出信號。
邏輯門(或)邏輯門(或)
內部物品 ID:3604
當至少有一盞燈激活時輸出信號。
邏輯門(或非)邏輯門(或非)
內部物品 ID:3606
當沒有燈激活時輸出信號。
邏輯門(異或)邏輯門(異或)
內部物品 ID:3607
當只有一盞燈激活時輸出信號。
邏輯門(同或)邏輯門(同或)
內部物品 ID:3608
當被激活的燈總數不是一盞時輸出信號。

無論何時打開或關閉邏輯門,它都會發出一個信號。如果這個信號會導致一個邏輯門改變它自己的輸入,並在同一時刻發出兩個信號,那麼相反,在這個邏輯門上會顯示一股煙霧,並且只發出一個信號。注意,雖然只發出一個信號,但邏輯門本身的狀態仍會改變(邏輯門輸出信號使邏輯門燈改變狀態不滿足邏輯門打開條件,邏輯門不會再次發出信號但是會關閉)。

故障邏輯門燈[編輯 | 編輯原始碼]

在邏輯門上方放置故障燈會使其變藍,並完全改變其邏輯行為。若邏輯門被信號觸發,它會隨機選擇其下方的邏輯門燈,若選中的燈是亮的,邏輯門便會發出一次信號。所以假設其下有三個燈,兩個暗的、一個亮的,則邏輯門收到信號時會有1/3的機會發出信號。放了故障燈後,邏輯門上的其它燈將無法影響邏輯門。

故障燈可以在同一個時刻被多次觸發,導致邏輯門有更高的機率發出信號。但同時刻一樣只能發出一次信號。比如:

A faulty lamp can be triggered multiple times in one tick, effectively giving the gate multiple chances to emit a signal. Multiple signals cannot be emitted on the same tick this way, however, the gate will have a chance to emit a signal for every time a faulty lamp receives a signal. For example, if you trigger a faulty gate with one out of two of its logic gate lamps on twice in the same tick, it will have an 3/4 chance of emitting a signal.

Faulty lamps continue to work if only one logic gate lamp is under it. In this case, the logic gate as a whole acts as an "if" statement, only passing a signal through if the single lamp is on. If no logic gate lamps are attached, the logic gate never sends signals when the faulty lamp is triggered. A very practical use of this is a one-way wire: when a logic gate receives a signal it does nothing, but triggering the faulty lamp above it does send a signal. The logic gate lamp under the faulty lamps needs to be on. Also, this wire can be turned off by sending a signal to the logic gate lamp. Making two of these lets the player control all four possible states of a wire: Off, on (A->B), on (A<-B), on (A<-->B).

Inverted Gates[編輯 | 編輯原始碼]

Since gates emit a signal whenever they either turn on or off, the "inverted" versions of each gate (those with an "N" prefix) behave identically to their normal counterparts in most situations. The only difference is when the first lamp is added to a new gate. (For example, both the NAND and AND gates start off when first placed. However, upon adding an off gate, the AND gate would stay off and emit no signal while the NAND gate would turn on, thus emitting a signal.)

Useful Circuits[編輯 | 編輯原始碼]

set/reset flip-flop (SR flip-flop)[編輯 | 編輯原始碼]

A set/reset flip-flop is a device that has two inputs, and can be switched between the two. However, multiple activations on the same input will not change the state. It will output a pulse when the state changes. In the illustration, red and blue are the inputs, and green is the output.

備註[編輯 | 編輯原始碼]

  • 泰拉瑞亞里沒有NOT邏輯門,有的話理論上它會在每次輸入改變時都送出一次訊號。
  • 多個故障燈可以連接在一個邏輯門上,且都可用來控制邏輯門。不過只有邏輯門底下的燈才可以控制發射訊號的機率。

歷史[編輯 | 編輯原始碼]