It's really very old technology (40 years?), it's still used for what it was designed (dialing phone numbers) - pretty well anything else was replaced by digital methods decades ago.
MT 8870 is a DTMF tone decoder IC.Yes its a similar project.
When it hears a valid tone pair it starts counting binary & showing by the 4 bits.By this 4 bits its giving input to the micro & detecting what inputs have come.So it can determine which output to be turn on or off.
Yes when you press number 5 it will show b’0101’ from the 8870 outputs. If you connect 4 leds to the output of 8870 you will see the first & the third leds will lights up when you press five.
So we are writing a program inside a microcontroller if this value b’0101’ has come to the micro then turn on the fifth relay.
If you press number 1 then it will display b’0001’ so you tell micro if bit 0 has set then turn on relay one etc……
Can't help you specifically on 8051, but my tutorials show how to do it in PIC assembler - exactly the same principles apply though, no matter what the processor, or language.