Harware implementation of data compression and error control techniques