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

1 list as many of the emergency agencies in your community2

1. List as many of the emergency agencies in your community. 2. Of these listed in (1) above, which are dealing with information security? 3. We pointed out that the development of a good disaster recovery plan requires ...

Application jurisdictional aspects of cybercrimeyou are

Application: Jurisdictional Aspects of Cybercrime You are using your wireless device to locate a restaurant. Suddenly, a large flashing skull-and-crossbones appears on your screen and a menacing laugh plays. Seconds late ...

Computer viruses and worms are often transmitted as

Computer viruses and worms are often transmitted as attachments to electronic mail. The Drib's development network infrastructure directs all electronic mail to a mail server. Consider an alteration of the developmen ...

Perform a hierarchical clustering of the one-dimensional

Perform a hierarchical clustering of the one-dimensional set of points 1, 4, 9, 16, 25, 36, 49, 64, 81, assuming clusters are represented by their centroid (average), and at each step the clusters wit

You accidently broke your refrigerator door handlethe

You accidently broke your refrigerator door handle.The appliance company that made the refrigerator can express ship you a replacement handle, for which it has copyrighted the design. But instead of buying the copyrighte ...

1 in what ways is network design an iterative process why

1. In what ways is network design an iterative process? Why does the need for network documentation arise in many phases of a network design project? 2. When responding to an RFP, why is it important to pay attention to ...

Given an example of broadcast usage in the network and data

Given an example of broadcast usage in the network and data link layers. For each case, (1) name the protocol that utilizing the broadcast, (2) the reason why the broadcast rather that unicast is used, and (3) how the fa ...

Given is the same curve as in 97 the order of this curve is

Given is the same curve as in 9.7. The order of this curve is known to be #E = 37. Furthermore, an additional point Q = 15 · P = (14,23) on this curve is given. Determine the result of the following point multiplications ...

1 what techniques can be used to reduce page table

1. What techniques can be used to reduce page table shadowing induced overhead? 2. What techniques can be used to reduce NPT induced overhead? 3. One of the biggest impediments to widespread use of virtual machines is th ...

1 implement a text-based version of the reversi game using

1. Implement a text-based version of the Reversi game using your game logic ADT from the previous question. 2. Define a game logic ADT, similar to that of the Reversi Game Logic ADT, for the game of checkers.

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen