constructor(x, y, scope = globalScope, bitWidth = 8) {
        super(x, y, scope, "RIGHT", bitWidth);
        /* this is done in this.baseSetup() now
        this.scope['Counter'].push(this);
        */
        this.directionFixed = true;
        this.rectangleObject = true;

        this.setDimensions(20, 20);

        this.maxValue = new Node(-20, -10, 0, this, this.bitWidth, "MaxValue");
        this.clock = new Node(-20, +10, 0, this, 1, "Clock");
        this.reset = new Node(0, 20, 0, this, 1, "Reset");
        this.output = new Node(20, -10, 1, this, this.bitWidth, "Value");
        this.zero = new Node(20, 10, 1, this, 1, "Zero");

        this.value = 0;
        this.prevClockState = undefined;
    }
@class
Counter component.
@extends CircuitElement
@param {number} x - x coordinate of element.
@param {number} y - y coordinate of element.
@param {Scope=} scope - Cirucit on which element is drawn
@param {number=} rows - number of rows
@param {number=} cols - number of columns.
Counts from zero to a particular maximum value, which is either
specified by an input pin or determined by the Counter's bitWidth.
The counter outputs its current value and a flag that indicates
when the output value is zero and the clock is 1.
The counter can be reset to zero at any point using the RESET pin.
@category modules