The octal representation of an integer is (342)8. If this were to be treated…

1998

The octal representation of an integer is (342)8. If this were to be treated as an eight bit integer in an 8085 based computer, its decimal equivalent is

  1. A.

    226

  2. B.

    -98

  3. C.

    76

  4. D.

    -30

Attempted by 19 students.

Show answer & explanation

Correct answer: D

To find the decimal equivalent of the octal number (342)8 treated as an 8-bit signed integer in an 8085-based microprocessor, we follow these steps:

1. Convert Octal to Binary (8-bit)

Each octal digit maps directly to a 3-bit binary group:

  • 3 011

  • 4 100

  • 2 010

Combining them gives the 9-bit string: 011 100 010.

Since the 8085 architecture processes 8-bit integers, we keep only the 8 least significant bits (LSBs):

Binary representation = 11100010

2. Identify the Sign of the Number

  • The Most Significant Bit (MSB) is 1, which indicates that this is a negative number stored in 2's complement form.

3. Calculate the Decimal Value

To find the magnitude of a negative 2's complement number, we find its 2's complement again:

  1. Invert the bits (1's complement): 00011101

  2. Add 1: 00011101 + 1 = 00011110

Converting 00011110 to decimal:

(1 × 24) + (1 × 23) + (1 × 22) + (1 × 21) = 16 + 8 + 4 + 2 = 30

Since the original MSB was 1, the value is -30.

Explore the full course: Gate Guidance By Sanchit Sir