Bit stuffing in a Crc encoder

J

jpereira

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
(e-mail address removed)
Thanks a lot.
Jeremy
 
A

ALuPin

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

Rgds
André
 
N

Neo

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

mk

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.
 
M

Mike Treseler

Neo said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top