Class NonStrictThreeBitAdder

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class NonStrictThreeBitAdder
    extends TypedAtomicActor
    A nonstrict three-bit adder. This adder has one input port, which is a multiport, and two output ports, which are single ports. All of the ports are of type int, and inputs are outputs are single bits. An exception is thrown if a number other than 0 or 1 is received as an input, or if there are not exactly three channels connected to the input port. This actor adds the three input bits, and outputs the result to the lowBit and highBit ports. Only two of the inputs must be known for highBit to be determined. All inputs are necessary for lowBit to be determined. An absence of a token is considered to have no contribution to the sum (same as value the zero). If no input tokens are available at all, then no output is produced.
    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Paul Whitaker
    Pt.AcceptedRating:
    Red (pwhitake)
    Pt.ProposedRating:
    Red (pwhitake)
    • Field Detail

      • inputBits

        public TypedIOPort inputBits
        Inputs for bits to be added. The types are integer, and only ones and zeros are expected.
      • highBit

        public TypedIOPort highBit
        Output for the high bit. The type is integer, and only ones and zeros will be sent.
      • lowBit

        public TypedIOPort lowBit
        Output for the low bit. The type is integer, and only ones and zeros will be sent.