Modeling designs help engineers verify whether their circuit will function as intended. Modeling programs simulate circuit behavior under different conditions and in accordance with the design requirements, allowing engineers to better plan and build circuits.
Typically, to model components, generic models are used, which produce inaccurate and unrealistic simulations based on ideal conditions. This can cause functionality issues to go undetected until far later in the design process. To confidently simulate your digital circuit, create an XOR or XNOR gate SPICE model using specifications from a manufacturer’s datasheet.
Open in New WindowWhat is an XOR or XNOR Gate?
An exclusive OR or XOR gate gives a high output when there is exactly one true input while an exclusive NOR or XNOR gate gives a low output when there is exactly one true input.
XOR Gate
XOR gates are commonly used for:
- Binary Addition and Subtraction
- Parity Checking
- Data Comparison
XNOR Gate
XNOR gates are commonly used for:
- Equality Comparison
- Odd Parity Checking
- Data Validation
What is Needed for an XOR or XNOR Gate SPICE Model?
XOR and XNOR gate models are frequently used for digital applications as both components are essential building blocks in digital circuitry. To realistically simulate digital circuit functionality and create an XOR or XNOR SPICE model for simulation, there are two items that must be defined:
Timing Characteristics
Timing is critical to digital design operation and performance. Consider the delay caused by the XOR or XNOR gate.
DC Electrical Characteristics
The DC electrical characteristics define the operating conditions for the XOR or XNOR gate. This includes:
- The maximum output voltages during high-level and low-level operation
- The voltage levels or thresholds that control the switch from high-level operation to low-level operation
- Hysteresis is often defined for these devices to provide a cushion, ensuring accurate switching between low-level and high-level states even with noisy input signals. It is typically provided by device manufacturers on the device datasheet as VH; however, if not provided it can be calculated by VH = VT+ – VT-
Device Resistance
Input and output resistance of the device is critical to the operation and necessary to create an accurate model representation. If this parameter is not provided on the device datasheet, it can be calculated with Ohm’s law.
Input Resistance (RIN)
Use the maximum input voltage (VIN) and maximum leakage current (commonly IIN or Il) to calculate the input resistance.
Output Resistance (ROUT)
Use the maximum output voltage (VOH or VOL) and the maximum output current (IOH or IOL) to calculate the output resistance.
Once this information is obtained and calculated, these values must be incorporated into the SPICE simulation model which can be achieved by manually creating or editing a text file. Keep in mind if the XOR or XNOR gate created does not produce the intended outcome and a decision is made to change components, values will need to be re-calculated and edited manually. This manual process to produce an accurate XOR or XNOR gate model is time consuming and increases the likelihood of errors; however, the PSpice Modeling App provides a fast, easily configurable, and fully integrated method to create buffer or inverter models for simulation.
Creating XOR and XNOR Gate SPICE Models in PSpice
The XOR/XNOR Gate modeling application quickly creates XOR or XNOR gate SPICE models with a wizard-based approach. To create XOR or XNOR gate models, users can easily input the characteristics, defined by manufacturers, directly into predefined parameters:
Propagation Delay
Define the time delay between the input and output pins of the device. This can be defined as tPLH or tPHL on device datasheets.
Threshold (TH)
Define the voltage level that indicates a switch between high-level and low-level operation.
Hysteresis Width
Hysteresis is the difference between the positive input threshold voltage and the negative input threshold voltage. It is typically provided on the device datasheet as VH.
Output Resistance (ROUT)
Specify the resistance of the output pin.
Input Resistance (RIN)
Specify the resistance of the input pin.
Max High Voltage
Define the maximum voltage output during high-level operation. This is typically defined on device datasheets as VOH.
Max Low Voltage
Define the maximum voltage output during low-level operation. This is typically defined on device datasheets as VOL.
Using the inputted information above, the PSpice Modeling App generates a schematic symbol and automatically associates the newly created XOR or XNOR gate SPICE model without leaving the OrCAD Capture environment. The PSpice Modeling App also automatically manages the simulation profile configuration, eliminating any library set up for simulation.
Download the free trial of OrCAD to try it yourself.
Get the step-by-step instructions for creating an XOR and XNOR gate SPICE Model here.