I have a Hex file for a PIC16f877a. Its a simple ADC. But i do not have the original Source code. I have the Hex file. I wanted to know what is the smallest PIC can i use to program the hex file to and it will work?
The smallest possible PIC depends on hex file size. If it's just a simple ADC as you say, than I think every PIC will hold the program. Just choose the smallest package with ADC that satisfy your pinout needs... check the microchip site.
Google for 'PIC Disassembler'. It will convert your hex file to an assembler source code.
You might need to tweak the code a bit... like address change to used registers....