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
Create a new Die object. (Refer to Die.html for documentation.)Create a loop that will iterate at least 100 times. In the loop b
hjlf

Answer:

Java code is given below

Explanation:

import java.util.Random;

class Die{

private int sides;

public Die(){

sides = 6;

}

public Die(int s){

sides = s;

}

public int Roll(){

Random r = new Random();

return r.nextInt(6)+1;

}

}

class DieRoll{

public static void main(String[] args) {

Die die = new Die();

int arr[] = new int[6];

for(int i=0; i<6; i++)

arr[i] = 0;

for(int i=0; i<100; i++){

int r = die.Roll();

arr[r-1]++;

}

for(int i=0; i<6; i++)

System.out.println((i+1)+" was rolled "+arr[i]+" times.");

}

}

8 0
3 years ago
Chang investigates ways to improve the interactivity of computer hardware. His job title is best described as ✓ Computer and Inf
xeze [42]

Answer:

B, D, C

Explanation:

got it right

3 0
2 years ago
Indicates how fast the engine is moving in rpms.
lapo4ka [179]
That would be called a <span>tachometer </span>
7 0
3 years ago
In attempts to improve their contribution to the environment, a company decided to adapt to green computing. Which of these tech
timama [110]

Answer:

All of them apply

Explanation:

Green computing is the process of using environmental friendly computers and its associated components, accessories and other supporting devices.

Virtualization helps us to reduce the number of hardware that we are using.

Grid computers helps us to reduce the use of number of machines and thus supporting the environment in a right way.

Recycling process. Any material that we use needs to be recycled effectively and also in an environmental friendly way.

Autonomic computing uses eco-friendly system which in turn hugely support green computing.

8 0
2 years ago
tion. 6. A step occasionally required to repair damaged relationships is O A. looking at the problem from the other person's poi
Marta_Voda [28]
The answer to this question is b that's the answer
5 0
2 years ago
Other questions:
  • A firewall is either software or dedicated hardware that exists between the __________ being protected.
    13·1 answer
  • Can i have information about skrillex hobbies
    6·1 answer
  • What are four different commands in Internet Explorer and identify their keyboard shortcuts
    10·1 answer
  • opearating system protection refers to a mechanism for controling access by programs, processes, or users to both system and use
    7·1 answer
  • When storing used oil, it needs to be kept in ___________ containers.
    12·1 answer
  • What statement best describes operating systems?
    12·1 answer
  • A home user reports to a network technician that the Internet is slow. The network administrator discovers that multiple unknown
    12·2 answers
  • Lori Redford, who has been a member of the Project Management group, was recently promoted to manager of the team. She has been
    12·1 answer
  • When authenticating a user's password, the password supplied by the user is authenticated by comparing the ____ of the password
    11·1 answer
  • Retail products are identified by their Universal Product Codes (UPCs). The most commonform of a UPC has 12 decimal digits: The
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!