Tristable longitudinal modes of a laser diode for an injection current were observed. Transmitting these laser lights through an Er-doped yttrium aluminum garnet crystal, which has an absorption peak of narrow spectral bandwidth, results in changes in these wavelengths of the laser diode that could be converted into intensity changes and take tristable optical outputs for the same injection current value. It is suggested that an optical inverter and memory could be realized and a new type three-valued logic would be constructed by making use of these phenomena.