constructor(x, y, scope = globalScope, dir = "RIGHT", bitWidth = 1) {
        super(x, y, scope, dir, bitWidth);
        /* this is done in this.baseSetup() now
        this.scope['PriorityEncoder'].push(this);
        */
        this.bitWidth = bitWidth || parseInt(prompt("Enter bitWidth"), 10);
        this.inputSize = 1 << this.bitWidth;

        this.yOff = 1;
        if (this.bitWidth <= 3) {
            this.yOff = 2;
        }

        this.setDimensions(20, this.yOff * 5 * this.inputSize + 10);
        this.rightDimensionX += 10;
        this.directionFixed = true;
        this.rectangleObject = false;

        this.inp1 = [];
        for (let i = 0; i < this.inputSize; i++) {
            const a = new Node(
                -10,
                +this.yOff * 10 * (i - this.inputSize / 2) + 10,
                0,
                this,
                1
            );
            this.inp1.push(a);
        }

        this.output1 = [];
        for (let i = 0; i < this.bitWidth; i++) {
            const a = new Node(
                30,
                +2 * 10 * (i - this.bitWidth / 2) + 10,
                1,
                this,
                1
            );
            this.output1.push(a);
        }

        this.enable = new Node(
            10,
            20 + this.inp1[this.inputSize - 1].y,
            1,
            this,
            1
        );
    }
@class
PriorityEncoder
@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 {string=} dir - direction of element
@param {number=} bitWidth - bit width per node.
@category modules