提出了一种基于FPGA的验光仪的数据实时无损压缩系统,采用LZW算法。首先通过对比分析常用数据无损压缩算法的特点得出LZW算法在实时性、实现复杂度、所需的存储容量、算法的压缩效果和适用的场合方面都有不错的特点,因此以它作为硬件实现的算法。此数据实时无损压缩系统由数据实时无损压缩硬件电路、测试软件、解压软件与读数软件组成,其中数据实时无损压缩硬件电路由数据采集、数据压缩、控制单元、数据存储、电源管理等几部分组成,核心器件是FPGA,利用FPGA芯片内部的RAM资源构成输入数据的缓存器以及LZW算法所需的2个字典存储器,并结合有利于硬件实现的字典管理策略完成了实时无损压缩,同时FPGA还负责对模数转换器、闪存的控制等功能。结果表明该方案所占逻辑资源较少、可移植性强、功能扩展容易,数据的存储和传输效率提高了20%,成本降低了13%。 Abstract: The real-time data nondestructive compression system of optometry instrument based on FPGA was presented, it adopted LZW algorithm. First, through comparison and analyzing the characteristic of common data, it obtained that the LZW algorithm had good characteristics in real time and realization suitable occasion and the compressed effect of complex degree, the memory capacity of requirement, therefore, it was used as the algorithm. This data nondestructive compressed system of real time was composed by hardware circuit and test software and decompression software and reading software, the data nondestructive compressed hardware circuit of real time was composed by data collection, data compression, control unit data storage and the management of power source, key device is FPGA, using the built-in RAM resource of FPGA chip, forms the 2 slow dictionary memories of data-in needed for storing ware as well as LZW algorithm, and the dictionary management strategy combined is helpful for hardware to realize the real-time nondestructive compression, at the same time, FPGA still takes the responsibility for modulus converter, control t store of dodge. The results show that the system takes little logic resource, has strong transplantability, easy function development, data stock and transmit efficiency have raised 20%, cost has reduced 13%.