This is Gate.h in view mode; [Download] [Up]
//
// Gate
//
// An Objective-C class for simulating digital logic which
// simulates a generic n-input, m-bit gate.
//
#import <objc/Object.h>
#import "Node.h"
@interface Gate : Object
{
//
// Internal State:
//
Bool multiinput;
int numinputs;
int numbits;
bit *temp; // For temporary answer storage.
bit tempbit; // Single temporary bit.
//
// External Interface:
//
Node *IN; // For a single multi-bit input.
id *inputs; // For multiple inputs.
Node *OUT;
}
- initNumBits:(int)nbits // For some number of 1-bit inputs.
in:innode
out:outnode;
- initNumInputs:(int)n // For arbitrary inputs.
inputs:(id *)inparray
numBits:(int)m
out:outnode;
- free;
- (bit)op:(bit)a :(bit)b; // For a given type, replace with function.
- cycle;
@end
//
// End of file.
//These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.