| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimElectronics |
| Contents | Index |
| Learn more about SimElectronics |
Logic

The S-R Latch block is an abstracted behavioral model of a set-reset latch. It does not model the internal individual MOSFET devices. Therefore, the block runs quickly during simulation but retains the correct I/O behavior.
The block models gate inputs electrically as having infinite
resistance and a finite or zero capacitance. If the gate voltage is
greater than the threshold voltage
,
then the input taken is 1 (HIGH).
Otherwise, the input is zero (LOW). The gate threshold
voltage
is halfway between the Low
level input voltage (
)
and High level input voltage (
) parameters.
The block models the gate output as a voltage source driving a series resistor and a capacitor that connects
to ground. The output pin connects to the resistor-capacitor connection
node. The voltage source is equal to either the Low level
output voltage (
) or the High level output
voltage (
) parameter, according to the logic
levels of the gate inputs and the S-R latch truth table.
| S | R | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
The block sets the value of the gate output capacitor such that the resistor-capacitor time constant is equal to the propagation delay.
The block does not model the internal individual MOSFET devices that make up the gate. This limitation has the following implications:
The behavior of this block is abstracted. In particular, response to input noise and inputs that are around the logic threshold voltage can be inaccurate. Also, dynamic response is approximate.
The linear drop in output voltage as a function of output current is an approximation to the MOSFET or bipolar output behavior.
Modeling of the output as a controlled voltage source is representative of a totem-pole or push-pull output stage. To model a device with an open-collector:
Connect the output pin to the base of an NPN Bipolar Transistor or PNP Bipolar Transistor block.
Set the Output resistance parameter to a suitable value.

Voltage value less than which the block interprets the input voltage as LOW. The default value is 2 V.
Voltage value greater than which the block interprets the input voltage as HIGH. The default value is 3 V.
Fixed capacitance that approximates the input capacitance for a MOSFET gate. You can usually find this capacitance value on a manufacturer datasheet. The default value is 5 pF. Setting this value to zero can result in faster simulation times.

Voltage value
at the output when
the output logic level is LOW. The default value
is 0 V.
Voltage value
at
the output when the output logic level is HIGH.
The default value is 5 V.
This parameter is the ratio of output voltage drop to output
current. Set this parameter to
,
where
is the reduced
output high voltage when the output current is
. The default value is 450 Ω.
Time it takes for the output to swing from LOW to HIGH or HIGH to LOW, after the input logic levels change. The default value is 1.2e-07 s.
This block has the following ports:
Electrical input port corresponding to the set pin.
Electrical input port corresponding to the reset pin.
Electrical output port corresponding to the output pin.
![]() | Resistor | Servomotor | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |