Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Coding question
I have a coding question:

I have an algorithm were I have coded for two events.
The first event may have zero or more bits.
The second will have one or more bits.
It is necessary to delimit each event.

I have coded this way:

For the first event I use zeros and for the second I use ones
terminated by a zero.
" 1011110000001000000011111000010 "
A first event will not follow a first event but, a second event may
follow a second event.


My Question is:  Is there a better coding? Can I avoid the need for a
termination bit in the second event and still be able to have "back to
back" delimited second events?

Ernst

Report this thread to moderator Post Follow-up to this message
Old Post
Ernst Berg
09-19-04 08:55 PM


Re: Coding question
Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in
news:be9ae35b.0409191116.8156c33@posting.google.com:

>
> I have a coding question:
>
>  I have an algorithm were I have coded for two events.
>  The first event may have zero or more bits.
>  The second will have one or more bits.
>  It is necessary to delimit each event.
>
>

It not clear enough how do you distingish between
to second events and a second event followed by a first
event of zero bits followed by a second event. Your
statements don't make logical sense to me.


David A. Scott
--
My Crypto code
http://bijective.dogma.net/crypto/scott19u.zip
http://www.jim.com/jamesd/Kong/scott19u.zip old version
My Compression code http://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"


Report this thread to moderator Post Follow-up to this message
Old Post
David A. Scott
09-20-04 08:55 AM


Re: Coding question
Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in message news:<be9ae35b.0409191116.8156c33@po
sting.google.com>...
> I have a coding question:
>
>  I have an algorithm were I have coded for two events.
>  The first event may have zero or more bits.
>  The second will have one or more bits.
>  It is necessary to delimit each event.
>
> I have coded this way:
>
>  For the first event I use zeros and for the second I use ones
> terminated by a zero.
>  " 1011110000001000000011111000010 "
>  A first event will not follow a first event but, a second event may
> follow a second event.
>
>
>  My Question is:  Is there a better coding? Can I avoid the need for a
> termination bit in the second event and still be able to have "back to
> back" delimited second events?

What do you mean by "better"? I think, Berg,  your approach to the
problem might be slightly flawed. You could also consider the
situation like this. You have 2 types of event and events have a
bitlength. If the bitlengths are constrained you could think of it as
having 2*max_bitlength different events. If you then also have a
frequency distribution for the events, you then may build a huffman
code to get an optimal code. Now, there are too many "If"s here,and I
might be missinterpreting you, because the information you provide is
much too scant

regards.

Report this thread to moderator Post Follow-up to this message
Old Post
Guenther von Knakspott
09-20-04 08:55 AM


Re: Coding question
"David A. Scott" <daVvid_a_scott@email.com> wrote in message news:<Xns9569DCA309733H110W296
LC45WIN3030R@130.133.1.4>...
> Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in
> news:be9ae35b.0409191116.8156c33@posting.google.com:
> 
>
>     It not clear enough how do you distingish between
> to second events and a second event followed by a first
> event of zero bits followed by a second event. Your
> statements don't make logical sense to me.
>
>
> David A. Scott


Right.

I must leave for work but I will return to express my question in a
better way tonight.

Ernst

Report this thread to moderator Post Follow-up to this message
Old Post
Ernst Berg
09-21-04 01:55 AM


Re: Coding question
guenther.vonKnakspott@gmx.de (Guenther von Knakspott) wrote in message news:<9e54a9f7.04091
92227.7dc1a4a4@posting.google.com>...
> Ernst_Berg@sbcglobal.net (Ernst Berg) wrote in message news:<be9ae35b.0409
191116.8156c33@posting.google.com>... 
>
> What do you mean by "better"? I think, Berg,  your approach to the
> problem might be slightly flawed. You could also consider the
> situation like this. You have 2 types of event and events have a
> bitlength. If the bitlengths are constrained you could think of it as
> having 2*max_bitlength different events. If you then also have a
> frequency distribution for the events, you then may build a huffman
> code to get an optimal code. Now, there are too many "If"s here,and I
> might be missinterpreting you, because the information you provide is
> much too scant
>
> regards.


I have not tried this approach but I like the enumeration ideal.
I adopted a unary code but the seperate functions still interest me.
I  will look into this.

Thank you.

Ernst

Report this thread to moderator Post Follow-up to this message
Old Post
Ernst Berg
09-24-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compression archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:17 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.