Digital Circuit Analysis and Design with Simulink Modeling and Introduction to CPLDs and FPGAs, Second Edition

This chapter begins with an introduction to sign magnitude representation of binary numbers. We discuss floating point arithmetic for representing large numbers and the IEEE standard that specifies single precision (32 bit) and double precision (64 bit) floating point representation of numbers.
In a sign magnitude representation, the most significant digit (bit) is 0 for positive binary numbers and 1 for negative binary numbers. As we know, for large binary numbers it is more convenient to use hexadecimal numbers. In most computers, negative binary numbers are stored in twos-complement form.
Convert (+32749) 10 and ( ?32749) 10 into sign magnitude binary representation form.
Solution:
The conversions will result in large binary numbers and so it may be convenient to perform a decimal-to-hexadecimal conversion procedure as presented in Chapter 1 where we can find the hexadecimal equivalent by repeated division by 16. However, we will use the MATLAB conversion function dec2hex(d). This function converts the decimal integer d to a hexadecimal string with the restriction that d is a non-negative integer smaller than 2 52.
For (+32749) 10, dec2hex(32749) returns (7FED) 16=(0111 1111 1110 1101) 2 where the spaces were added to indicate the hexadecimal groupings. We observe that the most significant digit is 0 indicating that this is a positive binary number. Then,
For ( ?32749) 10, in binary sign form must have 1 for its most significant digit...