SR Latch

SR Latch
Stackable
Yes(64)

Overview

The SR Latch is a Digital Gate capable of storing information. Redstone CG uses a variant of the SR Latch constructed from OR, AND, and NOT Gates. The SR Latch has two inputs, Set and Reset, and one output. If both inputs are powered simultaneously, the output becomes 0. Otherwise, the output is determined based on the current Redstone signal state on inputs. As so if Set pin is powered then the Output pin is powered as well. If Reset pin is powered then the Output pin is unpowered.

Boolean Logic Table

The SR Latch operates according to the following Boolean logic table:

SetResetOutput
00Q
101
010
110

The Q state represents the memory of the latch. For example, if the Set pin is powered, the output becomes 1, and when both inputs are unpowered, the output remains 1. Conversely, if the Reset pin is powered, the output becomes 0.

Configuration

The input positions for the SR Latch are configurable via right-click. Pin Mark A represents the Set pin, and Pin Mark B represents the Reset pin. The correct configuration is crucial to ensure the expected behavior of the gate.

Parallel SR Latch
Stackable
Yes(64)

Parallel SR Latch

The Parallel Gate version of SR Latch is configurable via right-click as well. Depending on the configuration, the logic changes, and the Set or Reset pin can face the Back of the block. It operates according to the following Boolean logic tables:

When configured for Set pin to face the Back (BS):

LeftBackRightOutput
000Q
1000
0101
1100
0010
1010
0110
1110

When configured for Reset pin to face the Back (SB):

LeftBackRightOutput
000Q
1001
0100
1100
0011
1011
0110
1110

Crafting

Normal SR Latch

Parallel SR Latch

Version Log

VersionDescription
0.0.0Introduced. On update from anywhere reads redstone signal only and updates neighbours when output changes.
0.0.1Unlike in the previous version, block first reads the blockstate on the input, and if suitable, uses blockstate value, if not, reads redstone signal.
0.1.1Changed registry name from sr_trigger to floor_sr_latch and paralel_sr_latch to floor_parallel_sr_latch. Replaced bottom texture from being that on the top to Smooth Stone Block.
0.2.0Changed registry name from floor_sr_latch to normal_sr_latch and floor_parallel_sr_latch to parallel_sr_latch. Can be placed on walls and ceiling. Updates the block on the output when output changes instead of updating all neighbours. Output data is stored on Block Entity. Lost `rotate` and `mirror` block methods..
0.2.1Reimplemented `rotate` block method.