+1-415-315-9853

info@mywordsolution.com

Engineering

 Civil Engineering Chemical Engineering Electrical & Electronics Mechanical Engineering Computer Engineering Engineering Mathematics MATLAB Other Engineering Digital Electronics Biochemical & Biotechnology

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 is registration required if the mobile host acts as a

1. Is registration required if the mobile host acts as a foreign agent? Explain your answer. 2. Discuss how the ICMPv4 router solicitation message can also be used for agent solicitation. Why are there no extra fields? 3 ...

Mobile app part 3 riskreference the microsoft project file

Mobile App Part 3 Risk Reference the Microsoft Project file you created in Assignment 5(AT THE ATTACHED): Mobile App Part 2 (Gantt and PERT Charts) for the completion of this assignment. Write a two to three page paper i ...

1 explain the basic technology that makes residentialsoho

1. Explain the basic technology that makes residential/SOHO firewall appliances effective in protecting a local network. Why is this usually adequate for protection? 2. What key features point up the superiority of resid ...

In practice the short exponents e 3 17 and 216 1 are

In practice the short exponents e = 3, 17 and 216 +1 are widely used. 1. Why can't we use these three short exponents as values for the exponent d in applications where we want to accelerate decryption? 2. Suggest a mini ...

1 the chapter mentioned reconnaissance attacks do some

1. The chapter mentioned reconnaissance attacks. Do some research to learn more about the tools that attackers use when on a reconnaissance mission. In your own words, describe two tools that you researched. 2. What inve ...

1 ideally a method should have no side effects can you

1. Ideally, a method should have no side effects. Can you write a program in which no method has a side effect? Would such a program be useful? 2. Write preconditions for the following methods. Do not implement the metho ...

1 distinguish between multicasting and multiple unicasting2

1. Distinguish between multicasting and multiple unicasting. 2. When we send an e-mail to multiple recipients, are we are using multicasting or multiple unicasting? Give the reason for your answer. 3. Define which of the ...

It is required to generate a histogram distribution for a

It is required to generate a histogram distribution for a set of daily average temperatures recorded in Antarctica. The temperatures are integer values in the range -40°C to +5°C. Design an algorithm to input n such temp ...

1 write a deletion method for the redblack class that

1. Write a deletion method for the RedBlack class that adheres to the red-black rules. 2. Design and implement a program that compares AVL trees and red-black trees to skip lists. Which data structure performs the best?

Given is a dhke algorithm the modulus p has 1024 bit and

Given is a DHKE algorithm. The modulus p has 1024 bit and α is a generator of a subgroup where ord(α) ≈ 2160. 1. What is the maximum value that the private keys should have? 2. How long does the computation of the sessio ...

• 13,132 Experts

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.

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

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