Hypothetical Computer Marc-32

floating pointnumber-systemsnumerical methods

I'm studying numerical analysis and i am stuck with one of my exercises. In the book "Numerical Analysis: Mathematics of scientific Computing" they introduce a hypothetical computer called MARC-32. In the book the computer is a 32-bits computer representing a nonzero real number with the form: x = ±q * 2^m

with the allocation:

  • sign of the real number x: 1 bit
  • biased exponent (integer e): 8 bits
  • mantissa part (real number f): 23 bits

marc-32

My problem is that i really do not understand the computer and hence can not solve the following problems:

Determine whether the following numbers are machine numbers in the Marc-32:

  • 10^40
  • 2^-1+2^-29
  • 1/3
  • 1/5

I have read the chapter a couple of times and still i don't get it. I really want to know what they mean by the hypothetical computer and how to solve it.

Best Answer

If you write $x$ in binary, it would looks something like this (as an example): $$x=1010011.011010010001_b$$ Then you convert it to the binary version of scientific notation: $$x = 1.010011011010010001_b \times 2^{110_b}$$

For this example,

  • The number is positive, so the sign bit would be $1$ (or possibly $0$, depending on the system architecture - for these problems, it doesn't matter which is used.)
  • The exponent $m = 6 = 110_b$. But we want to store positive and negative exponents in the eight bits, and there is no sign bit. So we bias the result by adding a value. 8 bits can store 256 different values, so if we alot half of them for negative exponents, that is 128. This means the range of allowable exponents is from $-128$ to $+127$. When the exponent is stored, we add $128$ so the value we store is from $0$ to $255$. For the example, the exponent stored is $110_b + 10000000_b = 10000110_b$.
  • The bit in front of the point is always $1$. This is what defines the exponent value. It is the exponent that brings the leading $1$ to be right in front of the "decimal" point. Since this bit is always $1$, there is no need to store it. The "mantissa" is the part of the number to the right of the point. In the example, the mantissa is $010011011010010001_b$. Since we have 23 bits, it is actually stored as: $$01001101101001000100000$$