In: Computer Science
Question 1
i) A binary system uses 8-bits to represent an analog value ranging from 120 ounces to 700 ounces, determine the resolution of the system and interprete your result.
ii) Determine the number of bits that would be needed for the above resolution to improve to better than 0.01 ounces per increment. Interpret your results.
iii) Use the binary coded decimal (BCD) representation of integers to represent each of the following integers.
2194
4576
7865
3947
3782
Question 1:
(i) We know, resolution of the system = analog range / (2n - 1)
Number of bits used by the system = n = 8
The range of the analog value varies from 120 to 700 ounces
So, we have:
Resolution of the system = (700 - 120) / (28 - 1)
or, Resolution of the system = 580 / (256 - 1)
or, Resolution of the system = 580 / 255
or, Resolution of the system = 2.274 units
(ii) Total increment = (700 - 120) ounces = 580 ounces
0.01 percent increment will add = (580 * 0.01) ounces = 5.8 ounces/inch (approximately)
So, the new resolution will be = (5.8 + 2.274) = 8.074
Let us consider, the number of bits = n
Resolution of the system = (700 - 120) / (2n - 1)
or, 8.074 = (700 - 120) / (2n - 1)
or, 8.074 = 580 / (2n - 1)
or, (8.074 * 2n) = 580 + 8.074
or, (8.074 * 2n) = 588.074
or, 2n = 72.83
or, n = 7 (as the ceil function is considered)
So, we can say that the number of bits required will be 7.
(iii) The decimal to Binary Coded Decimal (BCD) representation is shown below:
Decimal | Binary Coded Decimal (BCD) |
2194 | 0010 0001 1001 0100 |
4576 | 0100 0101 0111 0110 |
7865 | 0111 1000 0110 0101 |
3947 | 0011 1001 0100 0111 |
3782 | 0011 0111 1000 0010 |
Please comment in case of any doubt.
Please upvote if this helps.