Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

problem 1: prepare a function which has an int parameter n, makes an integer mask having the bit 1 at the nth place from the rightmost bit, and returns the mask. For illustration, when n = 5 is passed to the function, the function will return 0x20 (Note that 0x20 is 00000000 00000000 00000000 00100000).

problem 2: prepare a function which has two int parameters num and n, and returns TRUE when the nth bit in num is 1, otherwise FALSE. This function must use the function in the above problem (1). (Be careful how to handle Boolean values in C.)

problem 3: prepare down a function which has a single int parameter n and returns an int: 0 if n is negative, or else 1. You are not allowed to simply check the integer value, and must use the function in the above problem (2).

problem 4: prepare down a function which has four unsigned char parameters, combines the four one-byte integer values into an unsigned integer, and returns the unsigned integer. When the four one-byte integers are combined, the first value should be used for the first byte in the resulting unsigned integer, the 2nd value for the second byte, the 3rd value for the 3rd byte, and the 4th value for the last byte.

problem 5: prepare down a function which has int parameter n, makes another kind of mask having n bit 1’s from the left most bit and 32- n bit 0’s next. The mask is called netmask in this seminar, and the function will return the netmask. (Note that a netmask consists of two parts of bit 1’s and bit 0’s.)

problem 6: prepare a function which has two unsigned int parameters of an IPv4 address (that is, an unsigned int) and a netmask (that is, an unsigned int), and returns the network id part in the IPv4 address. (Note that the network id part in an IPv4 address is obtained from the address by clearing some bits that are indicated by the bit 0’s in a netmask.)

problem 7: prepare down a function to check odd-parity of a given int parameter. That is that the function returns 1 when the number of bit 1's is odd, or else 0.

problem 8: prepare a main function which tests all the functions in (1) – (7).

•    The test data can be hard-coded in the main function, and each function must be tested at least 5 times.
•    The main function must appear before any other functions.
•    When you print integers, you must use the format specifier printing integers in the hexadecimal notation.
•    You mut use only one C file for this assignment.
•    You must not put any printf() in the functions in (1) – (7).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91798

Have any Question? 


Related Questions in Computer Engineering

Introduction to computingresearch at least three different

Introduction to Computing Research at least three different executive support systems using a web search. Review each, and then answer the following questions: 1. Which ESSs did you review? Include a link to information ...

Conflict is inevitable as an employee of any institution

Conflict is inevitable. As an employee of any institution, you will encounter conflict. Despite your best efforts, conflict will occur. Institutional conflict can be viewed as either  functional  or  dysfunctional . From ...

Suppose we have market baskets that satisfy the following

Suppose we have market baskets that satisfy the following assumptions: 1. The support threshold is 10,000. 2. There are one million items, represented by the integers 0, 1, . . . , 999999. 3. There are N frequent items, ...

A what is a data repository a passive data repository an

a. What is a data repository? A passive data repository? An active data repository? b. Explain why a data repository is important. What is likely to happen if one is not available? c. Define distributed database. d. Expl ...

What are the inputs for a bottom-up software project plan

What are the inputs for a bottom-up software project plan? What precautions are taken while creating a project plan to tackle different risks? What kinds of project plans are devised for iterative models of software deve ...

Explain how lattice are used in determining the global

Explain how lattice are used in determining the global states in distributed computing.

A the french and chinese prime ministers need to come to an

a. The French and Chinese prime ministers need to come to an agreement by telephone, but neither speaks the other's language. Further, neither has on hand a translator that can translate to the language of the other. How ...

User interface ui best practicesdescribe ui best practices

User Interface (UI) best practices Describe UI best practices and principles. Provide examples of a few principles that you come across. Provide examples of good and poor UI design. NOTE: The answer should be between 200 ...

Investigate whether your organization college or university

Investigate whether your organization, college, or university uses data mining technologies. If found, describe the type of data mining tools used and discuss how these tools support decision-making by providing examples ...

A summarize the reasons for creating customized duplicated

a. Summarize the reasons for creating customized duplicated tables. b. Why are customized duplicated tables not used for updatable databases? c. List four common design problems when creating databases from existing data ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate