The Student Room Group

ICT Exam Help - Networks Comm.

I have an ICT exam in January and understand very little of the material. What I do understand I'm a little rusty on, but I should be able to brush up on that.

Is there anyone who'd be able to help me understand this stuff?

Example question:

One version of run length encoding replaces 3 or more occurrences of a repeated single character by the character repeated three times followed by a single byte containing a number between 0 and 255 inclusive. Use this method to run length encode the following phrase.

TXVQQQQQQQQVHKKKYUPPPPPPPPPYREEEEEEEETTRR


Anyone would could explain this sort of thing to me would be greatly appreciated, or even anyone who could provide a website that explains it reasonably well.
Reply 1
So, basically it's a type of compression - it's a way of specifying repeated characters that takes less space. So if 3 characters are in a row you replace it with that characters followed by the number of times it is repeated in a byte, so in your example:

TXVQ8VHK3YUP9YRE8TTRR

However, it's important to point out that the numbers aren't actually their ASCII equivalents (for example the character 8 is actually byte number 56 - byte number 8 above would be a backspace, and 9 a tab) - http://www.asciitable.com/
Reply 2
laser
So, basically it's a type of compression - it's a way of specifying repeated characters that takes less space. So if 3 characters are in a row you replace it with that characters followed by the number of times it is repeated in a byte, so in your example:

TXVQ8VHK3YUP9YRE8TTRR

However, it's important to point out that the numbers aren't actually their ASCII equivalents (for example the character 8 is actually byte number 56 - byte number 8 above would be a backspace, and 9 a tab) - http://www.asciitable.com/


Thanks for the reply, that makes it sound stupidly easy.

I'm not sure I get what you're saying about the ASCII equivalents and bytes, which now that I've looked at it, seems to be what's confusing me about a more advanced version of the question:

Decode the following;

ABBB*CCBBB*CCC*AABBCCABCABCDDD* where the first * represents the
number 2, the second * holds the number 0 and the third and fourth * are the byte 3.


Sorry for being a pain in the ass.
Reply 3
laser
So, basically it's a type of compression - it's a way of specifying repeated characters that takes less space. So if 3 characters are in a row you replace it with that characters followed by the number of times it is repeated in a byte, so in your example:

TXVQ8VHK3YUP9YRE8TTRR

However, it's important to point out that the numbers aren't actually their ASCII equivalents (for example the character 8 is actually byte number 56 - byte number 8 above would be a backspace, and 9 a tab) - http://www.asciitable.com/


Thanks for the reply, that makes it sound stupidly easy.

I'm not sure I get what you're saying about the ASCII equivalents and bytes, which now that I've looked at it, seems to be what's confusing me about a more advanced version of the question:

Decode the following;

ABBB*CCBBB*CCC*AABBCCABCABCDDD* where the first * represents the
number 2, the second * holds the number 0 and the third and fourth * are the byte 3.


Sorry for being a pain in the ass.
Reply 4
Okay, I misread the question - where I have a single character above before a number it should be 3 in a row.

Basically, ASCII is a way of storing letters and numbers in bytes. Bytes can only represent numbers (from 0 to 255), so ASCII is used to map characters to these numbers. For example, byte 65 is a capital 'A', and byte 117 is a lower case 'u'. If you want a number as a character, that has to be turned into ASCII too - '6' is byte 54, for example.

So, in that question, the first * is the number 2, which is byte 50, so you're repeat B 50 times, the second * is the number 0, which is byte 48, so repeat that B 48 times, and the third and fourth are byte 3, so the C and D only need to be repeated 3 times.
Reply 5
Just thought I'd bump this as I have another question which baffles me which is on the same topic.

The first part of the question is as follows:

'A simple run length compression scheme uses a special character [ESC] (hex code 0xlB)
as a flag to indicate that the two characters following the flag are to be treated in a special
way, the first of these two characters is the character to be repeated and the second of
these two characters is the number of times to repeat the character. Using this scheme
decode the message below, given that the ASCII code for an 'A' character is 0x41, '13' is
0x42, and 'C' is 0x43; note the square brackets are not part of the transmitted message.

[0x41] [0x42] [0x43] [0x43] [0x43] [0x42] [0xlB] [0x4I] [0x05] [0x42] [0x43]'


I understand how to do this, it's the linked question I'm not so sure about:

'This scheme needs additional rules to cope with the situation where an actual [ESC]
character is sent as part of the original message and coping with repeated character
sequences of more than 255 characters in length. Describe how you would extend the
description of the scheme above to cater for these two cases.'


Can someone lend a hand?
Reply 6
Well the way I'd do it is something like "if you receive two [ESC] characters in a row, then that means that they actually wanted to send a single [ESC], rather than repeat some characters", and secondly if the number to repeat is 255, then check for the byte after that to carry on, or something.
Reply 7
Wouldn't that require the sender to pre-empt it and send 2 where they meant one? I thought the question was asking how to differentiate between an actual ESC character from a flag one?
Reply 8
Xenyx
Wouldn't that require the sender to pre-empt it and send 2 where they meant one? I thought the question was asking how to differentiate between an actual ESC character from a flag one?

Not from my reading, it seems to want you to add things to the description of the scheme, and adding something like that is standard, the way it's implemented in the real world, and from my reading, in line with the question.
Reply 9
laser
Not from my reading, it seems to want you to add things to the description of the scheme, and adding something like that is standard, the way it's implemented in the real world, and from my reading, in line with the question.


I'll take your word for it, you seem to know your stuff.

Thanks once again.

Latest

Trending

Trending