i want to interface spi and i2c adc with spartan 3e and help me how to write code for adc interfacing fpga with this i have attached data sheets of adc
Some companies design ADC and DAC kits which includes the FPGA design software and hardware. You have to pay to buy this complete solution which is ideal if you research or application work is on a high level. If you need to work with the parts you mentioned and if there is no kit associated with these parts, you will have to design the interface. In this scenario, there are two options:
a) You can save a lot of time by buying the Xilinx System addition which has a EDK in it which you may find very useful. I noticed Spartan 3E fabric supports MicroBlaze microprocessor implementation. A single software license was around $5k last time I remember. With this setup, your job becomes that of a system integrator. All you are doing is building a system by pulling components like SPI and I2C from a pre-defined library that has all hardware and software ready to use. Most of time will be spent in interfacing various blocks and writing top level C code for the MicroBlaze.
b) The cheapest way is the most difficult obviously where you build the entire interface grounds up using RTL. This requires you to have intimate knowledge of the interface between the ADC and the FPGA with proper signaling protocal. Plus, you need to figure out how to put a micro controller in the midst of things if needed.
Obviously, I have skipped a lot of info here. Hopefully one of these options will get you going towards your final goal in the desired time frame.
Maybe you can benefit from ready-made cores/modules as they can be downloaded for example at http://opencores.com/ . In That case you may integrate a SPI and/or I2C module and access it from the top-level using a finite-state-machine (fsm). You may have to use additional wait-states in your fsm in order to meet the timing- requirements.