Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# 与门

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。

### 真值表
<TruthTable inputs="2">
<TruthState input="0,0" output="0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
navigation:
title: "比较器"
icon: "comparator"
parent: little_big_redstone:logic.md
position: 23
categories:
- logic
item_ids:
- little_big_redstone:comparator
---

# 比较器

<FloatingColumn width="100" align="right">
### 模拟
比较器所输出信号的值与比较基准信号的相等。基准可为设定中指定的值,或在比较器设为直通时取首个输入信号的值。
</FloatingColumn>

<RecipeFor id="comparator" />

比较器是能将1到10个输入信号(B₁ - B₁₀)的信号与某个其他信号(A)进行比较的逻辑元件。模式选项决定了输出ON需要全部输入均通过比较,还是任意一个通过比较即可。输出为ON时,其强度等于比较基准信号A的强度。

比较器配置为直通时,会开放输入A的端口。也可为其指定常量比较基准,此时不会开放输入A的端口。

与其他会比较信号强度的逻辑元件类似,比较器也可配置为输入值大于等于、等于或小于等于输入A时视为通过比较。

<Row>
<Column>
<MicrochipScene color="red" includeToolbar={true}>
<Logic name="a" x="0" y="4" type="io" data="{config:{direction:'east'}}" hide={true} />
<Logic name="b" x="16" y="12" type="io" data="{config:{direction:'west'}}" hide={true} />
<Logic name="comparator" x="48" y="8" type="comparator" />
<Logic name="output" x="80" y="8" type="io" data="{config:{input:false,signal_strength:15}}" hide={true} />

<Wire from="a" fromPort="0" to="comparator" toPort="0" />
<Wire from="b" fromPort="0" to="comparator" toPort="1" />
<Wire from="comparator" fromPort="0" to="output" toPort="0" />

<RedstoneSignal step="0" direction="east" strength="0" />
<RedstoneSignal step="0" direction="west" strength="0" />

<RedstoneSignal step="1" direction="east" strength="0" />
<RedstoneSignal step="1" direction="west" strength="15" />

<RedstoneSignal step="2" direction="east" strength="15" />
<RedstoneSignal step="2" direction="west" strength="0" />

<RedstoneSignal step="3" direction="east" strength="15" />
<RedstoneSignal step="3" direction="west" strength="15" />
</MicrochipScene>
</Column>

<Column>
<MicrochipScene color="red" includeToolbar={true}>
<Logic name="a" x="0" y="0" type="io" data="{config:{direction:'east'}}" hide={true} />
<Logic name="comparator" x="32" y="0" type="comparator" data="{config:{signal_strength:15}}" />
<Logic name="output" x="64" y="0" type="io" data="{config:{input:false,signal_strength:15}}" hide={true} />

<Wire from="a" fromPort="0" to="comparator" toPort="0" />
<Wire from="comparator" fromPort="0" to="output" toPort="0" />

<RedstoneSignal step="0" direction="east" strength="0" />

<RedstoneSignal step="1" direction="east" strength="10" />

<RedstoneSignal step="2" direction="east" strength="15" />
</MicrochipScene>
</Column>

<Column>
<MicrochipScene color="red" includeToolbar={true}>
<Logic name="a" x="0" y="-5" type="io" data="{config:{direction:'north'}}" hide={true} />
<Logic name="b" x="0" y="0" type="io" data="{config:{direction:'south'}}" hide={true} />
<Logic name="c" x="0" y="5" type="io" data="{config:{direction:'east'}}" hide={true} />
<Logic name="comparator" x="32" y="0" type="comparator" data="{config:{signal_strength:15,inputs:3}}" />
<Logic name="output" x="64" y="0" type="io" data="{config:{input:false,signal_strength:15}}" hide={true} />

<Wire from="a" fromPort="0" to="comparator" toPort="0" />
<Wire from="b" fromPort="0" to="comparator" toPort="1" />
<Wire from="c" fromPort="0" to="comparator" toPort="2" />
<Wire from="comparator" fromPort="0" to="output" toPort="0" />

<RedstoneSignal step="0" direction="north" strength="10" />
<RedstoneSignal step="0" direction="south" strength="0" />
<RedstoneSignal step="0" direction="east" strength="0" />

<RedstoneSignal step="1" direction="north" strength="10" />
<RedstoneSignal step="1" direction="south" strength="0" />
<RedstoneSignal step="1" direction="east" strength="10" />

<RedstoneSignal step="2" direction="north" strength="10" />
<RedstoneSignal step="2" direction="south" strength="15" />
<RedstoneSignal step="2" direction="east" strength="15" />

<RedstoneSignal step="3" direction="north" strength="15" />
<RedstoneSignal step="3" direction="south" strength="15" />
<RedstoneSignal step="3" direction="east" strength="15" />
</MicrochipScene>
</Column>
</Row>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ navigation:
<LogicIndex />
</FloatingColumn>

逻辑元件也称逻辑门,是真正驱动电路的组件。所有逻辑元件都可有输入和输出端口。这些端口是传递和修改信号以得到预期结果的方式。逻辑元件完全基于布尔逻辑;换言之,信号只有两个值——“关”/“OFF”(0)和“开”/“ON”(1)
逻辑元件也称逻辑门,是真正驱动电路的组件。所有逻辑元件都可有输入和输出端口。这些端口是传递和修改信号以得到预期结果的方式。逻辑元件基于模拟逻辑运作,与红石粉类似;换言之,信号可为0(OFF)到15的任意值。大于等于1的值均视作ON。部分逻辑元件会直接取输入信号的值用于输出。例如,向元件输入值为10的信号,那么假定输出信号为ON,则其值也会为10。有部分元件不遵从此规则,其页面内均已进行说明。通常来说,逻辑门(与、或等)不会将信号值直通至输出

<br />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# I/O端口

<FloatingColumn width="100" align="right">
### 模拟
I/O端口所输出信号的值与输入信号的相等。
</FloatingColumn>

<RecipeFor id="io" />

I/O端口是对电路传入和读取红石信号的途径。将I/O端口放入电路后,微芯片的对应面即会变为红石面,可借此输入输出红石信号。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# 与非门

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。

### 真值表
<TruthTable inputs="2">
<TruthState input="0,0" output="1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# 或非门

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。

### 真值表
<TruthTable inputs="2" outputs="1">
<TruthState input="0,0" output="1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# 非门

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。

### 真值表
<TruthTable>
<TruthState input="0" output="1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# 或门

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。

### 真值表
<TruthTable inputs="2" outputs="1">
<TruthState input="0,0" output="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# 脉冲节流器

<FloatingColumn width="100" align="right">
### 模拟
在默认情况下,脉冲节流器所输出信号的值与输入信号的相等。若指定了输出信号强度,则仅输出该值。
</FloatingColumn>

<Row>
<Column>
<RecipeFor id="pulse_throttler" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# 随机发生器

<FloatingColumn width="100" align="right">
### 模拟
随机发生器所输出信号的值与输入信号的相等。
</FloatingColumn>

<RecipeFor id="randomizer" />

随机发生器的输出端口数目最少为1,最多为10,且同一时刻只会有一个端口输出ON。输入为ON时,每刻都有一定概率任选一个输出端口输出ON信号。该概率可配置,默认情况下此概率为100%,可修改成任意值。例如将该概率设为50%,则在输入为ON时,有一半的时间内会任选一个端口输出ON。各输出的选中概率相等。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# 读取器

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。
</FloatingColumn>

<RecipeFor id="reader" />

读取器是一种逻辑元件。它不会接收来自电路内部的信号,而是会根据相邻容器方块的填充程度输出信号,读取的方向可配置。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ navigation:
title: "RS或非锁存器"
icon: "rs_nor_latch"
parent: little_big_redstone:logic.md
position: 24
position: 25
categories:
- logic
item_ids:
Expand All @@ -13,6 +13,9 @@ item_ids:
# RS或非锁存器

<FloatingColumn width="100" align="right">
### 模拟
RS或非锁存器会取将其设为ON的输入信号的值用作输出。

### 真值表
<TruthTable inputs="2" outputs="1">
<TruthState input="0,0" output="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# 选择器

<FloatingColumn width="100" align="right">
### 模拟
选择器所输出信号的值与输入信号的相等。若选择器处于计数器模式,则取递增和递减信号中较大者的值用作输出。
</FloatingColumn>

<RecipeFor id="selector" />

选择器的输出端口数目最少为2,最多10,且同一时刻只会有一个输出为ON。选择器共有两种模式:计数器和置位器(更多内容见此页面后续)。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# 时序器

<FloatingColumn width="100" align="right">
### 模拟
时序器所输出信号的值与输入信号的相等。但对于时序器而言,其输出信号为ON时输入信号并不一定为ON。此时,时序器会取令其输出变为ON的ON输入信号的值用作输出。
</FloatingColumn>

<Row>
<Column>
<RecipeFor id="sequencer" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ navigation:
title: "T触发器"
icon: "t_flip_flop"
parent: little_big_redstone:logic.md
position: 23
position: 24
categories:
- logic
item_ids:
Expand All @@ -12,6 +12,11 @@ item_ids:

# T触发器

<FloatingColumn width="100" align="right">
### 模拟
T触发器会取将其设为ON的输入信号的值用作输出。
</FloatingColumn>

<Row>
<Column>
<RecipeFor id="t_flip_flop" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ item_ids:

# 标信器

<FloatingColumn width="100" align="right">
### 模拟
标信器所输出信号的值与输入信号的相等。在有多个输入信号的情况下(如阈值>1),则使用最高信号的值用作输出。
</FloatingColumn>

<RecipeFor id="tag" />

标信器可在电路间无线收发信号。它有两个模式:发信和探测。探测端是接受信号的一端,发信端则是发送的一端。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# 异或门

<FloatingColumn width="100" align="right">
### 布尔
只会输出0(OFF)或1(ON)。

### 真值表
<TruthTable inputs="2" outputs="1">
<TruthState input="0,0" output="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ item_ids:

一个输入端口只能连接一条导线,输出端口则没有导线数量限制。如需将多条导线汇集到单个输入端口处,应使用[或门](logic/or_gate.md)。

传统红石信号的强度可为0到15的整数,红石位粒的信号强度则只可为0或1。换句简单点的话,那就是导线里要么有信号,要么没信号——它是一个严格意义上的布尔系统
红石位粒和普通的红石粉功能类似,即信号强度可为0到15。当然,强度为0代表导线为OFF,大于等于1均为ON

### 导线的使用

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ item_ids:
# AND Gate

<FloatingColumn width="100" align="right">
### Boolean
Gates will only ever yield an output value of 0 (OFF) or 1 (ON).

### Truth Table
<TruthTable inputs="2">
<TruthState input="0,0" output="0" />
Expand Down
Loading
Loading