Main Content

D Latch

Model an enabled D Latch flip-flop

  • Library:
  • Simulink Extras / Flip Flops

  • D Latch block

Description

The D Latch block models an enabled D Latch flip-flop. The D Latch block has two inputs:

  • D — Data input.

  • C — Chip enable input signal.

The chip enable input signal (C) controls when the block executes. When C is greater than zero, the output Q is the same as the input D. The truth table for the D Latch block follows.

Note

The D Latch block treats a nonzero input as true (1).

CDQ!Q
0AnyNo changeNo change
1001
1110

When the D Latch block is not enabled, the block remains in the previous state.

Logic Signals as Boolean or Double Data Types

The Implement logic signals as boolean data (vs. double) configuration parameter setting affects the input and output data types of the D Latch block because this block is a masked subsystem that uses the Logical Operator block. The Logical Operator block in the masked subsystem has the following parameter settings:

Block Parameter Setting
Output data typeInherit: Logical
Require all inputs and output to have the same data typeOn

For more information about the Implement logic signals as boolean data (vs. double) configuration parameter, see Implement logic signals as Boolean data (vs. double).

Ports

Input

expand all

Data input signal, specified as a scalar, vector, or matrix.

Dependencies

The data types that the D Latch block accepts depend on the setting of the Implement logic signals as boolean data (vs. double) configuration parameter:

  • OnD Latch block accepts only signals of type boolean.

  • OffD Latch block accepts signals of type boolean or double.

Data Types: double | Boolean

Chip enable input signal, specified as a scalar, vector, or matrix.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Output

expand all

Output signal Q, with the same dimensions and data type as the input D.

Data Types: double | Boolean

Output signal !Q, with the same dimensions and data type as the input D.

Data Types: double | Boolean

Version History

Introduced in R2008b