Yeap,
The decimal (octal actually) digits are converted to binary, and the digital string is sent back to the radar site.
0 - 000
1 - 001
2 - 010
3 - 011
4 - 100
5 - 101
6 - 110
7 - 111
i.e. code 7700 is 111111000000, 7500 is 111101000000.
A discussion on mode s transponders just finished, a few external references are in there if you would like further info.