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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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