A ternary variable can assume the values $0,1$ or $2,$ and can be coded with two binary bits as $00,01$ and $10$ respectively. A ternary full-adder has three ternary digits $X, Y$ and a carry-in $C_{in}$ as inputs, and produces the ternary sum $S\;($base $3)$ and the ternary carry-out $C_{o}.$ For example, if $X=(2)_{3}, Y=(2)_{3}$ and $C_{in}=(1)_{3},$ then $S=(2)_{3}$ and $C_{o}=(1)_{3}.$ Design a circuit for this ternary full adder using binary gates as well as binary half and full adders.