|
|
|||||||||||||||||||||||
Logical Expressions - B2 Spice v5 GatesAbout the writer: Harvey Morehouse is a contractor/consultant with many years of experience using circuit analysis programs. His primary activities are in Reliability, Safety, Testability and Circuit Analysis. He may be reached at harvey.annie@verizon.net. Simple questions for which I know the answer are free. Complex questions, especially where I am ignorant of the answers, are costly!!! Please confine your questions to the content of the articles. Summary: In previous articles I created several logic devices (AND, NAND, OR, NOR, INVERT, that were not parameterized. These were created in version 4. While they will work correctly, their not being parameterized created several little problems for me. Here we will create parameterized subcircuits for these devices, suitable for use within other parameterized subcircuits. It is intended this will replace those devices within the version 5 library, which were ported over to version 5. Basic Logic Devices: The basic logic devices to be parameterized are shown in Figure 1 following:
Version 5 models: AND2: The AND2 device model is shown in Figure 2: The parameterized equation for B1 generator in what will become the AND2 device is shown in Figure 1, together with the parameters to be passed and their default values. A test circuit is shown in Figure 3.
Here we are stimulating the circuit with two pulsed voltage sources, each of which having an RC circuit load to simulate the output of a gate of some sorts. A graph of the circuit outputs is shown in Figure 4 following:
There are no surprises in this circuit. All works as expected. There ARE some 'slivers' in the outputs, but this is to be expected, as the inputs will occasionally be such to produce them. AND3: The
AND3 circuit is very similar to the AND2 circuit, with just another
term added to account for the third input. The circuit is shown in
Figure 5 following:
The AND3 test circuit is again similar to that of the AND2 circuit, and is shown in Figure 6 following:
A graph of this circuit output is shown in Figure 7 following:
Here we see the expected results. The generator periods were chosen deliberately to create all possible combinations of input signals, and naturally enough there are again some slivers. However, expanding the graph shows that the slivers are appropriate for the input signal conditions. NAND2: A NAND gate is a simple variation of an AND gate, with the THEN and the ELSE conditions transposed. This is shown in Figure 8 following: The test circuit for this device is shown in Figure 9 following:
A graph of the circuit output is shown in Figure 10 following:
The NAND2 device works as expected. When both inputs are HIGH, the output is low. NAND3: The NAND3 device is just a variation on the AND3 device. The NAND3 model is shown in Figure 11 following:
The test circuit for this device is that for the AND3 circuit, with the exchange of the VOl and VOh terms in the B1 generator.
The graph of the circuit output is shown in Figure 13 following:
Here we see the NAND3 circuit is well behaved. OR2: An OR2 circuit is shown in Figure 14 following:
A test circuit for this device is shown in Figure 15 following:
A graph of this circuit output is shown in Figure 16 following:
Again the circuit behaves nicely. OR3: An OR3 device was not provided for version 4, but for completeness, it is included here. The circuit is as shown in Figure 17 following:
The OR3 test circuit is shown in Figure 18 following: The graph of this circuit is shown in Figure 19 following:
NOR2: The NOR2 circuit is shown in Figure 20 following:
The NOR2 test circuit is shown in Figure 21 following:
A graph of the test circuit output is shown in Figure 22 following:
NOR3: The NOR3 circuit is shown in Figure 23 following:
The test circuit for this device is shown in Figure 24 following: The graph for this circuit is shown in Figure 25 following:
INV: An inverter circuit is shown in Figure 26 following: A test circuit for this device is shown in Figure 27 following: The graph of this device is shown in Figure 28 following:
These devices have been tested previously and they work as expected. Consequently no tests will be performed here. Summary: A
set of parameterized devices has been created for two and three input
AND, NAND, OR, NOR devices and an inverter using just a small portion
of the logical expression capabilities of version 5.15+. For those
persons who have followed the logical expression articles, which in
the main have been based on use of the ustep and uramp functions,
it should be clear how much easier it is to create and understand
devices implemented with these functions. These devices will be incorporated
into the version 5 standard library, and should be available at the
next program update following the appearance of this article on the
B2SPICE web site.
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||