constructor(x, y, scope = globalScope, dir = "LEFT", bitWidth = 1) {
        super(x, y, scope, dir, bitWidth);
        /* this is done in this.baseSetup() now
        this.scope['Decoder'].push(this);
        */
        // this.controlSignalSize = controlSignalSize || parseInt(prompt("Enter control signal bitWidth"), 10);
        this.outputsize = 1 << this.bitWidth;
        this.xOff = 0;
        this.yOff = 1;
        if (this.bitWidth === 1) {
            this.xOff = 10;
        }
        if (this.bitWidth <= 3) {
            this.yOff = 2;
        }

        // this.changeControlSignalSize = function(size) {
        //     if (size === undefined || size < 1 || size > 32) return;
        //     if (this.controlSignalSize === size) return;
        //     let obj = new window[this.objectType](this.x, this.y, this.scope, this.direction, this.bitWidth, size);
        //     this.cleanDelete();
        //     simulationArea.lastSelected = obj;
        //     return obj;
        // }
        // this.mutableProperties = {
        //     "controlSignalSize": {
        //         name: "Control Signal Size",
        //         type: "number",
        //         max: "32",
        //         min: "1",
        //         func: "changeControlSignalSize",
        //     },
        // }
        // eslint-disable-next-line no-shadow
        this.newBitWidth = function (bitWidth) {
            // this.bitWidth = bitWidth;
            // for (let i = 0; i < this.inputSize; i++) {
            //     this.outputs1[i].bitWidth = bitWidth
            // }
            // this.input.bitWidth = bitWidth;
            if (bitWidth === undefined || bitWidth < 1 || bitWidth > 32) return;
            if (this.bitWidth === bitWidth) return;
            const obj = new Decoder(
                this.x,
                this.y,
                this.scope,
                this.direction,
                bitWidth
            );
            this.cleanDelete();
            simulationArea.lastSelected = obj;
            return obj;
        };

        this.setDimensions(20 - this.xOff, this.yOff * 5 * this.outputsize);
        this.rectangleObject = false;
        this.input = new Node(20 - this.xOff, 0, 0, this);

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

        // this.controlSignalInput = new Node(0,this.yOff * 10 * (this.outputsize / 2 - 1) +this.xOff + 10, 0, this, this.controlSignalSize,"Control Signal");
    }
@class
Decoder
@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