Here is some information that may help you.
Bipolar
74 - the "standard TTL" logic family had no letters between the "74" and the specific part number.
74L - Low power (compared to the original TTL logic family), very slow
H - High speed (still produced but generally superseded by the S-series, used in 1970s era computers)
S - Schottky (obsolete)
LS - Low Power Schottky
AS - Advanced Schottky
ALS - Advanced Low Power Schottky
F - Fast (faster than normal Schottky, similar to AS)
The "P" on the HD74LS02p is for the package type
The "N" on the SN74F02N is for the package type
The two (or sometimes three letter prefix) indicates the manufacturer of the device (e.g. SN for Texas Instruments)
Hope this helps you out