Bit stuffing in a Crc encoder

Discussion in 'VHDL' started by jpereira, May 25, 2005.

  1. jpereira

    jpereira Guest

    Hi all,
    I am a uni student looking for some help concerning bit stuffing in vhdl.
    The assignment question is:
    Design of a serial transmitter/receiver with CRC-8 error check. The
    on-board memory is used as the source and destination of the data. The PS2
    port on the Digilab board should be used as the synchronous
    transmit/receive port. The mode (TX/RX) should be set by a switch. Another
    switch should be used to activate scrolling and displaying the contents of
    the memory for verification. The CRC-8 polynomial is x8 + x2 + x + 1. The
    frame consists of one byte with frame length followed by data bytes and
    the CRC checksum byte. The transmission speed 1 kbps and bit stuffing
    should be used for frame and byte synchronisation.

    I seemed to have found my way though the crc,transmitter & reciever bits
    with help off the internet but I cant seem to find anything on bit
    stuffing.
    Can one of ya'll genius programmer help me out please cus i really suck at
    this stuff & couldnt have done most of it without help.
    Thanks for your help.
    Can you please email your replies to my mail add.It is

    Thanks a lot.
    Jeremy
    jpereira, May 25, 2005
    #1
    1. Advertising

  2. jpereira

    Guest

    Where exactly is the problem with bit stuffing ?
    Don't you know why to use it or how to implement it ?

    Rgds
    André
    , May 25, 2005
    #2
    1. Advertising

  3. jpereira

    Neo Guest

    bit stuffing is nothing but adding extra bits (usually zeroes) to a
    payload to make it equal to the stated size or min size.
    Neo, May 25, 2005
    #3
  4. jpereira

    mk Guest

    On 25 May 2005 03:11:39 -0700, "Neo" <> wrote:

    >bit stuffing is nothing but adding extra bits (usually zeroes) to a
    >payload to make it equal to the stated size or min size.


    He is talking about bit stuffing for "... synchronization" which
    suggests that he needs to insert bits to cause transitions to streams
    which don't have the minimum number of transitions per byte etc so
    that if you transmit a constant stream of 1s or 0s there will be a
    minimum number of transitions. This is not hard but requires careful
    design/implementation as one needs to accumulate the bits which were
    replaced during the packet and send them at the end of the packet.
    mk, May 25, 2005
    #4
  5. Neo wrote:
    > bit stuffing is nothing but adding extra bits (usually zeroes) to a
    > payload to make it equal to the stated size or min size.
    >


    If you have access to the entire buffer,
    you can use a function like this:

    function stuff_pattern (constant arg_raw : unsigned)
    return unsigned is
    variable arg : unsigned(1 to arg_raw'length) := arg_raw;
    begin
    size:if arg'length < 5 then return arg;
    elsif arg(1 to 5) = "11111" then
    -- return stuff token and the rest:
    return "111110" & stuff_pattern(arg(6 to arg'length));
    else
    return arg(1) & stuff_pattern(arg(2 to arg'length));
    -- return one bit and the rest
    end if size;
    end function stuff_pattern;


    -- Mike Treseler
    Mike Treseler, May 31, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kumar
    Replies:
    8
    Views:
    3,506
    Vikram
    Feb 17, 2004
  2. Mamut

    crc-8 and crc-16 code...

    Mamut, Feb 21, 2007, in forum: C++
    Replies:
    5
    Views:
    4,015
    Victor Bazarov
    Feb 22, 2007
  3. `Zidane Tribal
    Replies:
    1
    Views:
    2,500
    Joe Smith
    Jul 28, 2007
  4. BING BANG
    Replies:
    3
    Views:
    368
    Bill Davy
    Mar 15, 2012
  5. `Zidane Tribal
    Replies:
    3
    Views:
    236
    Sisyphus
    Jul 27, 2007
Loading...

Share This Page