To illustrate the size of quantization levels, imagine representing the heights
ID: 2267914 • Letter: T
Question
To illustrate the size of quantization levels, imagine representing the heights of two buildings as digital numbers. Building A is exactly 100 meters in height, while Building B is 100.0001 meters. That is, Building B is about the thickness of a sheet of paper (0.1 mm) higher than building A. Indicate whether or not each of the following types of digitized numbers could show that the two buildings are different in height. a. Integer (8 bit, unsigned) b. Integer (16 bit, 2's complement) c. Single precision floating point d. Double precision floating point. explain in detail?
Explanation / Answer
Let's it understand with C code.
Here is the C program,
#include<stdio.h>
int main()
{
unsigned char A_8bit = 100;
unsigned char B_8bit = 100.001;
unsigned char Bw_8bit = 0.1;
printf(" Buliding A Height Stored in 8 bit Unsigned = %d",A_8bit);
printf(" Buliding B Height Stored in 8 bit Unsigned = %d",B_8bit);
printf(" Buliding B Width Stored in 8 bit Unsigned = %d ",Bw_8bit);
int A_16bit = 100;
int B_16bit = 100.001;
int Bw_16bit = 0.1;
printf(" Buliding A Height Stored in 16 bit Signed = %d",A_16bit);
printf(" Buliding B Height Stored in 16 bit Signed = %d",B_16bit);
printf(" Buliding B Width Stored in 16 bit Signed = %d ",Bw_16bit);
float A_float = 100;
float B_float = 100.001;
float Bw_float = 0.1;
printf(" Buliding A Height Stored in Single precision floating point = %f",A_float);
printf(" Buliding B Height Stored in Single precision floating point = %f",B_float);
printf(" Buliding B Width Stored in Single precision floating point = %f ",Bw_float);
double A_double = 100;
double B_double = 100.001;
double Bw_double = 0.1;
printf(" Buliding A Height Stored in Single precision floating point = %f",A_double);
printf(" Buliding B Height Stored in Single precision floating point = %f",B_double);
printf(" Buliding B Width Stored in Single precision floating point = %f ",Bw_double);
}
Output:
Buliding A Height Stored in 8 bit Unsigned = 100
Buliding B Height Stored in 8 bit Unsigned = 100
Buliding B Width Stored in 8 bit Unsigned = 0
Buliding A Height Stored in 16 bit Signed = 100
Buliding B Height Stored in 16 bit Signed = 100
Buliding B Width Stored in 16 bit Signed = 0
Buliding A Height Stored in Single precision floating point = 100.00000
Buliding B Height Stored in Single precision floating point = 100.00099
Buliding B Width Stored in Single precision floating point = 0.100000
Buliding A Height Stored in Single precision floating point = 100.00000
Buliding B Height Stored in Single precision floating point = 100.00100
Buliding B Width Stored in Single precision floating point = 0.100000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.