No separate encoder, the altitude info comes from the ADIRU. Going to mode A (code) only sending no C or S data will give you a flag (invalid altitude) not 0'
On changing codes...On the digital controllers with rotary knobs, they continue to squawk the old code until several seconds have passed without a change then switch to the new code. IE is you are squawking 4444 and change the first digit to 6, the transponder squawks 4444 til a few seconds have passed, then squawks 6444, no standby in between.
I never tried to enter 3 digits on a push button one, so I can't say what it would do if you only entered 3 digits, but best guess would be it would disregard the change and continue to squawk the old code.