"With computer technology, shouldn't the original code be okay the whole flight?"
The ATC computer system isn't as high tech as one would assume.
There are only 3076 transponder codes for use. There are more than that many airplanes in the air with an ATC assigned code at the same time. The law of averages means somewhere along the line, 2 airplanes with the same code will be within range of the same radar and be in conflict.
To expand you have 0-7, or 8 digits possible per number, 8x8x8x8 = 4096
In regards to the 4 code. Each facility is assigned a range of codes; internal primary, internal secondary, internal tertiary, external primary, external primary, and external tertiary. Have a look at this PDF and tell me if the codes you usually are assigned are in the respective range of codes of your ARTCC. These are the ones allocated to each center on VATSIM, and I've often wondered if they have any real world similarity.
No, they are different codes. 0010 is different and distinguishable from 0100.Hmm, okay, that makes sense. Okay, I was never great at math, so dumb question. Doesn't the 8x8x8x8 rule mean that you will have no two combinations with the same digits no matter how they are ordered? Meaning 0001 is not distinguished from 0010 or 0100 or 1000?
I guess I was thinking if you went through starting with 0001, then 0002, 0003, 0004..... all the way through 7777 (don't know why I was thinking 7799 earlier), then wouldn't you have 7777 codes minus the reserved ones?