edited by
8,105 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$
edited by

2 Answers

Best answer
51 votes
51 votes
$(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
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

Answer:

Related questions

31 votes
31 votes
3 answers
1
0 votes
0 votes
0 answers
2
42 votes
42 votes
4 answers
3
Kathleen asked Sep 25, 2014
9,992 views
What happens when a bit-string is XORed with itself $n$-times as shown:$\left[B \oplus (B \oplus ( B \oplus (B \dots n \text{ times}\right]$complements when $n$ is evenco...
23 votes
23 votes
3 answers
4
Kathleen asked Sep 26, 2014
4,985 views
Design a synchronous counter to go through the following states:$$1, 4, 2, 3, 1, 4, 2, 3, 1, 4 \dots $$