Email: bknpk@hotmail.com Phone: +972-54-7649119

V

 

ASIC/FPGA Design and Verification Out Source Services

FCS c code for calculating CRC for ETHERNET.

  1. The following calculates the CRC (FCS) for ETHERNET.

  2. to compile type: gcc my_crc_nibble.c.

  3. to run type: ./a.out

  4. Currently no fancy packet reading from file. Just edit the c-source code. The program knows to calculate the packet length.

  5. look for this code in example:
    unsigned int example_packet[] = {
      0x00, 0x10, 0xA4, 0x7B, 0xEA, 0x80, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
      0x08, 0x00, 0x45, 0x00, 0x00, 0x2E, 0xB3, 0xFE, 0x00, 0x00, 0x80, 0x11,
      0x05, 0x40, 0xC0, 0xA8, 0x00, 0x2C, 0xC0, 0xA8, 0x00, 0x04, 0x04, 0x00,
      0x04, 0x00, 0x00, 0x1A, 0x2D, 0xE8, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
      0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11
      //0xE6, 0xC5, 0x3D, 0xB2
    };

  6. How to inspect the results:
    In the trasmit side use the second print
    60 193AC24D E6C53DB2
    In the receive side use the first print and expect the magic number
    64 C704DD7B 38FB2284

  7. The code is in the download area. Look for the file my_crc_nibble.c.gz. or directly download from: crc code

  ...


Home

IP TTL filter: digital design, implemented in VHDL

SD slave with Samsung flash (k9f1208) (vhdl project).


Download Area






Search This Site


Feedback This Site




new pages on this site