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">
### 模拟
与门会取各输入中值最大者作为输出值。

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

# 计算器

<FloatingColumn width="100" align="right">
### 模拟
计数器会取各输入的计算结果作为输出。信号值不会超出0到15的范围。
</FloatingColumn>

<RecipeFor id="calculator" />

计算器的输入端口数目最少为2,最多为10。根据当前模式,计算器会对各输入执行加法或减法。计算结果即为输出值。

<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="calculator" x="48" y="8" type="calculator" />
<Logic name="output" x="80" y="8" type="io" data="{config:{input:false,signal_strength:15}}" hide={true} />

<Wire from="a" fromPort="0" to="calculator" toPort="0" />
<Wire from="b" fromPort="0" to="calculator" toPort="1" />
<Wire from="calculator" 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="1" />
<RedstoneSignal step="1" direction="west" strength="1" />

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

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

<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="calculator" x="48" y="8" type="calculator" data="{config:{mode:'subtraction'}}" />
<Logic name="output" x="80" y="8" type="io" data="{config:{input:false,signal_strength:15}}" hide={true} />

<Wire from="a" fromPort="0" to="calculator" toPort="0" />
<Wire from="b" fromPort="0" to="calculator" toPort="1" />
<Wire from="calculator" 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="2" />
<RedstoneSignal step="1" direction="west" strength="1" />

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

<RedstoneSignal step="3" direction="east" strength="10" />
<RedstoneSignal step="3" direction="west" strength="5" />
</MicrochipScene>
</Column>
</Row>

需要注意,计算器会根据顺序区分输入。也即,在减法模式下,若向靠前端口输入较小值,向靠后端口输入较大值,输出结果即会变为0。这是由于输出不可为负。例如,减法模式下,若计算器输入A为5,输入B为10,计算结果会是-5;但是输出结果为0,因此为OFF。
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,15 +12,20 @@ item_ids:

# I/O端口

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

<RecipeFor id="io" />

I/O端口是对电路传入和读取红石信号的途径。将I/O端口放入电路后,微芯片的对应面即会变为红石面,可借此输入输出红石信号。
I/O端口是对电路传入和从电路读取红石信号的途径。将I/O端口放入电路后,微芯片的对应面即会变为红石面,可借此输入输出红石信号。

<br />

每个I/O端口都有一个对应方向:<Color color="#4CFF00">北</Color>、<Color color="#0094FF">南</Color>、<Color color="#FF0000">东</Color>、<Color color="#FF6A00">西</Color>、<Color color="#FFFFFF">上</Color>、<Color color="#FFD800">下</Color>。潜行看向微芯片可查看侧面对应方向的颜色。

**注意:**单个方向可以是输入,也可以是输出,但不能兼做输入和输出。如果电路中I/O端口的排布使得某一面同时是输入和输出,那么与之相关的端口均不会运作,且会显示一则警告。
**注意:**&zwnj;单个方向可以是输入,也可以是输出,但不能兼做输入和输出。如果电路中I/O端口的排布使得某一面同时是输入和输出,那么与之相关的端口均不会运作,且会显示一则警告。

<br />

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">
### 模拟
或门会取各输入中值最大者作为输出值。

### 真值表
<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,13 +12,18 @@ item_ids:

# 读取器

<FloatingColumn width="100" align="right">
### 模拟
在比较器模式下,读取器会取对应方块的比较器输出值作为输出。其他情况下,读取器只会输出0(OFF)或1(ON)。
</FloatingColumn>

<RecipeFor id="reader" />

读取器是一种逻辑元件。它不会接收来自电路内部的信号,而是会根据相邻容器方块的填充程度输出信号,读取的方向可配置。

读取器接受的容器包括物品容器(箱子、木桶、熔炉等)、流体容器(模组提供的流体容器)、能量容器(电池等模组提供的FE容器)。默认情况下,读取器会读取物品的填充程度,可在配置菜单中修改读取对象。

读取器可配置为只在容器填充程度达到某个最小值时才输出ON。默认情况下,最小填充百分比是50%
读取器可配置为检测容器的填充程度是否达到某个阈值,符合条件才输出ON。该阈值可为常值或百分比。在值的末尾补上%,即视为使用百分比

下方示例中,读取器会在箱子至少填充到50%时点亮红石灯。

Expand All @@ -43,7 +48,7 @@ item_ids:
<Logic name="reader" x="0" y="0" type="reader" data="{config:{direction:'west'}}" />
<Logic name="output" x="32" y="0" type="io" data="{config:{direction:'east',input:false,signal_strength:15}}" />

<Wire from="reader" fromPort="0" to="output" toPort="0" powered={true} />
<Wire from="reader" fromPort="0" to="output" toPort="0" powered="1" />
</MicrochipScene>
</Column>
</Row>
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: 26
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,13 @@ item_ids:

# 选择器

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

若未处于直通模式,输出信号的强度则会与序号相等(从1开始)。例如,第一个输出的强度为1,第二个为2,第三个为3,以此类推。
</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: 25
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
Loading
Loading