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 draw the recursive call tree for the printrev function

1. Draw the recursive call tree for the printRev() function from Section 10.1 when called with a value of 5. 2. Determine the worst case run time of the recursive factorial function. 3. Determine the worst case run time ...

1 if a tlb is implemented as a set-associative cache how

1. If a TLB is implemented as a set-associative cache, how would you recommend determining the TLB slots examined by map (context, addr) ? Why? 2. Explain how to construct the cache tags of a virtual-address cache so tha ...

1 what is the difference between a compiler and an

1. What is the difference between a compiler and an interpreter? 2. What are the advantages of (a) a compiler over an interpreter (b) an interpreter over a compiler? 3. What advantages are there to a language-processing ...

1 who is ultimately responsible for managing a technology

1. Who is ultimately responsible for managing a technology? Who is responsible for enforcing policy that affects the use of a technology? 2. What is contingency planning? How is it different from routine management plann ...

1 segment by demographicinput message customer

1. Segment by demographic Input message: Customer Demographic Output message: Demographic Group 2. Segment by purchase behaviour Input message: Customer Purchase Behaviour Output message: Behavioural Group 3. Segment by ...

1 intrusion detection hybrids are getting better research

1. Intrusion detection hybrids are getting better. Research the products on the market and comment on them as far as their interfaces are concerned. 2. Discuss how exploits can be used to penetrate a network. Research an ...

The isvalidsource function can be used to evaluate a c

The isValidSource() function can be used to evaluate a C++ source file, but it is incomplete. Brackets encountered inside comments and literal strings would not be paired with those found elsewhere in the program. (a) C+ ...

1 how is an incident response plan different from a

1. How is an incident response plan different from a disaster recovery plan? 2. What is risk appetite? Explain why risk appetite varies from organization to organization. 3. What is a cost benefit analysis?

Investigate the effectiveness of business information

Investigate the effectiveness of business information systems of the given case study. To do this, you are required to submit a complete report which includes an analysis of functionality, resources required, the broad f ...

Imagine a peer-to-peer network where 1000 users want to

Imagine a peer-to-peer network where 1000 users want to communicate in an authenticated and confidential way without a central Trusted Third Party (TTP). ] 1. How many keys are collectively needed, if symmetric algorithm ...

  • 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

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