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

Answer the following in 300 words or morewireless

Answer the following in 300 words or more: Wireless technology has been available for quite some time. Discuss some of the reasons why businesses have been slow to adopt this technology?

Develop hardening checklist for windows 10one of the most

Develop Hardening Checklist for Windows 10 One of the most useful tools you will use in your role as an Information Security professional is a hardening checklist. Essentially, it is a document that serves as a guide to ...

Term paper crowdsourcingcrowdsourcing in the field of

Term Paper: Crowdsourcing Crowdsourcing in the field of interface design takes tasks traditionally performed by specific individuals and spreads them out among a group of people or a community. These assignments are usua ...

1 again based on 1 above is it possible to continue

1. Again based on 1 above, is it possible to continue operating a sensor network with a selected number of sensors taken out? Is it possible to identify those nodes? 2. Devise ways (some cryptographic) of securing wirele ...

Suppose an n x n image u is mapped into a row-ordered n2 x

Suppose an N x N image U is mapped into a row-ordered N 2 x 1 vector IP. Show that the N 2 x N 2 one-dimensional Hadamard transform of IP gives the N x N twodimensional Hadamard transform of U. Is this true for the other ...

In this problem we want to compare the computational

In this problem, we want to compare the computational performance of symmetric and asymmetric algorithms. Assume a fast public-key library such as OpenSSL [132] that can decrypt data at a rate of 100 Kbit/sec using the R ...

Show that there is no speckle in images obtained by an

Show that there is no speckle in images obtained by an ideal imaging system. Show that, for a practical imaging system, the speckle size measured by its correlation distance can be used to estimate the resolution (that i ...

Miguel considers tickets to the houston grand opera and to

Miguel considers tickets to the Houston Grand Opera and to Houston Astros baseball games to be perfect substitutes. Show his preference map. What is his utility function?

Assignment conflict resolutionconflict resolution is a

Assignment: Conflict Resolution Conflict resolution is a necessary skill for any manager or leader. In this assignment, you will examine the difference between conflict and competition. You will also explore ways of dete ...

Timnbspurban ownermanager ofnbspurbans motor court in

Tim Urban, owner/manager of Urban's Motor Court in Key West, is considering outsourcing the daily room cleanup for his motel to Duffy's Maid Service. Tim rents an average of 50 rooms for each of 365 nights (365 × 50 equa ...

  • 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