button 1 and button 2 are inputs (connect buttons to them) then there are three outputs. one of them is on based on the current state.
if the state is 0 or 2, sending signal to button 1 input will set the state to 1, othewise it will set it to 0.
if the state is 0 or 1, sending signal to button 2 input will set the state to 2, othewise it will set it to 0.
i made this because i was recreating PGA33X6 from shenzen io and the component in shenzen io has buttons where only one of them can be turned on or both can be turned off. this circut makes two buttons behave the exact same way.