Digital Lookup Table

The Digital Lookup Table models combinatorial logic defined with a truth table. The truth table maps logical combinations of input states to output states. A default output state determines the output if the input state is not defined in the table.

The Digital Lookup Table is one of the most powerful and, at the same time, one of the most overlooked of the SIMPLIS digital devices. Using a Digital Lookup Table, you can easily implement, test, and revise extremely complex logic, all without changing the schematic view of the design.

This Lookup Table requires that all input signal combinations be defined for each state. If you need to define one or more input states with a don't care input, see Digital Lookup Table with Don't Care in Input Definitions.

In this topic:

Model Name: Digital Lookup Table
Simulator: This device is compatible with the SIMPLIS simulator.
Parts Selector Menu Location: Digital Functions > Functions
Symbol Library: None - the symbol is automatically generated when placed or edited.
Model Library: None - the model is automatically generated when the simulation is run.
Subcircuit Names:
  • SIMPLIS_DIGI1_D_LOOKUP_TABLE_N : Without Ground Reference
  • SIMPLIS_DIGI1_D_LOOKUP_TABLE_Y : With Ground Reference
Symbol:
10-input, 2-output lookup table
Multiple Selections: Only one device at a time can be edited.

Editing the Digital Lookup Table

To configure the Digital Lookup Table, follow these steps:

  1. Double click the symbol on the schematic to open the editing dialog to the Parameters tab.
  2. Make the appropriate changes to the fields described in the table below the image.
Label Parameter Description
Propagation Delay Delay from when the input state changes until the output changes
Number of Bits A Number of input bits to first multiplier input, the number of output bits will be Number of Bits A * Number of Bits B
Number of Bits B Number of input bits to second multiplier input, the number of output bits will be Number of Bits A * Number of Bits B
Redefine Source? Determines whether the source is to be redefined after the dialog is closed.
  • Checked: The source will be redefined after the dialog is closed.
  • Unchecked: The source definition remains unchanged after the dialog is closed.
Default Value Default value of lookup table output if the input value is not found in the lookup table.
Initial Condition Initial condition of the Lookup Table output at time=0
Ground Ref Determines whether or not a device has a ground reference pin. Any digital component that has an input or output pin connected to an analog circuit node must have its Ground Ref pin connected to an analog node. This is usually the ground on the schematic.

To define the parameters for the interface between this digital component and each analog component connected directly to an input or output pin, follow these steps:

  1. From the Edit Digital Lookup Table dialog box, click on the Interface tab.
  2. Make the appropriate changes to the fields described in the table below the image.
Label Parameter Description
Input Resistance Input resistance of each Lookup Table input pin
Hysteresis, Threshold Hysteresis and Threshold of the inputs. The hysteretic-window width, HYSTWD is centered around Threshold (TH) voltage. To determine the actual threshold ( TL , THI ), substitute Threshold (TH) and Hysteresis (HYSTWD) in each of the following formulas:
Input Logic Level Actual Threshold
1 Threshold + 0.5 * Hysteresis
0 Threshold - 0.5 * Hysteresis
Output Resistance Output resistance of each Lookup Table output pin
Output High Voltage Output high voltage for each Lookup Table output pin
Output Low Voltage Output low voltage for each Lookup Table output pin

Table Definition Methods

The Digital Lookup Table can be defined with a dialog or with a points file.

Dialog Method

Using the dialog method, you can define up to 255 logical input states. The points definition is saved as a property on the Digital Lookup Table symbol.

This method is often used for smaller table definitions, such as the 10-input AND and OR gates in this example. The input and output states are defined as the decimal equivalent of the input and output pins. For example, the 10-input AND gate in this example decodes 1023 (all 1's) and outputs a decimal 1, representing a logic low on the NAND output and a logic high on the AND output.

File Method

Using the file method, you can define the complete input space of 2Number of Input Bits. The points definition with this method is saved as a plain ASCII text file; before the simulation starts, the points file is read and used to configure the Lookup Table.

This method is often used for large or complicated table definitions although, as this example shows, a file method can be used for tables as small as a single input state definition. The following 10-input AND/NAND gate example demonstrates the file format, which uses tabs and spaces to delimit columns in the points definition file.

  • Lines starting with an asterisk (*) are comments.
  • The input state is defined in the first column in decimal format.
  • The states for each output pin follow in MSB -> LSB order; since these are single bits, the output states are defined as either 0 or 1.
  • For the AND/NAND gate example, there are three columns: one for the input and two for the outputs.

A points definition file example can be downloaded here: simplis_041_and_nand_points.txt. This file is also included in the following zip archive: simplis_041_digitallookuptable_file_example.zip.

Examples

The test circuit used to generate the waveform examples in the next section can be downloaded here: simplis_041_digitallookuptable_example.sxsch.

The same test circuit with Lookup Tables defined using the file method can be downloaded here: simplis_041_digitallookuptable_file_example.zip. In order to simulate this design, you need to unzip the archive to your local drive, and then open the schematic file in SIMetrix/SIMPLIS.

Waveforms

The Digital Lookup Table examples use two Lookup Tables:

  • One implements a 10-input AND/NAND gate.
  • The other is a 10-input OR/NOR gate.

The AND/NAND logic gate is implemented with Lookup Table, U_AND; the OR/NOR gate is implemented with U_OR. The parameters for each Lookup Table are as follows:

  • AND/NAND: The default value for the two logic outputs is set to decimal 2, representing a logic low on the AND output and a logic high on the NAND output. The points definition table is only one line; when the 10-bit input is 1023 decimal, the AND output is high and the NAND output is low. The output state for this is 1 in decimal.

    Dialog Definition File Definition
  • OR/NOR: The default value for the two logic outputs is set to decimal 1, representing a logic high on the OR output and a logic low on the NOR output. The logic table is only one line; when the 10-bit input is 0 decimal, the OR output is low and the NOR output is high. The output state for this is 2 in decimal.

    Dialog Definition File Definition

In the following example, the initial condition of the counter is set to 1021 decimal, which allows the counter to reach the maximum count during a short simulation run. As the counter counts up, the AND/NAND gates transition at 1023, and the OR/NOR gates transition at 0 decimal.

Subcircuit Parameters

Because the Digital Lookup Table model is generated by a template script when the simulation is executed, a hand-coded model cannot be inserted into a netlist. The template script for this device is simplis_make_signal_source_model.sxscr, which licensed users can download as part of a zip archive of all built-in scripts.

To download the zip archive, follow these steps:

Important: You will be prompted to log in with the user name and password you received with your license file. If you don't have the user name and password, you can email support@simplistechnologies.com with your license information to receive the login credentials. Include a screenshot of the dialog which opens when you run the Help > License Diagnostics... menu.
  1. Click http://www.simetrix.co.uk/simetrix80/scripts.zip to download the script archive.
  2. Enter the user name and password you received with your license file.

The following parameter table defines the parameters used in this model.

Parameter Name Label Data Type Range Units Parameter Description
DEFAULT Default Value Number   none Default value of lookup table output if the input value is not found in the lookup table.
GNDREF Ground Ref String
  • 'Y'
  • 'N'
none Determines whether or not a device has a ground reference pin. Any digital component that has an input or output pin connected to an analog circuit node must have its Ground Ref pin connected to an analog node. This is usually the ground on the schematic.
HYSTWD,
TH
Hysteresis,
Threshold
Number min: 1f V Hysteresis and Threshold of the inputs. The hysteretic-window width, HYSTWD is centered around Threshold (TH) voltage. To determine the actual threshold ( TL , THI ), substitute Threshold (TH) and Hysteresis (HYSTWD) in each of the following formulas:
Input Logic Level Actual Threshold
1 Threshold + 0.5 * Hysteresis
0 Threshold - 0.5 * Hysteresis
IC Initial Condition Number
  • 0
  • 1
none Initial condition of the Lookup Table output at time=0
NUMBITS_A Number of Bits A Integer   none Number of input bits to first multiplier input, the number of output bits will be Number of Bits A * Number of Bits B
NUMBITS_B Number of Bits B Integer   none Number of input bits to second multiplier input, the number of output bits will be Number of Bits A * Number of Bits B
OUT_DELAY Propagation Delay Number 1f to 1024 s Delay from when the input state changes until the output changes
REDEFINE_SOURCE Redefine Source? Boolean   none Determines whether the source is to be redefined after the dialog is closed.
  • Checked: The source will be redefined after the dialog is closed.
  • Unchecked: The source definition remains unchanged after the dialog is closed.
RIN Input Resistance Number min: 100 Input resistance of each Lookup Table input pin
ROUT Output Resistance Number min: 1m Output resistance of each Lookup Table output pin
SOURCE_DEF Source Definition Method String
  • 'Dialog'
  • 'File'
none Determines whether the definition of the digital signal source comes from a dialog or an external file. If Redefine Source? is checked, you will be prompted to edit the digital signal source definition with a dialog or to choose a new definition file, depending on the value of Source Definition Method after this dialog is closed.
VOH Output High Voltage Number any V Output high voltage for each Lookup Table output pin
VOL Output Low Voltage Number any V Output low voltage for each Lookup Table output pin

Common File Formatting Issues

  • An input file without an extra empty line after the last point definition:

    If you examine the file example, it contains 6 lines: 4 are comments, one is an input definition, and the last one is an empty line. This empty line MUST be present at the end of each definition files. If the line is not present, the following error occurs:

    *** ERRORS REPORTED BY SIMPLIS *** 
    ****************************************
    <<<<<<<< Error Message ID: 1179 >>>>>>>>
    
    points file AND_NA~1.TXT
    
    No data point has been defined in this file.
    This model requires 1 data points to be defined.
    
    
    *** END SIMPLIS ERROR REPORT ***
  • An input file that contains non-ASCII characters: A points file that contains non-ASCII characters cannot be read by SIMetrix/SIMPLIS; as a result, the Lookup Table creation is aborted and the following errors are generated:
    
    Error : The file 'and_nand_points.txt' contained some non-ascii characters
    File read has been aborted  
    
    *** ERRORS REPORTED BY SIMPLIS ***
    ****************************************
    <<<<<<<< Error Message ID: 1057 >>>>>>>>
    input file file_path\SIMPLIS_Data/simplis_041_digitallookuptable_file_example.deck, line 76:
    + VOL=0 VOH=5 DEFAULT=2 OUT_DELAY=1e-011 NPTS=0 NUMBITS_OUT=2 NUMBITS_IN=10 FILE=AND_NA~1.TXT
    
    A positive integer to represent 
    the value for `NPTS' is expected
    at the location where `0'
    occupies.
    
    *** END SIMPLIS ERROR REPORT *** 
  • Comments at the end of the point-definition line:

    If you have a comment in a point-definition line, the following error occurs:

    *** ERRORS REPORTED BY SIMPLIS *** 
    ****************************************
    <<<<<<<< Error Message ID: 1179 >>>>>>>>
    
    points file AND_NA~1.TXT, line 5
         1023        0       1       *** illegal comment
                                     ^
     Unexpected entry `***' when end of line
     is expected while reading point #1.
    
    
     *** END SIMPLIS ERROR REPORT ***