BuggerNot
BuggerNot

Reputation: 448

Bit stuffing help. GATE-CS Set 3 2014

A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string is

(A) 0111110100

(B) 0111110101

(C) 0111111101

(D) 0111111111

Correct answer given is B.

My question is why 1 is added after five 1's from left even when delimiter has six continuous 1's.

I think we will add 1 only when we get six continuous 1's, to avoid a 0.

Correct me if I am wrong.

Upvotes: 0

Views: 1271

Answers (1)

ViX28
ViX28

Reputation: 307

The delimiter given 01111110. Delimiter basically used to determine the start and end of the frame. So we need to make sure if the same pattern(01111110) is also in data frame then receiver will not think of it as start or end of frame rather a valid data portion. That's why after '011111' of data bits, one '0' bit is stuffed to make sure it will not give impression of start or end of frame.

When the receiver receives ,it checks for consecutive five ones and if the next bit is zero then it drops it(If next bit is 1 instead of 0 then check the next bit of this bit ,if that is 0 then it is delimiter else error has occured). This is known as '0' bit stuffing.

Upvotes: 0

Related Questions