Is this a mistake in my book Computer Architecture?

I am working on my HW for computer architecture, and I ran into the following problem:

A = 247
B = 237

1) Assume that A and B are 8-bit integers stored in two additional formats. Calculate A + B using saturating arithmetic. The result must be written in decimal. Show your work. 2) Assume that A and B are 8-bit integers stored in two compelemnt formats. Calculate A - B using saturating arithmetic.

Now, how are these issues really relevant? I know what saturating arithmetic is, but how to correctly say that A is 247 and B is 237 if they cannot be represented by the 8-bit number of two additions?

I understand that the point of saturated arithmetic in case of overflow / insufficient stream is to set all bits to the extreme value, but it makes no sense to ask a number of questions (there are three more with the same problem) using arithmetic of numbers that cannot be represented in the specified format.

Am I wrong here?

+5
source share
4 answers

The only interpretation that makes sense is that the values ​​given are an unsigned interpretation of the number in question; values ​​greater than 127 are obviously out of range for the 8-bit signed value of the two-component. I agree that this question is poorly worded.

+8
source

, : " 237 8- . 8- 2 ".

, C:

char a = 237;
printf("%x %d\n",a, a);

, , 2- 8- "237"

+3

. 8- -128 127. 237 247 8- .

+1

, ", A B 8- ", . A = 247 8- -9, B = 237 -19. . 8- 247 237.

0

All Articles