oGate Object

Back to top of pageDescription:
 A Processing Object that can be configured to do multi-input logic gate operations like AND, NAND, OR, NOR, XOR, XNOR, NOT, LATCH, Etc.
 The following table lists the size and availability of the oGate Object and its variations.
 ObjectSizeDescriptionA1A2B1B2C1
oGate3 BytesCopies the value of an oLogic Object to another oLogic Object.xxxxx
oGate24 BytesCopies the value of an oLogic Object to 2 other oLogic Objects.xxxxx
oGate35 BytesCopies the value of an oLogic Object to 3 other oLogic Objects.xxxxx
oGate46 BytesCopies the value of an oLogic Object to 4 other oLogic Objects.xxxxx
oGate57 BytesCopies the value of an oLogic Object to another oLogic Object.xxxxx
oGate68 BytesCopies the value of an oLogic Object to 2 other oLogic Objects.xxxxx
oGate79 BytesCopies the value of an oLogic Object to 3 other oLogic Objects.xxxxx
oGate810 BytesCopies the value of an oLogic Object to 4 other oLogic Objects.xxxxx
oGateC5 BytesClocked copy of an oLogic Object's value to another oLogic Object.xxx
oGate2C6 BytesClocked copy of an oLogic Object's value to 2 other oLogic Objects.xxx
oGate3C7 BytesClocked copy of an oLogic Object's value to 3 other oLogic Objects.xxx
oGate4C8 BytesClocked copy of an oLogic Object's value to 4 other oLogic Objects.xxx
oGate5C9 BytesClocked copy of an oLogic Object's value to another oLogic Object.xxx
oGate6C10 BytesClocked copy of an oLogic Object's value to 2 other oLogic Objects.xxx
oGate7C11 BytesClocked copy of an oLogic Object's value to 3 other oLogic Objects.xxx
oGate8C12 BytesClocked copy of an oLogic Object's value to 4 other oLogic Objects.xxx
Back to top of pageOperation:
 An oGate Object takes the value of the oLogic Object pointed to by one or more Input pointers and performs a logical OR operation. The logical OR operation can be changed by setting the InvertIn(1-8), InvertOut, and the Exclusive properties. The properties InvertIn(1-8) and InvertOut invert the input values to the logical OR operation while the Exclusive property determines if the inputs will be evaluated with a Boolean-OR or a Boolean-XOR logic. 

In normal operation, the Operate property determines if the Result property is updated with the final result of the logic operation. Each time the Result property is updated, its value is also copied to the oLogic Object pointed to by the Output property. If the InvertOut property is set to 1, then the value of the Result property is inverted before it is copied.

If the property option "C" is used, then the operation is modified so that this function only occurs once each time an oLogic Object transitions.

oGate Objects can be setup to emulate the functionality of several different integrated circuits such as 7400, 7402, 7404, 7408, 7410, 7420, 7428, 7430, 7475, etc by setting the InvertIn(1-8), InvertOut and Exclusive properties.

Back to top of pageProperty Options:
 The oGate Object has 16 variants which are selected with the property options 2, 3, 4, 5, 6, 7, 8 and C.  
  • 2 specifies that there are 2 inputs. 
  • 3 specifies that there are 3 inputs. 
  • 4 specifies that there are 4 inputs. 
  • 5 specifies that there are 5 inputs. 
  • 6 specifies that there are 6 inputs. 
  • 7 specifies that there are 7 inputs. 
  • 8 specifies that there are 8 inputs. 
  • C specifies that the Clock property is added.
 Continuous
operation
Clocked
operation
  Continuous
operation
Clocked
operation
Single InputoGateoGateC Five InputsoGate5oGate5C
Two InputsoGate2oGate2C Six InputsoGate6oGate6C
Three InputsoGate3oGate3C Seven InputsoGate7oGate7C
Four InputsoGate4oGate4C Eight InputsoGate8oGate8C
Back to top of pageProperties:
 

The following table lists the properties of the oGate Object:

Property

Description

Operate
A value that selects whether or not the Output object is updated with the result of the logic operation.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe logic operation is not performed.
1cvOnThe logic operation is performed.
Input1
Input2
Input3
Input4
Input5
Input6
Input7
Input8
A pointer to an oLogic Object whose value is used as an input to the logic operation. A logic 0 is used if it is not set to point to an oLogic Object.
Object Class: oLogicPtrI Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertIn1
InvertIn2
InvertIn3
InvertIn4
InvertIn5
InvertIn6
InvertIn7
InvertIn8
A value that selects if the Boolean value of the Inputs are inverted before the logical operation is performed.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertInConstantDescription
0cvFalseThe value of oLogic Object pointed to by the corresponding Input property is not inverted.
1cvTrueThe value of oLogic Object pointed to by the corresponding Input property is inverted.
Output
A pointer to an oLogic Object that will be updated with the result of the logic-gate operation.
Object Class: oLogicPtrO Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertOut
A value that selects if the Boolean Result of the logic-gate operation is inverted before it is stored into the Output oLogic Object.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertOutConstantDescription
0cvFalsethe value of the Result property is not inverted before it is copied.
1cvTruethe value of the Result property is inverted before it is copied.
Exclusive
A value that selects if the inputs are exclusive.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
ExclusiveConstantDescription
0cvFalseInputs are not exclusive and the gate performs a logical OR.
1cvTrueInputs are exclusive and the gate performs a logical XOR.
Result
A value that indicates the Boolean result of the gate evaluation. Calculated by ORing (or Exclusive-ORing if the Exclusive property is set to True) together the Boolean values of the inputs and then inverting the result if the InvertOut property was set.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
ResultDescription
0The result of the gate evaluation is Logical Low.
1The result of the gate evaluation is Logical High.
Process
Clock
See Clocked Objects for detail
Object Class: oClockedOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Availability: oGateC and the other oGate object with the "C" property option.
Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Example:

 In the following example, a Virtual Circuit is created that uses the oGate Object to monitor two push button switches on I/O line 9 and 11 and when both are pressed, turn on I/O line 10.
Visual Basic Syntax C and Java Syntax
Dim G As New oGate2
Dim S1 As New oDIO1
Dim S2 As New oDIO1
Dim L As New oDIO1

Sub Main()
  'ooPIC.PullUp = 1
  S1.IOLine = 9
  S1.Direction = cvInput
  S2.IOLine = 11
  S2.Direction = cvInput
  L.IOLine = 10
  L.Direction = cvOutput
  L.Value = 0
  G.Input1.Link(S1)
  G.Input2.Link(S2)
  G.Output.Link(L)
  G.InvertOut = cvTrue
  G.Operate = cvTrue
End Sub
oGate2 G = New oGate2;
oDIO1 S1 = New oDIO1;
oDIO1 S2 = New oDIO1;
oDIO1 L = New oDIO1;

Void Main(Void){
  'ooPIC.PullUp = 1;
  S1.IOLine = 9;
  S1.Direction = cvInput;
  S2.IOLine = 11;
  S2.Direction = cvInput;
  L.IOLine = 10;
  L.Direction = cvOutput;
  L.Value = 1;
  G.Input1.Link(S1);
  G.Input2.Link(S2);
  G.Output.Link(L);
  G.InvertOut = cvTrue;
  G.Operate = cvTrue;
}
Basic Syntax
G Var oGate2(S1,,S2,,L,cvTrue,,cvOn)
S1 Var oDIO1(9,cvInput)
S2 Var oDIO1(11,cvInput)
L Var oDIO1(10,cvOutput)
Back to top of pageRelated Items:
 The following table lists other objects with related functions.
 ObjectDescriptionA1A2B1B2C1
oWire(1-4,C)Copies the value of an oLogic Object to another oLogic Object.xxxxx
oBus(I,O,C)6 Objects that copy one Object's Value to another Objectxxx
Back to top of pageVersion History and Bug List:
 Firmware Ver A1: Introduced.
Firmware Ver B1: Clocking added.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.