Package hw4

Class Multiplexer

  • All Implemented Interfaces:
    IComponent

    public class Multiplexer
    extends AbstractComponent
    Implementation of a single-output multiplexer.
    Author:
    smkautz
    • Constructor Detail

      • Multiplexer

        public Multiplexer​(int k)
        Constructs a multiplexer that uses k bits to select from one of 2^k inputs. The total number of inputs is 2^k + k, where the last k inputs are interpreted as a binary number to select one of the first 2^k inputs to be the output value.
        Parameters:
        k - number of selection bits
    • Method Detail

      • propagate

        public void propagate()
        Description copied from interface: IComponent
        Propagates inputs to outputs. Does nothing if not all inputs are valid.