hi all, I dont have any clue how to accomplish this. Pls provide ne clues ...Thanks..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prietysharma121
    New Member
    • Feb 2010
    • 1

    hi all, I dont have any clue how to accomplish this. Pls provide ne clues ...Thanks..

    This project will require you to develop three C functions:

    float nandFloatMul(fl oat a, float b) float nandFloatAdd(fl oat a, float b) float nandFloatSub(fl oat a, float b)

    Each of the above functions takes as input two float operands and returns their product, sum, and difference, respectively, as a float.

    You must also implement the following “helper” functions:
    int boolNand(int i, int j)
    int bitWiseNand(int i, int j)

    Notes: 1. boolNand() returns zero if and only if both inputs are not zero. 2. bitWiseNand() returns the bit-wise nand of the inputs. 3. You may implement versions of boolNand() and bitWiseNand() in any,

    or all, integral C data types. Requirements:
    1. In implementing your nandFloat*() functions, you may only use: (a) boolNand(), (b) bitWiseNand(), (c) the C assignment (=) operator, and (d) the C shifting operators (<< and >>).
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Here is some hints:

    For the nandFloatMul you will be using the * operator. For nandFloatAdd you will be using the + operator. For nandFloatSub you will be using the - operator.

    For boolNand you will be using the == and != operator. And lastly for bitWiseNand() you will need to ask your professor for more detail. when you say bitwise nand that either means logically "not-and" or you are talking about some kind of flash memory.

    Once you have those things working then you can replace your operators with your two helper functions. You can run several iterations of your helper functions to see how many and in which order you need to call to achieve the same result.

    Next time post your code so we can help you more.

    Comment

    Working...