TOPS and TRUST are different systems fulfill nearly the same job, TOPS is the registry system, and can be accessed through itself, TRUST is a system that uses TOPS I believe and presents the information differently.
To take a basic headcode (the full ones are far longer) you have the following:
EG: 1V43
The first digit is the train class, this can be 0,1,2,3,4,5,6,7,8,9.
0 = light engine, 1 = express passenger, 2 = normal passenger, 3 = parcels, fast ECS, 4 = 75 mph freight (sometimes 60 mph restricted intermodals too), 5 = Empty coaching stock (ECS), 6 = 60 mph freight, 7 = 45 mph freight, 8 = 25 mph freight 9 = Eurostar or priority Virgin Voyager.
Second digit usually relates to destination, for local and regional workings, this tends to be set according to specific destinations within the region. For interegional trains you get things like:
A = London from within region or out of region
B = as A
E = interegional train to Eastern Region of BR
M = Interegional train to London Midland Region of BR
O = Interegional train to Southern Region of BR
S = Interegional train to Scottish Region of BR
V - Interegional Train to Western Region of BR
and there are others too.
The final two digits usually relate to the order of the train going to the destination its heading to (really poor explanation, but there you go)