in Digital Logic edited by
8,130 views
31 votes
31 votes

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. $226$
  2. $-98$
  3. $76$
  4. $-30$
in Digital Logic edited by
8.1k views

1 comment

Important line: If this were to be treated as an eight-bit integer in an 8085

0
0

2 Answers

51 votes
51 votes
Best answer
$(3\; 4\; 2)_8 = (011 \; 100 \; 010)_2 = (11100010)_2.$

If we treat this as an 8 bit integer, the first bit becomes sign bit and since it is "1", number is negative. 8085 uses 2's complement representation for integers and hence the decimal equivalent will be $-(00011110)_2 = -30.$

Correct Answer: $D$
edited by
by

4 Comments

8 bit integer ===> all integers are 8 bits,

if it isn't signed, then we can't represent -ve integers, therefore it should be signed number.
6
6
But where it is mentioned that numbers are stored n 2's complement representation ?

Is it by default ??
0
0
given that, implemented in computer ===> 2's complement representation.
5
5
14 votes
14 votes

First, write for each decimal equivalent binary code :

since 8 = 23

write each digit in 3-bit binary 

(342)8 = (011 100 010)2  ignore initial zero 

(342)8 = (226)10 = (11100010)2

since all processor use 2's complement number system(2's complement number system is weighted number system)

so 11100010 is a negative number

11100010 = 100010 = -25 + 2 = -30

correct answer D

1 comment

nice explanation
1
1
Answer:

Related questions