You have 2 coins.
one (A) has probabilities 1/2 for H and 1/2 for T, The other (B) has probabilities (n-1)/n for H and 1/n for T.
You wish to use these 2 coins to simulate a balanced n-faces dice. with a finite and pre-known number of flips.
Is it possible to do so?
If the probabilities where (for example) A = (1/2,1/2), B=(4/5,1/5) and you wished to simulate a 5-faces dice you would roll B, if you got T you would return 4 otherwise you would flip A 2 times and return the binary number you got ( 0 , 1 , 2 or 3 )
But if you had only one coin A=(1/2,1/2) and you wished to simulate a 7-faces dice it's provable that it is not possible
An algorithm is given for simulating a fair die with $n$ sides using two biased coins, one with $p = 1/2$ and one $p = 1/n$, for arbitrary integer $n$ in On Dice and Coins: Models of Computation for Random Generation by Feldman et. al in section 2.1.
The algorithm reproduced here is (with two corrections by me, $\leq$ replaced with $<$):
Where a $1/n$ coin is heads $1/n$ of the time and $d = \lfloor 2^k/(n-1)\rfloor$ and $r = 2^k \bmod n - 1$.