ftp.nice.ch/pub/next/developer/resources/classes/CompSim.s.tar.gz#/CompSim/IndexRegister.h

This is IndexRegister.h in view mode; [Download] [Up]

//
// IndexRegister
//
// An Objective-C class for a register with the ability to load,
// increment and decrement.
//
// Operation: LOAD loads the register from the input, INC increments the
// current register value and DEC decrements the current value. These
// operations are exclusive, but the logic doesn't handle this (if more
// than one of LOAD, INC or DEC is high, then the operation is undefined).
// the register asserts its output on OUT.
//


#import <objc/Object.h>
#import "Register.h"
#import "Incrementor.h"
#import "Decrementor.h"
#import "MUX.h"
#import "Node.h"
#import "ORGate.h"
#import "Merger.h"
#import "One.h"


@interface IndexRegister : Object


{
    //
    // Internal State:
    //
    
    int		numbits;
    
    //
    // External interface:
    //
    
    Node	*LOAD;					// 1-bit LOAD signal.
    Node	*INC;					// 1-bit INC signal.
    Node	*DEC;					// 1-bit DEC signal.
    Node	*IN;					// n-bit input.
    Node	*OUT;					// n-bit output.
    
    //
    // Internal glue nodes:
    //
    
    Node		*inc_out;			// Output of the incrementer.
    Node		*dec_out;			// Output of the decrementer.
    Node		*mux_out;			// Internal data bus.

    Node		*sel_low_out;
    Node		*sel_high_out;    
    
    //
    // Internal Functional Units:
    //
    
    MUX			*mux;
    Merger		*merge_sel;
    ORGate		*sel_low;
    ORGate		*sel_high;
    One			*reg_load;
    
    Incrementor		*reg_inc;			// Incrementer module.
    Decrementor		*reg_dec;			// Decrementer module.
    Register		*reg;				// Actual register.
}


- initNumBits:(int)nbits
	load:loadnode					// Node with LOAD signal.
	inc:incnode					// Node with INCREMENT signal.
	dec:decnode					// Node with DECREMENT signal.
	in:innode					// Node giving input.
	out:outnode;					// Node accepting output.
- free;

- cycle;

- reg;


@end


//
// End of file.
//

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.