Assembly Language NASM The floating-point format to be used in this problem is a
ID: 3839334 • Letter: A
Question
Assembly Language NASM
The floating-point format to be used in this problem is an 8-bit "IEEE 754" normalized format with 1 sign bit, 4 exponent bits, and 3 mantissa bits. It is identical to the 32-bit and 64-bit formats in terms of the meaning of fields and special encodings. The exponent field employs an excess-7 coding. The bit fields in a number are (sign, exponent, mantissa). Assume that we use unbiased rounding to the nearest even specified in the IEEE floating point standard. A.) Encode the following numbers in the 8-bit "IEEE" format: (1) 0.0011011_binary (2) 16.0_decimal B.) Perform the computation 1.011_binary + 0.0011011_binary. There are three mantissa bits.Explanation / Answer
As we have only 8-bit to represent the floating point, the precision is also limited. And also, one thing to keep in mind that our 8-bit can represent a limited set of numbers, i.e. 28 = 256 distinct values and there are so many real number values in between to represent, hence it is low in precision. So, let's get started with the solution:
A.1 --> 0.0011011binary
As this is already in binary, let't normalize it.
1.1011 x 2-3 --> Our sign bit is 0 here, and Mantissa: 1011 which can be rounded to 110
Exponent: 7 + (-3) = 4 = 0100
Hence, result is 0 0100 110
A.2 --> 16.0decimal
Convert --> 10000 --> binary
Normalize --> 1.0000 x 24
Mantissa: 000
Exponent: 7 + 4 = 11 = 1011
Sign Bit: 0
Hence, result is 0 1011 000
B. 1.011binary + 0.0011011binary
We add them with simple addition procedure, result is --> 1.1001011binary
It is already normalized 1.1001011 x 20
Mantissa: 100 --> overflow of digits
Exponent: 7 + 0 = 7 = 0111
Sign Bit: 0
Hence, result is 0 0111 100
One thing to keep in mind, computer don't "round up" all the time i.e. why unbiased rounding is specified ! Ask questions in the comment section !
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.