The d-wave pairing symmetry in high-critical temperature superconductors makes it possible to realize superconducting rings with built-in pi phase shifts. Such rings have a twofold degenerate ground state that is characterized by the spontaneous generation of fractional magnetic flux quanta with either up or down polarity. We have incorporated pi phase-biased superconducting rings in a logic circuit, a flip-flop, in which the fractional flux polarity is controllably toggled by applying single flux quantum pulses at the input channel. The integration of p rings into conventional rapid single flux quantum logic as natural two-state devices should alleviate the need for bias current lines, improve device symmetry, and enhance the operation margins.