Squawk Codes
Squawk, or better yet, transponder codes are indeed pulse code modulated. In the standard FAA Mode A (military mode 3/A), the ground based secondary radar (sometimes referred to as the IFF/SIF system) sends out a series of pulses that are timed to trigger specific responses from the aircraft transponder. In the case of a squawk code assigned by an air traffic controller, the pilot dials the four octal digits into a box in his instrument panel. The transponder then will respond to the correct pulse-timed interrogations on 1030 MHz, with a pulse coded reply on 1090 MHz. In almost all cases, the ground based radar interrogates more than one mode at a time, using an interlaced set of pulses. In the case of the simple mode (not more modern Mode S) interrogation, the radar usually requests mode 3/A and mode C. Usually in a train like 3/A, 3/A, C, then repeating. Mode C is the aircraft altitude, in a different code, called a Gray code, that represents the uncorrected barometric altitude of the plane. You can Google Gray codes to find out what is so special about it.
Anyway, I've made a short story long, but in any case, the squawk code is usually assigned by air traffic control, unless the aircraft is flying under Visual Flight Rules, in which case the code would be 1200.
Hope that helped (I spent about 15 of my 22 years in the U.S. Air Force maintaining air traffic control radar).
Edit: Take a look at this link:
http://www.airsport-corp.com/modec.htm
73,
Greg