⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 efg's mathematics projects -- crc calculator.htm

📁 CRC16的源程序
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0060)http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/CRC.htm -->
<HTML><HEAD><TITLE>efg's Mathematics Projects -- CRC Calculator</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY 
background="efg's Mathematics Projects -- CRC Calculator.files/Background.gif" 
tppabs="http://www.efg2.com/Lab/Background.gif">
<DIV align=center>
<CENTER>
<TABLE border=0>
  <TBODY>
  <TR>
    <TD><FONT face=Arial color=#0000ff size=6><EM><A 
      href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/index.html" 
      tppabs="http://www.efg2.com/Lab/index.html"><IMG height=44 
      src="efg's Mathematics Projects -- CRC Calculator.files/efglab.jpg" 
      width=300 border=0 
      tppabs="http://www.efg2.com/Lab/WebGraphics/Buttons/efglab.jpg"></A></EM></FONT></TD>
    <TD></TD>
    <TD><A 
      href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/index.html" 
      tppabs="http://www.efg2.com/Lab/Mathematics/index.html"><FONT face=Arial 
      size=6>Mathematics</FONT></A></TD></TR></TBODY></TABLE></CENTER></DIV>
<DIV align=center>
<CENTER>
<TABLE border=0>
  <TBODY>
  <TR>
    <TD><A 
      href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/CRCDelphi.ZIP" 
      tppabs="http://www.efg2.com/Lab/Mathematics/CRCDelphi.ZIP"><IMG height=32 
      alt="Crc.gif (968 bytes)" 
      src="efg's Mathematics Projects -- CRC Calculator.files/Crc.gif" width=32 
      border=0 tppabs="http://www.efg2.com/Lab/Mathematics/Crc.gif"></A></TD>
    <TD></TD>
    <TD><A 
      href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/CRCDelphi.ZIP" 
      tppabs="http://www.efg2.com/Lab/Mathematics/CRCDelphi.ZIP"><FONT 
      face=Arial size=6>Cyclic Redundancy Code Calculator</FONT></A><FONT 
      face=Arial size=6>&nbsp;</FONT></TD>
    <TD></TD>
    <TD><FONT face=Arial size=6><I>Lab 
Report</I></FONT></TD></TR></TBODY></TABLE></CENTER></DIV>
<DIV align=center>
<CENTER>
<TABLE border=0>
  <TBODY>
  <TR>
    <TD align=middle colSpan=3><STRONG>Calculate CRCs of Character Strings 
      using a CRC Calculator<BR></STRONG><SMALL>(Also see the <A 
      href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/FileCheck.htm" 
      tppabs="http://www.efg2.com/Lab/Mathematics/FileCheck.htm">FileCheck</A> 
      Lab Report for CRCs of Files, Directories, Volumes)</SMALL></TD></TR>
  <TR>
    <TD></TD>
    <TD align=middle><A 
      href="http://plum.ia.polsl.gliwice.pl/~DIP/efg/Mathematics/CRCDelphi.ZIP" 
      tppabs="http://www.efg2.com/Lab/Mathematics/CRCDelphi.ZIP"><IMG height=236 
      alt="ScreenCRCCalc.jpg (17211 bytes)" 
      src="efg's Mathematics Projects -- CRC Calculator.files/ScreenCRCCalc.jpg" 
      width=380 border=0 
      tppabs="http://www.efg2.com/Lab/Mathematics/ScreenCRCCalc.jpg"></A></TD>
    <TD></TD></TR></TBODY></TABLE></CENTER></DIV>
<P align=left><FONT size=4><STRONG>Purpose<BR></STRONG></FONT><FONT size=3>The 
purpose of the <EM>CRCCalculator</EM> is to display interactively the CRC-16 and 
CRC-32 values for a specified string.&nbsp; (The CRC-32 values will match those 
computed by PKZIP.)</FONT></P>
<P align=left><FONT size=3>Additional files, <EM>CRC16Dem</EM> and 
<EM>CRC32Dem</EM>, show how to create a command-line program to calculate CRC 
values. &nbsp; A "C" command-line program is also available.</FONT></P>
<P align=left><FONT size=4><STRONG>Materials and Equipment</STRONG></FONT></P>
<BLOCKQUOTE>
  <P align=left><FONT size=4><STRONG>Software 
  Requirements<BR></STRONG></FONT><FONT size=3>Windows 95/98<BR>Delphi 3/4/5 (to 
  recompile)</FONT></P>
  <P align=left><FONT size=4><STRONG>Hardware 
  Requirements<BR></STRONG></FONT>VGA display</P></BLOCKQUOTE>
<P align=left><FONT size=4><STRONG>Procedure</STRONG></FONT></P>
<OL>
  <LI>Double click on the <EM>CRCCalculator.EXE</EM> icon to start the program. 
  <LI>Enter any text in the edit box. 
  <LI>Observe the CRC-16 and CRC-32 values in decimal or hexadecimal. </LI></OL>
<P align=left><FONT size=4><STRONG>Expected Values</STRONG></FONT><BR>Hex values 
do not change by version of Delphi, but the decimal values are intended to be 
unsigned.&nbsp; CRC-16 values have always been unsigned, but since there was no 
4-byte unsigned integer in D1-D3, the decimal values are signed for the CRC-32 
until the Delphi 4 version. </P>
<DIV align=center>
<CENTER>
<TABLE border=1>
  <TBODY>
  <TR>
    <TD align=middle rowSpan=2>&nbsp;
      <P><STRONG>Test String</STRONG></P></TD>
    <TD align=middle colSpan=2><STRONG>CRC-16</STRONG></TD>
    <TD align=middle colSpan=2><STRONG>CRC-32</STRONG></TD>
    <TD align=middle rowSpan=2>&nbsp;
      <P><STRONG>Comments</STRONG></P></TD></TR>
  <TR>
    <TD align=middle><STRONG>Decimal</STRONG></TD>
    <TD align=middle><STRONG>Hex</STRONG></TD>
    <TD align=middle><STRONG>Decimal</STRONG></TD>
    <TD align=middle><STRONG>Hex</STRONG></TD></TR>
  <TR>
    <TD align=middle>&lt;null string&gt;</TD>
    <TD align=right>0</TD>
    <TD align=right>0000</TD>
    <TD align=right>0</TD>
    <TD align=right>00000000</TD>
    <TD align=right>Delphi 2/3/4/5</TD></TR>
  <TR>
    <TD align=middle>abc</TD>
    <TD align=right>38712</TD>
    <TD align=right>9738</TD>
    <TD align=right>891568578</TD>
    <TD align=right>352441C2</TD>
    <TD align=right>Delphi 2/3/4/5</TD></TR>
  <TR>
    <TD align=middle rowSpan=2>ABC</TD>
    <TD align=right rowSpan=2>17697</TD>
    <TD align=right rowSpan=2>4521</TD>
    <TD align=right>-1551695032</TD>
    <TD align=right rowSpan=2>A3830348</TD>
    <TD align=right>Delphi 2/3</TD></TR>
  <TR>
    <TD align=right>2743272264</TD>
    <TD align=right>Delphi 4/5</TD></TR>
  <TR>
    <TD align=middle>This is a string</TD>
    <TD align=right>19524</TD>
    <TD align=right>4C44</TD>
    <TD align=right>141976383</TD>
    <TD align=right>0876633F</TD>
    <TD align=right>Delphi 2/3/4/5</TD></TR></TBODY></TABLE></CENTER></DIV>
<P align=left>The CRC-32s of the files <EM>abcLower.TXT</EM>, 
<EM>ABCupper.TXT</EM>, and <EM>ThisIsAString.TXT</EM> in the 
<EM>CRCDelphi.ZIP</EM> file match the values above, which are also verified in 
the <EM>CRC32Dem.PAS </EM>command line program:</P>
<DIV align=center>
<CENTER>
<TABLE border=0>
  <TBODY>
  <TR>
    <TD width="100%"><FONT face="Courier New">CRC-32&nbsp;&nbsp;&nbsp; Bytes 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; F i l e n a m e<BR>-------- 
      -------- 
      ------------------------<BR>352441C2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      3 abcLower.TXT<BR>A3830348&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 
      ABCUpper.TXT<BR>0876633F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 
      ThisIsAString.TXT </FONT></TD></TR></TBODY></TABLE></CENTER></DIV>
<P align=left><FONT size=4><STRONG>Discussion<BR></STRONG></FONT>CRC values, 
especially the CRC-32, are an extremely good way to verify the integrity of a 
file.&nbsp; If the CRC-32 for a file stays the same, there is only an extremely 
small probability that the file has been changed -- about 1 in 4 billion. &nbsp; 
CRCs could be used as a preliminary verification tool to find identical files. 
&nbsp; If the CRCs of two files do not match, the file are not the same.&nbsp; 
This could even be used to compare image files.</P>
<P align=left>The "hardware" method of computing CRCs involves bit 
manipulations, which is very inefficient for a software computation.&nbsp; 
Instead of computing the CRC bit-by-bit, a 256-element lookup table can be used 
to perform the equivalent of 8 bit operations at a time.&nbsp; (This is 
described in "Byte-wise CRC Calculations" in <EM>IEEE Micro</EM>, June 1983, pp. 
40-50.)&nbsp; </P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -