1

Consider a data communications system that represents characters using ASCII with odd parity. Each 7-bit ASCII character is followed by a parity bit.

Specify the resulting 8-bit code word for each of the characters in the following message that is to be transmitted:

IAcademy!

(The characters in this message, including the exclamation mark.)


Using a Table of ASCII Characters, I converted the ASCII character "c" from 0x63 to binary: 0110 0011

There are an even number of 1's.

1) Where do I add the parity bit (prefix or suffix)?

2) Adding a parity bit to make the number of 1's odd will result to 9-bits. How do I keep it to 8-bits?

k_rollo
  • 5,304
  • 16
  • 63
  • 95
  • Are you trying to get us to do your homework for you? http://forums.devshed.com/beginner-programming-16/odd-parity-952988.html – Hans Z Oct 13 '13 at 07:50
  • No, I just needed the steps. As you can see, I did my own conversion and posted what I thought must be done at DevShed. Double check and I am in no way asking for answers. Thank you. – k_rollo Oct 13 '13 at 07:52
  • Alright then, carry on XD. – Hans Z Oct 13 '13 at 07:54
  • 1
    @HansZ Using Stack Overflow for posting homework questions is considered allowed. – AStopher Sep 21 '14 at 10:41

2 Answers2

1

First you need to know what is sent first: LSB or MSB. Second, you append the ODD parity bit at the end of the transmission such that the total number of 1s is odd. So, if you want to send the ASCII 'B' (0x42 -> 1000010) using a communication system that sends LSB first (most common), you would send 0xC2 (11000010), so you would see on the wire 0,1,0,0,0,0,1,1. If you're using a communication system that sends MSB first, the same 'B' would be sent as 0x85. In that case, you would see on the wire 1,0,0,0,0,1,0,1. I hope this helps!

guga
  • 714
  • 1
  • 5
  • 15
  • Now it is clear why some parity bits are "prefixed" (LSB) and others "suffixed" (MSB), thank you very much. IF a communication system sends MSB first with ODD parity, would my answer regarding "I" (0x49), which was **1001 0010** be correct? – k_rollo Oct 14 '13 at 02:20
  • Yes! The key point to remember is that parity is always sent last. – guga Oct 14 '13 at 10:59
0

Ignore the first 0 in the ASCII representation since you only need 7 bits. This becomes 110 0011. Now add the parity bit – 0 for even parity and 1 for odd parity. So, if you are using even parity, the final result would be 110 00110 (you put the parity bit the end usually)

rafalio
  • 3,928
  • 4
  • 30
  • 33
  • If I were to convert the character "I" (uppercase i, 0x49) to binary, it is **0100 1001**. There is already an odd number of 1's and it is already 8-bits. Does that mean I do not have to change anything anymore or do I ignore the first 0 and suffix the parity bit at the end resulting to **1001 0010**? – k_rollo Oct 13 '13 at 07:59
  • It is 8 bits because it's simply easier to express it that way. The ASCII codes don't go over 128, so 7 bits is enough, the 8th bit is simply for representational purposes. `0100 1001` is the same as `100 1001`. After you have that, you must add a bit at the end, such that the total number of 1's is even. In this case, since it's odd, you have to add a `1` to make it even. This makes a total of 4 ones, so the parity is even. When processing the final output `100 10011`, you look at the first 7 bits to decode the ASCII, and then the final bit to check for errors. – rafalio Oct 13 '13 at 08:22
  • 1
    This answer is not right! The op asks for ODD parity. On top of that, the position of the parity bit may be wrong. It depends on what is sent first: LSB or MSB. The parity bit is always the last bit sent. Most communication systems opt to send LSB first. – guga Oct 13 '13 at 12:04
  • Ah yes, you are right, I see now the poster specified odd parity. – rafalio Oct 13 '13 at 23:13
  • Thank you, I have noticed that @radicality answered for EVEN parity as well. However, I applied his explanation on even parity to the ODD parity, which was the original problem. I have also "prefixed" the parity bit, as it was in our instructor's lecture. The most useful information here being the explanation for 7-bits, so thank you still for that. – k_rollo Oct 14 '13 at 02:08