Question: #include #include #include using namespace std; /*we use union and structure for IEEE 754 REPRESENTATION*/ typedef union { float f; struct { unsigned int mantissa
#include
/*for converting float to binary*/ void floattobinary(float f) { int bit=0; int *b = reinterpret_cast /*for converting into base 10*/ int base10(int n,int i) { long int x=pow(2,i-1); long int sum=0; for (int k = i - 1; k >= 0; k--) { if ((n >> k) & 1) sum+=x; x/=2; } return sum; } /*for convert into hexadecimal from base 10*/ int hexadecimal(int x,int z) { int n=base10(x,z); char hexaDeciNum[100]; int i = 0; while(n!=0) { int temp = 0; temp = n % 16; if(temp n = n/16; } for(int j=i-1; j>=0; j--) cout /*for printing binary*/ void printBinary(int n, int i) { int k; for (k = i - 1; k >= 0; k--) { if ((n >> k) & 1) printf("1"); else printf("0"); } } /*for printing in IEEE 754 representation*/ void printIEEE(myfloat var) { printf("%d | ", var.raw.sign); printBinary(var.raw.exponent, 8); printf(" | "); printBinary(var.raw.mantissa, 23); printf(" "); } int main() { myfloat var; float x,n; cout>x; var.f=x; cout>ch; switch(ch) { case 1: if(var.raw.sign==1) cout 0) { binaryNum[l] = y % 2; y = y / 2; l++; } for (int j = 7; j >= 0; j--) cout Using the code above break down/describe each function for the lab description below 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
