Demultiplexor Chip

Abstraction and Implementation of Demultiplexor Chip in Hardware Design Language and Java™.

Demultiplexor (DMux)

A Demultiplexor performs the opposite function of a Multiplexor.

It takes a single input and channels it to one of two possible outputs according to a selector bit that specifies which output to chose.

Implementation of Demultiplexor Chip in HDL

You can create Demultiplexor Chip in the similar way as Multiplexor Chip.

Unlike Multiplexor Chip, Demultiplexor Chip has two outputs and one input.

CHIP DMux {
    IN in, sel;
    OUT a, b;

    PARTS:
    Not(in=sel, out=notsel);
    And(a=in, b=notsel, out=a);
    And(a=sel, b=in, out=b);
}

Implementation of Demultiplexor Chip in Java™

Similar to the Implementation in HDL

package CombChips;

class DMux_Gate extends And_Gate {

    protected static int[] DMux(int in, int sel) {
        int[] out = new int[16];
        out[0] = And(in, Not(sel));
        out[1] = And(in, sel);
        return out; 
    }
}

Last updated