Contenido principal

CMOS OR

R2026b

Behavioral model of CMOS OR gate

  • CMOS OR block

Libraries:
Simscape / Electrical / Integrated Circuits / Logic

Description

The CMOS OR block represents a CMOS OR logic gate behaviorally:

  • The block output logic level is HIGH if the logic levels of any of the gate inputs are 1.

  • The block output logic level is LOW otherwise.

The block determines the logic levels of the gate inputs as follows:

  • If the gate voltage is greater than the threshold voltage, the block interprets the input as logic 1.

  • Otherwise, the block interprets the input as logic 0.

The threshold voltage is the voltage value at midpoint between the High level input voltage parameter value and the Low level input voltage parameter value.

Note

To improve simulation speed, the block does not model all the internal individual MOSFET devices that make up the gate. See Assumptions and Limitations for details.

The block models the gate as follows:

  • The gate inputs have infinite resistance and finite or zero capacitance.

  • The gate output offers a selection of two models: Linear and Quadratic. For more information, see Selecting the Output Model for Logic Blocks. Use the Output current-voltage relationship parameter to specify the output model.

  • You can specify propagation delay for both output models. For Linear output, the block sets the value of the gate output capacitor such that the resistor-capacitor time constant equals the Propagation delay parameter value. For Quadratic output, the gate input demand is lagged to approximate the Propagation delay parameter value.

The block initial conditions depend on the output model selected:

  • For Linear model, the high initial condition corresponds to the High level output voltage parameter value, V_OH, and the low initial condition corresponds to the Low level output voltage parameter value, V_OL.

  • For Quadratic model, the high initial condition is a value close to the Supply voltage parameter value, Vcc, and the low initial condition is close to 0.

The block output voltage depends on the output model selected:

  • For Linear model, output high is the High level output voltage parameter value, and output low is the Low level output voltage parameter value.

  • For Quadratic model, the output voltage for High and Low states is a function of the output current, as explained in Quadratic Model Output and Parameters. For zero load current, output high is Vcc (the Supply voltage parameter value), and output low is zero volts.

Plot Input and Output Waveforms

You can plot the input and output voltage waveforms of the CMOS OR block without building a complete model. Use the plots to explore the impact of your parameter choices on device characteristics. If you parameterize the block from a data sheet, you can compare your plots to the data sheet to check that you parameterized the block correctly. If you have a complete working model but do not know which manufactured part to use, you can compare your plots to data sheets to help you decide.

To plot the basic characteristics, in the Utilities section, click the Plot button next to the Basic characteristics parameter. (since R2026a)

Before R2026a: right-click the block and select Electrical > Basic Characteristics from the context menu.

Note

The plots you create using the Basic characteristics parameter do not show the effect of the Propagation delay parameter on the output voltage of logic blocks.

For more information, see Plot Basic Input-Output Voltage Characteristics of Logic Gates.

Assumptions and Limitations

The block does not model the internal individual MOSFET devices that make up the gate (except for the final MOSFET pair if you select the Quadratic option for the Output current-voltage relationship parameter). This limitation has the following implications:

  • The block does not accurately model the gate's response to input noise and inputs that are around the logic threshold voltage.

  • The block does not accurately model dynamic response.

Circuits that involve a feedback path around a set of logic gates may require a nonzero propagation delay to be set on one or more gates.

Ports

Conserving

expand all

Electrical conserving port associated with the first input terminal of the gate.

Electrical conserving port associated with the second input terminal of the gate.

Electrical conserving port associated with the output terminal of the gate.

Parameters

expand all

Inputs

Input voltage below which the block interprets the input logic as 0. The value must be less than the value of the High level input voltage parameter.

Input voltage above which the block interprets the input logic as 1. The value must be greater than the value of the Low level input voltage parameter.

Fixed capacitance that approximates the input capacitance for a MOSFET gate. The MOSFET capacitance depends on the applied voltage. When you drive this block with another gate, the Average input capacitance parameter produces a rise time similar to that of the MOSFET. You can find this capacitance value on a manufacturer data sheet. For fast simulation, set this parameter to zero.

Outputs

Model that determines the relationship between the output current and output voltage. Set this parameter to Linear for faster simulation and Quadratic for more accurate results. For more information, see Selecting the Output Model for Logic Blocks.

Output voltage when the logic level at the output is 0. The value must be less than the value of the High level output voltage parameter.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Linear.

Output voltage when the logic level at the output is 1. The value must be greater than the value of the Low level output voltage parameter.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Linear.

Output resistance that the block uses to model the drop in output voltage resulting from the output current. You can calculate this value from a data sheet by dividing the high-level output voltage by the maximum low-level output current.

If you set the Propagation delay parameter to zero, you must set the Output resistance parameter to a positive value.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Linear.

Voltage you supply to the gate in the circuit.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Gate supply voltage at which you define the output resistances and currents.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Resistance when the logic level at the output is 1. Specify this parameter as a row vector of two resistance values [R_OH1, R_OH2]. The first value, R_OH1, is the gradient of the output voltage-current relationship when there is no output current. The second value, R_OH2, is the gradient of the output voltage-current relationship when the output is shorted to ground. The second element must be greater than the first.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Output current when the logic level at the output is 1, but the load forces the output voltage to zero.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Resistance when the logic level at the output is 0. Specify this parameter as a row vector of two resistance values [R_OL1, R_OL2]. The first value, R_OL1, is the gradient of the output voltage-current relationship when there is no output current. The second value, R_OL2, is the gradient of the output voltage-current relationship when the load forces the output voltage to the Supply voltage parameter value. The second element must be greater than the first.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Output current when the logic level at the output is 0, but the load forces the output voltage to the Supply voltage parameter value.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Time it takes for the output voltage to change from the 0 to 1 or 1 to 0 state after the input logic levels change.

If you set the Propagation delay parameter to zero, you must set the Output resistance parameter to a positive value.

Gradient of the voltage-current relationship for the protection diodes when they are forward biased.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Voltage above which the protection diode turns on.

Dependencies

To enable this parameter, set the Output current-voltage relationship parameter to Quadratic.

Initial Conditions

Initial output state of the block, High or Low. The block uses this parameter for both linear and quadratic output models, provided that the Propagation delay parameter is greater than zero and the Solver Configuration block does not have the Start simulation from steady state option selected.

Utilities

Since R2026a

Plot the input and output waveforms of the CMOS OR block without building a complete model. Use these plots to explore the impact of your parameter choices on device characteristics.

For more information, see Plot Basic Input-Output Voltage Characteristics of Logic Gates.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2008b

expand all