Functions
field.c File Reference

You will modify this file and implement three functions. More...

#include "field.h"

Functions

bool fieldFits (int value, int width, bool isSigned)
 
int getBit (int value, int index)
 
int getField (int value, int hi, int lo, bool isSigned)
 
int setBit (int oldValue, int index, int newValue)
 
int setField (int oldValue, int hi, int lo, int newValue)
 

Detailed Description

Your implementation of the functions defined in field.h. You may add other function if you find it helpful. Added function should be declared static to indicate they are only used within this file. For example, methods you write may need a mask value. You might write a method to compute mask for you and use it wherever it is needed as oposed to just puting the code in line.

Author
Your name goes here

Function Documentation

bool fieldFits ( int  value,
int  width,
bool  isSigned 
)
Todo:
Implement in field.c based on documentation contained in field.h
int getBit ( int  value,
int  index 
)
Todo:
Implement in field.c based on documentation contained in field.h
int getField ( int  value,
int  hi,
int  lo,
bool  isSigned 
)
Todo:
Implement in field.c based on documentation contained in field.h
int setBit ( int  oldValue,
int  index,
int  newValue 
)
Todo:
Implement in field.c based on documentation contained in field.h
int setField ( int  oldValue,
int  hi,
int  lo,
int  newValue 
)
Todo:
Implement in field.c based on documentation contained in field.h