Question: In a C code, a variable X was declared as float and an initial value was assigned to it. After running the code the variable

In a C code, a variable X was declared as float and an initial value was assigned to it. After running the code the variable X was stored in the data memory as shown in Figure 1 1. (a) 110000010000000000 1011 1 10011 1000 | X Figure 1 (i)What was the value of X in the C code? (1.5 marks) i) Write the result from question (i) as a binary fixed-point number using the minimum number of bits for the integer part and the 6 bits for the fractional parts. 1.5 marks) The value of X has changed, during the execution of the C code, to -0.0078125. (i) (b) What will be stored in the data memory in the memory location reserved for X? (1.5 marks) (i) What will be displayed on the screen by the following pc.print statement (X - -0.0078125): pc . printf ("%8.4f ", X); 0.5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
