Is there no 4 bit identity comparator in TTL or CMOS? It could fit into a DIP-12 package as all it would have is 4 XOR gates for selectable invesion and 1 4-way AND gate.
OUT := (A1 xor B1) and (A2 xor B2) and (A3 xor B3) and (A4 xor B4)
Just 11 pins with Vcc and GND. Could even have both OUT and (not OUT) for easy (not CS) or (nor LOAD) application.
The comparators I know, 74LS85 being the smallest, comes in a DIP-16 package and has A < B and A > B outputs which I don't need.
I am building a TTL or CMOS mini-computer from scratch. I have a bus and various modules can be addressed on that bus using 3 or 4 module address lines. Now each module listens to these 3 or 4 lines with a comparator to find out if their address is called. I have seen this principle on ISA bus cards where they use 74LS688, but that's for 8 bit.
I'm just trying to save space. I went down the entire 7400 list and 4000 list, so I know it's not there.