1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SOVA2 [1]
3 years ago
9

Program for bit stuffing...?

Computers and Technology
1 answer:
Olegator [25]3 years ago
4 0

Answer: Program for bit stuffing in C

#include<stdio.h>

      int main()

    {    

          int i=0,count=0;

          char data[50];

          printf("Enter the Bits: ");

          scanf("%s",data);            //entering the bits ie. 0,1  

          printf("Data Bits Before Bit Stuffing:%s",databits);

          printf("\nData Bits After Bit stuffing :");

          for(i=0; i<strlen(data); i++)

              {

              if(data[i]=='1')

                     count++;

              else

                     count=0;

                printf("%c",data[i]);

             if(count==4)

                {

                          printf("0");

                          count=0;

                 }

             }

    return 0;

 }

Explanation:

bit stuffing is the insertion of non-information bits during transmission of frames between sender and receiver. In the above program we are stuffing 0 bit after 4 consecutive 1's. So to count the number of 1's we have used a count variable. We have used a char array to store the data bits . We use a for loop to iterate through the data bits to stuff a 0 after 4 consecutive 1's.

You might be interested in
/*
Lera25 [3.4K]

Answer:

The answer to this question can be given as:

Method:

public static void showTwos(int number)  //method definition.

{

method body.  

System.out.print(number + " = ");  //print number

while (number % 2 == 0)   //condition

{

System.out.print("2 * ");    //print message.

number = number / 2;

}

System.out.println(number);    //print value.

}

Explanation:

In the above method definition firstly, we declare the method showTwos() that name is already given in the question then we pass a variable number as a parameter in the method. In this first, we take input number from the user and pass into this method. In this method we use a while loop it is an entry control loop in this loop first we modules the number if it is equal to 0.Then we divide the number by 2 and in the last, we print the value.

4 0
3 years ago
A key or combination of keys that complete an action more efficiently than using the mouse is called a(n) keyboard shortcut.
andreev551 [17]
The answer to your question is true
6 0
3 years ago
The following pseudocode describes how a bookstore computes the price of an order from the total price and the number of the boo
ICE Princess25 [194]

Answer:

float bookExamplePrice = 15.25;

float bookTax = 7.5;

float bookShippingPrice = 2.0;

float Test = bookExamplePrice / 100;

float Tax = Test * bookTax;

float FullPrice = Tax + bookExamplePrice + bookShippingPrice;

// I don't know how to remove the numbers after the first two decimals.

// I tested this program. It works!

// The text after the two slashes don't run when you compile them.

printf("Price: $%.6f\n",FullPrice);

Explanation:

8 0
3 years ago
Mark friends told him about an automated program that sends unsolicited messages to multiple users. Which type of program were m
tekilochka [14]

Spambot or Spam

Hope this helps!

5 0
3 years ago
Read 2 more answers
To light up an LED, you need to connect the cathode leg to one of the Digital Pins and connect the Anode leg to the ……………. on th
Elenna [48]

Answer bobobobobobobobo

4 0
2 years ago
Other questions:
  • If you want to present slides to fellow students or co-workers, which productivity software should you use to create them?
    5·2 answers
  • _____ are the supertiny on-off switches in a chip that work collectively to calculate or store things in memory. Transistors Mul
    10·1 answer
  • What is are example of an engineered item?
    12·1 answer
  • ________ is the information about a file.
    7·1 answer
  • 1. Write a bash script to create 3 files of different size greater than 1700 kb and less than 1800 kb . The 2. Content of the fi
    9·1 answer
  • What does the machine do and how do the operators react to their work?
    13·1 answer
  • Which two graphs best represent the motion of an object falling freely?
    12·1 answer
  • What are control layouts? What are the two primary control layout options?
    13·1 answer
  • Write a program that include a method that returns the sum of all the elements of a Linked List of Integers. Allow the user to e
    11·1 answer
  • Which of the following best explains what happens when a new device is connected to the Internet?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!