Important Q/A (Computer)
1. What is the primary purpose of the ASCII encoding scheme?
The ASCII (American Standard Code for Information Interchange) encoding scheme is used to represent characters as numerical values, allowing computers to store and manipulate text using standard codes.
2. Explain the difference between ASCII and Unicode.
ASCII is a 7-bit encoding system that represents 128 characters, mainly for English text. Unicode is a universal character encoding standard that supports thousands of characters from multiple languages and symbols using 8, 16, or 32 bits. 3.
How does Unicode handle characters from different languages?
Unicode assigns a unique code point to every character, regardless of language or platform, making it possible to represent text from different languages in a consistent way
4. What is the range of values for an unsigned 2-byte integer?
An unsigned 2-byte (16-bit) integer can represent values from 0 to 65,535 since it does not use any bits for sign representation.
5. Explain how a negative integer is represented in binary.
Negative integers are commonly represented using two's complement, which involves inverting the binary digits of the number and adding 1 to the result.
6. What is the benefit of using unsigned integers?
Unsigned integers can represent a larger range of positive numbers than signed integers using the same number of bits because all bits are used for the magnitude.
7. How does the number of bits affect the range of integer values?
The number of bits determines how many values can be represented. More bits mean a larger range. For example, 8 bits can represent 256 values (0-255 for unsigned).
8. Why are whole numbers commonly used in computing for quantities that cannot be negative?
Whole numbers or unsigned integers are used in such cases (e.g., file sizes, array indexes) because negative values would not make logical or practical sense.
9. How is the range of floating-point numbers calculated for single precision?
In single precision (32-bit) format, floating-point numbers use 1 bit for sign, 8 bits for exponent, and 23 bits for the fraction (mantissa). This provides a wide range of values, approximately from 1.4 x 10^-45 to 3.4 x 10^38.
10. Why is it important to understand the limitations of floating-point representation in scientific computing?
Because floating-point numbers cannot represent all real numbers exactly, understanding their limitations helps avoid rounding errors, precision loss, and inaccurate results in scientific calculations.
Comments
Post a Comment