Question

I'm trying to understand why my calculation is giving different answer than the book.

The question ask what is the sum of A & B if they represent unsigned 12-bit octal numbers?

A=3174 and B=0522

Below is my approach to the problem:

1. 3174 octal = 011001111100 (unsigned 12 bits)
   0522 octal = 000101010010 (unsigned 12 bits) 
          sum = 011111001110 (unsigned 12 bits)

Second approach I added the two octal number straight no need converting to binary

3174 octal+0522 octal= 3716 octal (answer must be in octal). 

But I don't get it how the book ended getting 7620 confused // this is in MIPS programming

Was it helpful?

Solution

This is exercise 3.1.1 of Computer Organization and Design, Revised 4th Edition.

Your math is correct. Check it with Wolfram Alpha.

31748 + 05228 = 37168

The solutions guide for the book says the answer is 7620. (That's what I can make out through the blur over page 68 on scribd.)

Of the four numbers in the table for that exercise, there is no pair that sums to 76208 or 762010, whether you interpret the numbers in the table as octal or decimal. The solutions guide is either wrong, or using a very obscure interpretation of the question.

Here's the Mathematica code I used to verify:

inputs = {3174, 0522, 4165, 1654, 8^^3174, 8^^0522, 8^^4165, 8^^1654}
Table[{i + j, BaseForm[i + j, 8]}, {i, inputs}, {j, inputs}] // Flatten // Sort // TableForm
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top