Class OutputPin


  • public class OutputPin
    extends BasePin
    Wraps a CircuitSim output Pin component and provides a convenience method for setting its value.
    • Constructor Detail

      • OutputPin

        public OutputPin​(com.ra4king.circuitsim.simulator.components.wiring.Pin pin,
                         Subcircuit subcircuit)
        Creates a new OutputPin which wraps the provided Pin component and which lives in the provided Subcircuit.
        Parameters:
        pin - Pin component to wrap
        subcircuit - where this pin lives
        See Also:
        BasePin(Pin, Subcircuit)
    • Method Detail

      • get

        public int get()
        Returns the current value of this output pin. Does not sign extend (see getSext() for that).
        Returns:
        value of this pin
        Throws:
        IllegalStateException - If any bit is floating
        See Also:
        getSext()
      • getSext

        public int getSext()
        Returns the current value of this output pin sign-extended to 32 bits.
        Returns:
        value of this pin sign-extended to 32 bits
        Throws:
        IllegalStateException - If any bit is floating
        See Also:
        get()