Get Help With a similar task to - Create and compile a code using MAKE

Login to view and/or buy answers.. or post an answer
Additional Instructions:

Complete project and compile using MAKE. PLEASE READ CAREFULLY!!! Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Xxxxxxxxxxxxccxccxxcxcxcxcxcxcxcxcxcxcxcxcxcxcxxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx · Cmsc257-f20-p1.c contains the main function which is used to read values from the standard input, it also calls functions created under p1-support.c (YOU CREATE THIS FILE). The p1-support.h declares functions that you inplement in this program/ · You need to complete the cmsc257-f20-p1.c program this receives 10 numbers from the command line · You are to create a new file p1-support.c. This will include the code for each of the functions declared in p1-support.h. These functions are described in Table 1. · Places where code or declarations needs to be added are indicated by ??? you may add extra helper functions as needed. See in file comments for hints. The program shall perform the following functions in order as indicated within the main() function: (a) Read in 10 integers from the command line and store them in int_array1. This part is complete. (b) Convert numbers in int_array1 to positive values by taking their absolute values and save them in int_array2. Use only binary operations when calculating the absolute value. Print all numbers in a single line using display_array function. (c) Convert these positive integers to integers in the range 0,…,127 by implementing the mod operation (i.e. number mod 128. Hint: This can be achieved by masking the 7 least significant digits in the integer number) and save them back into int_array2. Print all numbers in a single line using display_array function. (d) For each integer in int_array2, in a separate line: print the number, number of ‘1’ bits in the resulting binary representation by calling the function count_bits and print whether the number is even or odd using even_or_odd function. e.g. Assume number 0 was 24 [number 0 : 24 # of 1 bits : 2 even] (e) Cast each element of int_array2 to unsigned int and store them into uint_array1. (f) Reverse the order of array elements in uint_array1 using swap function. i.e. swap first and last element then 2nd and 9th and so on. (g) Update each element of uint_array1 by using reverse_bits function. (h) Print each element of uint_array1 in a separate line along with binary representation of each of the numbers using binary_string function. e.g. Assume number [number 0 : reversed: 1342177280 0b01010000000000000000000000000000]] · Function Type Parameters Description display_array void A reference to the array of integers and an integer length of the array. This function prints out an array of integers on a single line. The display width needs to be the same for each value. (Hint: You can display width of 10 by changing the format specifier as %10d) . count_bits int This should receive an integer to count 1 bits from. This function needs to return number of 1s in bitwise representation of a number You are expected to use bitwise (such as >>, &) operations for this function. reverse_bits unsigned int This should receive an unsigned integer number to reverse. The function should return the number (in unsigned integer format) whose bits are reversed, i.e., the leftmost bit of the original number is the rightmost bit of the returned number, the second from the leftmost bit of the original number is the second to the rightmost bit of the returned number and so on. You are expected to use bitwise operations for this function. binary_string void This should receive a pointer to a string, an unsigned integer number to convert to binary. This function should fill the text string with a binary representation of the number suitable for printing. You should be using some bitwise operations to achieve this, maybe shifting(<<) and and (&) operation, you can aso use bit_get function. Binary representation of the number needs to be prepended with “0b” You are expected to use bitwise operations for this function. bitwise_mod128 int This should receive an integer as an input This function should return mod 128 using bitwise operations. (Hint: This can be achieved by using bitwise AND operation using a mask, mask with 7 least digits of 1s. If the number is negative this function should return 0. You are expected to use bitwise operations for this function bitwise_abs int This should receive an integer as an input. This function should return absolute value of the input integer. For positive integers absolute value will be the same, for negative integers flip all bits and add one, (If a number is negative the most significand bit is 1, you can use bit_get). You are expected to use bitwise operations for this function bit_get int This should receive two integer values as input. This function should extract the specified bit from a given number. Such as bit_get(num, 0) should return the rightmost binary digit in num. You are expected to use bitwise operations for this function even_or_odd int This should receive an integer value. Should return 1 if number is even and 0 if number is odd. You can find this out by looking at the least significant binary digit in a number. (You can use bit_get) You are expected to use bitwise operations for this function swap_ints void This should receive two unsigned integer pointers as input. Should swap the numbers without using temp variable. This can be achieved using exclusive or operation. (bitwise operation) Look at the example in the textbook . You are expected to use bitwise operations for this function COMPLETE THESE CODES: P1-SUPPORT.H //////////////////////////////////////////////////////////////////////////////// // // File : p1-support.h // Description : This is a set of general-purpose utility functions we use // for the 257 assignment #1. // // // Functional Prototypes // // Include description, input and output for each function here in this file // You don't need to copy them into the p1-support.c file. There is a sample // for main function within the ..p1.c file. int display_array(void);//?? fix this function prototype int count_bits(int); //??? reverse_bits(???); //??? binary_string(???); //??? bitwise_mod128(???); //??? bitwise_abs(???); //??? bit_get(???); //??? even_or_odd(???); //??? swap_ints(???); //??? add other helper functions as needed. functions above are minimums. //////////////////////////////////////////////////////////////////////////////// // // File : cmsc257-f20-p1.c // Description : This is the main source code for for the first assignment // of CMSC257. See the related assignment page for details. // // Fill in the autsor name and last modified date below // Author : ???? // Last Modified : ???? // // Include Files #include <stdio.h> #include <math.h> #include <stdlib.h> // Project Includes #include "p1-support.h" // // Functions //////////////////////////////////////////////////////////////////////////////// // This is a sample comment for the main function // You should include a similar comment for each function you imoplemented within the .h file // // Function : main // Description : The main function for the CMSC257 project #1 // // Inputs : argc - the number of command line parameters // argv - the parameters // Outputs : 0 if successful test, -1 if failure // Function : ??? // ??? int main(int argc, char *argv[]) { // Local variables // NOTE: this is where you will want to add some new variables int int_array1[10], int_array2[10]; unsigned int uint_array1[10]; int i; //???? if (argc < 11) "cmsc257-f20-p1.c" [dos] 88L, 2666C 7,1 Top ALSO ENSURE THAT IT IS COMPILED USING MAKE

Related Questions

Similar orders to Create and compile a code using MAKE
27
Views
0
Answers
Project for CS1302 using JavaFX
THE DEADLINE IS TODAY(4/21) AT 11:00!! It's not updating for some reason. I have done some of this project but it's not working and I need someone to complete it. There is a project description file, as well as my current java files. According to the desc...
11
Views
0
Answers
unity programming assignment help
Look at pdf, I can't explain well Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
22
Views
0
Answers
Java ULTIMATE TIC-TAC-TOE programming (not 2D array)
Instructions and source codes are attached. most of method, class, interfaces are already exists, most of works are combining and manipulating existing codes...
10
Views
0
Answers
Assignment 5: File I/O course catalog database
For this assignment, you will use C’s I/O functions to create a simple course catalog database for administrators to update the details of each course offered by the CS department. The system will store basic information about each course, allowing ...