In general you should need to query the $3$-valued generator fewer times than the number of bits you want to produce, since the amount of entropy per query is $\log(3)/\log(2)=1.58496...$ bits. However, since $\log(3)/\log(2)$ is irrational, there's no finite number of queries that can be converted into a fixed number of bits. The best you can do is keep the rounded-off randomness and save it for later use, as follows:
Start with $(x,w)=(0,1/3)$.
Let $(x,w)=(x+aw,w/3)$, where $a=0,1,2$ with equal probability (using the $3$-valued generator).
Repeat these checks as long as one passes:
(a) If $x\ge 1/2$, output "$1$", then let $(x,w)=(2x-1,2w)$; or (b) if $x+3w<1/2$, output "$0$", then let $(x,w)=(2x,2w)$.
Return to step 2.
What this does is generate the successive ternary digits of a real number in $[0,1)$, and outputs each binary digit of the same real number as soon as it is known for certain. This is essentially arithmetic coding, and of course it can be used for any two bases.