(20 Pts) An integer is 32 bits in length, what are the largest positive integer
ID: 3913049 • Letter: #
Question
(20 Pts) An integer is 32 bits in length, what are the largest positive integer and the smallest negative integer that can be represented by a signed 32-bit integer in decimal (base 10)? a. b. Write down the value of x obtained in below C program (all numbers in decimal): 32 bit signed integer on this processor long int a; // "long int" type long int b; long int x; a90; b-40; xat b; c. d. e. Would there be a carry when x is found? Why or why not? Would there be an overflow? Why or why not? What would be the value of x if addition is done under saturation arithmetic?Explanation / Answer
a. minimum = –2,147,483,648 , maximum = 2,147,483,647
The minimum value is obtained as -231 and the maximum as 231 - 1.
b. -130
c. Yes, there will be a carry as sum of tens places yields 13.
d. No, there would be no overflow as the numbers and their sum are well within range.
e. It would still be -130 as the permissible lower limit is -231.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.