An optical device that includes an input region, an output region, and an
arrayed waveguide grating between the input region and the output region
is presented. The input region includes a first input waveguide set and a
second input waveguide set, and the output region includes a first output
waveguide set and a second output waveguide set. The arrayed waveguide
grating is shared by the signals that travel from the input region to the
output region. The device is capable of simultaneously functioning as a
multiplexer and a demultiplexer, thereby reducing the cost and complexity
of a dual-function optical device. Where the arrayed waveguide grating is
used for multiplexing, the optical device receives demultiplexed input
signals and generates a multiplexed signal. Where the arrayed waveguide
grating is used for demultiplexing, the optical device receives a
multiplexed input signal and generates a set of demultiplexed signals.