Odd thing to want to do but you build up the number one digit at a time. It comes in from the keyboard as ASCII, so you convert that into a decimal number by ANDing the received serial character with 15.
Then you add it to an accumulator variable. Before you add a new value you multiply the old value by ten.
There is no need to convert this accumulated value into binary as all variables are stored in the computer as binary.