I am looking for a real-time A-law/U-law encoder written in VHDL for implementing in a Lattice XP2 FPGA. The input to the encoder will be 16 bit PCM16, the output will be 8 bit a-law/U-law.
The PCM16input will comprise of 24 channels. The CODEC will have 1 16 bit input. The 2k channels will be fed into the codec sequentially in blocks of 32 16bit samples. The CODEC shall handle a total of 10 Megasamples/second in real time.
Each block of 32 16bit PCM data will be accompanied with a 4 bit channel number 0-23. The 8 bit companded output should have an extra 4 bit output that will hold the channel address that corresponds to the PCM channels from which it was created.
The target FGA is a Lattice XP2-8 but the code will be demonstrated in the Lattice XP5 eval board as attached.