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 object x has two simple variables how can snmp refer to

1. Object x has two simple variables. How can SNMP refer to the instance of each variable? 2. Object x has one table with two columns. The table at this moment has three rows with the contents shown below. If the table i ...

1 what methods does a social engineering hacker use to gain

1. What methods does a social engineering hacker use to gain information about a user's login id and password? How would this method differ if it were targeted towards an administrator's assistant versus a data-entry cle ...

How do you make a module in ms acessattached is a database

How do you make a module in MS Acess Attached is a database with modules that were done for me I need directions , how and why these are built .I am trying to understand VBA and programing better. Attachment:- info262_rm ...

You receive a computer system from the officer who tagged

You receive a computer system from the officer who tagged and bagged the evidence at a crime scene in a suspects home. You examine the computer and discover that is uses SCSI (small computer system interface) drive on Wi ...

A system administrator notices that a file service disk is

A system administrator notices that a file service disk is failing for two unrelated reasons. Once every 30 days, on average, vibration due to nearby construction breaks the disk's arm. Once every 60 days, on average, a ...

Your project is executed with a globally spread virtual

Your project is executed with a globally spread virtual team. The project progress has been found to be too slow. Which measure is most likely to immediately speed up the project? Answer in 4-5 sentences.

The input stream to a 4b5b block encoder is 0100 0000 0000

The input stream to a 4B/5B block encoder is 0100 0000 0000 0000 0000 0001 Answer the following questions: a. What is the output stream? b. What is the length of the longest consecutive sequence of 0s in the input? c. Wh ...

Programming assignment linker you are to implement a

Programming Assignment: Linker You are to implement a two-pass linker and submit the source code, which we will compile and run. Submit your source code together with a Makefile as a ZIP file with directory through NYU C ...

1 what is the optimal block size for a miss latency of

1. What is the optimal block size for a miss latency of 20×B cycles? 2. What is the optimal block size for a miss latency of 24+B cycles? 3. For constant miss latency, what is the optimal block size? 4. In this exercise, ...

1 what type of topology is used when customers in an area

1. What type of topology is used when customers in an area use DSL modems for data transfer purposes? Explain. 2. What are the user data rates of STS-3, STS-9, and STS-12? 3. Show how STS-9s can be multiplexed to create ...

  • 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