Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > bit stuffing

Reply
Thread Tools

bit stuffing

 
 
blackpadme
Guest
Posts: n/a
 
      08-24-2008
Hi,

I'm trying to code a bit stuffing entity with serial input/output
(i.e. input="1", then output = "10", input="0", then output "00"), all
synchronized by clock. At the moment i only know the following
options:

1. Use rising and falling edge of the clock to output 2 bits (original
bit and stuff bit) in one period -> Not synthetizable
with Xilinx.
2. Use a FSM with an internal buffer where input is stored. In that
case how I can avoid buffer overflow if i don't know the input
lengtht?

Please tell me if someone have some ideas about how to implement
serial bit stuffing in vhdl.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Muzaffer Kal
Guest
Posts: n/a
 
      08-25-2008
On Sun, 24 Aug 2008 14:17:47 -0700 (PDT), blackpadme
<(E-Mail Removed)> wrote:

>Hi,
>
>I'm trying to code a bit stuffing entity with serial input/output
>(i.e. input="1", then output = "10", input="0", then output "00"), all
>synchronized by clock. At the moment i only know the following
>options:
>
>1. Use rising and falling edge of the clock to output 2 bits (original
>bit and stuff bit) in one period -> Not synthetizable
>with Xilinx.
>2. Use a FSM with an internal buffer where input is stored. In that
>case how I can avoid buffer overflow if i don't know the input
>lengtht?
>
>Please tell me if someone have some ideas about how to implement
>serial bit stuffing in vhdl.
>
>Thanks in advance.


The first option is not only synthesizable but also unusable because
you will change the bit rate at the output. Someone has to consume the
extra bit and that someone probably be running on a single edge of the
clock only.

You should use the second option and implement flow control at the
input. This means you have to tell the producer of the bits you don't
have any more buffer space to accept incoming data. Then you can have
a fixed size buffer, fill it up with extra bits and when it's full
stop incoming data and send what you have accumulated already. Another
option is to find out the maximum size of the transmission data (ie
packet size) and size your buffer to that and send all the accumulated
stuffed bits at the end.
What is your actual application? I have implemented bit-stuffing and
other protocol management functions for a variety of serial
interfaces. If you can tell me what yours is, I maybe able to help
more.

Kal
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      08-25-2008
blackpadme wrote:

> I'm trying to code a bit stuffing entity with serial input/output
> (i.e. input="1", then output = "10", input="0", then output "00"), all
> synchronized by clock.


This makes no sense unless it is a homework problem.
Serial bit stuffing is used by an hdlc or usb transmitter
to packetize data. Just inserted a zero after every bit
has no obvious application.
http://groups.google.com/groups/sear...it+stuffing%22

> 2. Use a FSM with an internal buffer where input is stored. In that
> case how I can avoid buffer overflow if i don't know the input
> length?


Packetize the data.

-- Mike Treseler
 
Reply With Quote
 
Thomas Stanka
Guest
Posts: n/a
 
      08-25-2008
On 24 Aug., 23:17, blackpadme <(E-Mail Removed)> wrote:
> I'm trying to code a bit stuffing entity with serial input/output
> (i.e. input="1", then output = "10", input="0", then output "00"), all
> synchronized by clock. At the moment i only know the following
> options:
>
> 1. Use rising and falling edge of the clock to output 2 bits (original
> bit and stuff bit) in one period -> Not synthetizable
> with Xilinx.


It is, if properly done. But what will you do with the gained DDR
data? You do such a thing typically only on output pins of your
device. The problem is something that requires no fpga designer in the
first place but a system designer. You should first clarify the input
and output (frequency, packet or stream,...) that your device need to
produce, before you could start with fpga design.

> Please tell me if someone have some ideas about how to implement
> serial bit stuffing in vhdl.


This task is generally spoken impossible without further constraining
of the requirements.

bye Thomas


 
Reply With Quote
 
Pieter Hulshoff
Guest
Posts: n/a
 
      08-25-2008
Hello,

> I'm trying to code a bit stuffing entity with serial input/output
> (i.e. input="1", then output = "10", input="0", then output "00"), all
> synchronized by clock.


I have trouble seeing an application for this, but ok. If you're not able to use
a clock with a higher frequency, then consider using a combinatorial output:

io_reg: PROCESS IS
BEGIN
WAIT UNTIL clk = '1';
input_i <= input;
END PROCESS io_reg;

output <= input_i WHEN clk = '1' ELSE '0';

or alternatively:

output <= input_i AND clk;


Kind regards,

Pieter Hulshoff
 
Reply With Quote
 
blackpadme
Guest
Posts: n/a
 
      08-25-2008
Hi, I'm trying insert 0s between inputs because i need a delay at the
input of a filter. I pretend to use this entity (with some
modifications) to implement a two's complement encoder too (i.e. x =
0, y = 11 (-1) and if x = 1, y = 01 (+1)).

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A question on HDLC bit stuffing ferrero General Computer Support 0 05-16-2009 08:13 AM
USB NRZI encoding and bit stuffing question cxu_dl@yahoo.com VHDL 9 07-03-2007 01:23 AM
Bit stuffing in a Crc encoder jpereira VHDL 4 05-31-2005 04:57 AM
Bit stuffing in C Language sarath1111@gmail.com C Programming 4 03-03-2005 07:26 PM
Bit-Stuffing on parallel 8 bit data kumar VHDL 8 02-17-2004 07:54 AM



Advertisments