CRC8 - Byte Wise implementation 
Author Message
 CRC8 - Byte Wise implementation

Hi,
I am trying to design in VHDL a CRC8.  I am looking for a circuit
or pointer to some literature to implement it byte wise rather than
the traditional bit wise implementation.
Any help is appreciated.

Sam

+-----------------------------------------------------------------+
| Sam Bishai                                                      |
| IC Development                                                  |
|                                                                 |

| phone: (613) 763-6646         Dept. 5S31, CRK 040               |
| fax  : (613) 763-3970         P.O. Box 3511 Staton C,          |
|                               Ottawa, Ontario, CANADA K1Y 4H7   |
+-----------------------------------------------------------------+



Sun, 31 Jan 1999 03:00:00 GMT  
 CRC8 - Byte Wise implementation

Quote:

> Hi,
> I am trying to design in VHDL a CRC8.  I am looking for a circuit
> or pointer to some literature to implement it byte wise rather than
> the traditional bit wise implementation.
> Any help is appreciated.

> Sam

> +-----------------------------------------------------------------+
> | Sam Bishai                                                      |
> | IC Development                                                  |
> |                                                                 |

> | phone: (613) 763-6646         Dept. 5S31, CRK 040               |
> | fax  : (613) 763-3970         P.O. Box 3511 Staton C,          |
> |                               Ottawa, Ontario, CANADA K1Y 4H7   |
> +-----------------------------------------------------------------+

We have a program to generate any CRC function you like,
implementing multiple CRC calculation (incremental if you
like) or in a single shot. Please find below the code
for both functions. ps: byte is just unsigned(7 downto 0)
of the Synopsys std_logic_arith package. The polynomial
used is 1+x+x^2+x^8.

  -- Multiple CRC8 with message length 8 bits
  function MultipleCRC8_D8 (D: byte;
                            CRC: byte) return byte;
  -- Multiple CRC8 with message length 8 bits
  function MultipleCRC8_D8 (D: byte;
                            CRC: byte) return byte is
    variable NewCRC: byte;
  begin
    NewCRC(0) := CRC(0) xor CRC(7) xor D(7) xor CRC(6) xor D(6)
                   xor D(0);
    NewCRC(1) := CRC(1) xor D(1) xor CRC(0) xor CRC(6) xor D(6)
                   xor D(0);
    NewCRC(2) := CRC(2) xor D(2) xor CRC(1) xor D(1) xor CRC(0)
                   xor CRC(6) xor D(6) xor D(0);
    NewCRC(3) := CRC(3) xor D(3) xor CRC(2) xor D(2) xor CRC(1)
                   xor CRC(7) xor D(7) xor D(1);
    NewCRC(4) := CRC(4) xor D(4) xor CRC(3) xor D(3) xor CRC(2)
                   xor D(2);
    NewCRC(5) := CRC(5) xor D(5) xor CRC(4) xor D(4) xor CRC(3)
                   xor D(3);
    NewCRC(6) := CRC(6) xor D(6) xor CRC(5) xor D(5) xor CRC(4)
                   xor D(4);
    NewCRC(7) := CRC(7) xor D(7) xor CRC(6) xor D(6) xor CRC(5)
                   xor D(5);
    return NewCRC;
  end MultipleCRC8_D8;

  -- Single CRC8 with message length 8 bits
  function SingleCRC8_D8 (D: byte)
           return byte;
  -- Single CRC8 with message length 8 bits
  function SingleCRC8_D8 (D: byte)
           return byte is
    variable NewCRC: byte;
  begin
    NewCRC(0) := D(7) xor D(6) xor D(0);
    NewCRC(1) := D(1) xor D(6) xor D(0);
    NewCRC(2) := D(2) xor D(1) xor D(6) xor D(0);
    NewCRC(3) := D(3) xor D(2) xor D(7) xor D(1);
    NewCRC(4) := D(4) xor D(3) xor D(2);
    NewCRC(5) := D(5) xor D(4) xor D(3);
    NewCRC(6) := D(6) xor D(5) xor D(4);
    NewCRC(7) := D(7) xor D(6) xor D(5);
    return NewCRC;
  end SingleCRC8_D8;

Kind regards,
Jan

PS: If the polynomial you use is different you can just send
me your polynomial and I'll run it through to give you the
correct functions.
--
===================================================================
Jan Zegers                ===              Easics               ===
General Manager           ===  VHDL-based ASIC design services  ===

Tel: +32-16-298 401         Kapeldreef 60, B-3001 Leuven, BELGIUM
Fax: +32-16-298 319                http://www.easics.com



Sun, 31 Jan 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Byte-wise XOR

2. Wise Installation Software - Reply From Wise re:Clarion Support

3. row-wise versus column-wise arrays

4. Converting Ada objects to Byte streams, independent of compiler implementation

5. A little gift (Hex to Byte/Byte to Hex)

6. I want to generate a CRC (2 bytes) and I have 31 bytes in my frame

7. Byte Array to Byte

8. Bytes at serial port dropping bytes

9. Hi byte and Lo Byte Question

10. high-bytes low-bytes?

11. Reading bytes from a certain offset in order to search for bytes

12. Converting big-endian byte to small-endian byte

 

 
Powered by phpBB® Forum Software