目录摘要··············································································································IAbstract·············································································································II1引言··············································································································12QuartusII与VHDL简介················································································32.1VHDL语言简介·········································································································32.2QuartusII软件介绍····································································································33海明码编译码器的原理··············································································53.1海明码编码基本原理·······························································································53.1.1编码基本原理·······················································································································53.1.2生成矩阵·······························································································································53.2海明码译码基本原理·······························································································73.2.1监督矩阵································································································································73.2.2校验子(伴随式)······················································································································73.2.3译码原理·······························································································································74海明码编译码器的程序设计与仿真··························································94.1编码器设计与仿真····································································································94.1.1编码器程序设计····················································································································94.1.2编码器程序仿真··················································································································104.2译码器设计与仿真··································································································114.2.1译码器程序设计··················································································································114.2.2译码器程序仿真··················································································································115编译码器的硬件设计与测试·····································································135.1编译码器的硬件设计思路······················································································135.2编译码器的硬件设计······························································································145.3硬件测试··················································································································145.3.1测试预期情况······················································································································145.3.2实际硬件测试情况··············································································································156结论·············································································································16致谢················································································································17附录:············································································································19摘要海明码是一种可以纠正差错的编码。海明码编译码器是最为常用的数字通信内部器件之一,它被广泛地应用在网络传输、存储器校验纠错以及数据安全中。本课题海明码编译码器的设计,要求掌握使用仿真调试软件QuartusII以及硬件描述语言VHDL,学习掌握海明码理论知识,了解海明码的各种特点,掌握海明码的编码原理和译码原理,对其进行理解和分析,设计其实现的算法,并且完成基于FPGA的软件QuartusII的VHDL语言编程和仿真实现;同时根据需要,选择FPGA的芯片和外围元器件,设计硬件原理图并绘制PCB板图,最后制作出硬件实体,将理论和实践结合,掌握数字系统的设计方法。关键词:海明码;编译码器;FPGA;VHDL;数字系统设计;IAbstractHammingcodeisakindofcodewhichisabletocorrecterrors.Hammingcodecodecisonekindofthemostcommonlyuseddevicesindigitalcommunications,whichiswidelyusedinnetworktransmission,memoryparityerrorcorrectionanddatasecurity.ThedesignofHammingcodecodecinthisproject,itrequiresbasictheoreticalknowledgeofhammingcode,andlearnhowtousethesimulationanddebuggingsoftwareQuartusIIaswellasthehardwaredescriptionlanguageVHDL,andunderstandthevariousfeaturesofHammingcodestomastertheprincipleofcodinganddecoding,thentounderstandandanalyze,designitsalgorithmimplementation,andcompletetheVHDLlanguageprogrammingandsimulationonFPGA-basedsoftwareQuartusII;inthemeantime,accordingtoitsrequirement,selectaFPGAchipandexternalcomponents,designthehardwareschematicdiagramandtheblueprintofPCBboard,finallycreatethehardwareentity,combinethetheorywithpracticesothattheycanmasterthedesignmethodofdigitalsystems.KeyWords:Hammingcode;codec(encoder&decoder);FPGA;VHDL;digitalsystemdesign;II海明码编解码器设计1引言海明码(HammingCode)是纠错编码中的一种,由Bell实验室的海明(R.W.Hamming)提出,当计算机存储或移动数据时,可能会产生数据位错误,这时可以利用海明码来检测并纠错,简单的说,海明码是一个错误校验码码集,一种能纠正单个随机错误的线性分组码,用以改善计算机和数字信道通信安全性和可靠性的一种信号处理方法。目前海明码已经广泛应用于对计算机的主存储器、只读存储器和数字通信系统的数据进行校验,它可实现纠正单错、检出双错的功能。很多情况下,需要将采