//
// Inverter
//
// An Objective-C class for digital logic simulation which
// simulates an n-bit inverter.
//


#import "Inverter.h"


@implementation Inverter


- initNumBits:(int)nbits in:innode out:outnode
{
    [super initNumBits:nbits];
    
    INITDEVTYPE("Inverter");
    
    TESTNODE("IN", innode, numbits);
    TESTNODE("OUT", outnode, numbits);
    
    IN = innode;
    OUT = outnode;
    
    return self;
}


- cycle
{
    int i;
    bit	*indata = [IN getBits];
    
    for(i = 0; i < numbits; i++)
        data[i] = !(indata[i]);

    [OUT setBits:data];

    return self;
}


@end


//
// End of file.
//