Describe a set of functions that make use of the twos

Assignment Help Computer Engineering
Reference no: EM132194453

Write a 'c' code for the following puzzles,

Bit Manipulations Table 1 describes a set of functions that manipulate and test sets of bits. The "Points" field gives the number of points for the puzzle, and the "Max ops" field gives the maximum number of operators you are allowed to use to implement each function. See the comments in bitslab.c for more details on the desired behavior of the functions.

Name Description Points Max Ops

bitAnd(x,y) x & y using only | and ˜ 2 8

getByte(x,n) Get byte n from x. 2 6

logicalShift(x,n) Shift right logical. 3 20

bitCount(x) Count the number of 1's in x. 4 40

bang(x) Compute !x without using ! operator. 4 12

Two's Complement Arithmetic Table 2 describes a set of functions that make use of the two's complement representation of integers. Again, refer to the comments in bitslab.c for more information.

Name Description Points Max Ops

tmin() Most negative two's complement integer 1 4

fitsBits(x,n) Does x fit in n bits? 2 15

divpwr2(x,n) Compute x/2 n 2 15

negate(x) -x without negation 2 5

isPositive(x) x > 0? 3 8

isLessOrEqual(x,y) x <= y? 3 24

Floating-Point Operations For this part of the assignment, you will implement some common single-precision floating-point operations.

In this section, you are allowed to use standard control structures (conditionals, loops), and you may use both int and unsigned data types, including arbitrary unsigned and integer constants.

You may not use any unions, structs, or arrays. Most significantly, you may not use any floating point data types, operations, or constants.

Instead, any floating-point operand will be passed to the function as having type unsigned, and any returned floating-point value will be of type unsigned. Your code should perform the bit manipulations that implement the specified floating point operations.

Table 3 describes a set of functions that operate on the bit-level representations of floating-point numbers. Refer to the comments in bits.c for more information.

Name Description Points Max Ops

float_neg(uf) Compute -f 4 10

float_i2f(x) Compute (float) x 4 30

float_twice(uf) Computer 2*f 4 30

Reference no: EM132194453

Questions Cloud

Level of effective communication : Explain how the chain of command in an organization can impact the level of effective communication.
Enhance communication in the workplace : Frederick Taylor addressed "scientific management" how can you apply his theory to enhance communication in the workplace?
Convert the word to pig latin by moving the first letter : Convert the word to Pig Latin by moving the first letter to the end of the word and adding "ay" to the end.
Create a data structure that contains the data elements : Write the C code to create a data structure named "window" that contains the data elements "width", "height", "name", and "color".
Describe a set of functions that make use of the twos : Describe a set of functions that make use of the two's complement representation of integers.
Display how many times if not display does not exist : Search for this value in the array if it is found display how many times if not display "doesn't exist".
Create a linked list of student : The program initializes the list by first reading the students' names from the text file and setting the final grades to 0.00.
Can you keep moving the mouse and the arms keep moving : Assume that the torso is fixed, and that the skeletons of upper arm and lower arm can move inside a plane that passes through the center of the torso.
Subsidiaries in foreign countries : What are some of the challenges facing companies that have subsidiaries in foreign countries.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Design an algorithm to update the minimum spanning tre

Design an algorithm to update the minimum spanning tree when the weight of a single edge e is increased.

  Determine a formula relating the range r from the satellite

Determine a formula relating the range r from the satellite to an earth station to the satellite elevation 0 relative to the earth station.

  Describe each architectural visualization

Describe each architectural visualization in relation to the course management system. Explain the benefits of each architectural visualization to the various.

  Determine processing gain and interference margin

[Processing Gain and Interference Margin] Suppose that we require Eb/Jo = 10 dB to achieve reliable communication with binary PSK.

  Which areas of the data life cycle are the most challenging

Determine which areas of the data life cycle are the most challenging to control and explain why (i.e., creation, access, use, transmission, storage).

  Describe on a high level as to how this happens

Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

  How the style attribute is replacing some elements

The style attribute is replacing many elements in the always-evolving HTML world. Many features that were implemented using elements in older versions of HTML are now implemented using the style attribute.

  Determines the variable under the usual semantics

CSC324 2017 Winter. Assignment: Type Inference. uniquely determines the variable under usual semantics, i.e. no variables with different scopes have same name

  Write a function that input a frequency a maximum amplitude

Write a function that inputs a frequency, a maximum amplitude, and length in seconds. Create two sounds, one a square and one a triangle, using the same inputs.

  Write a for loop to print all elements in course grades

Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards.

  Evaluate dbms products for data warehousing

design a high-level summary of the main requirements to evaluate DBMS products for data warehousing. Suppose you are selling the data warehouse idea to your users.

  How do people benefit from playing video games

Do you think playing video games to escape from reality is healthy? How do people benefit from playing video games?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd