The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+16 votes
1.9k views

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$
asked in Digital Logic by Veteran (59.7k points)
edited by | 1.9k views

2 Answers

+24 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.$
answered by Veteran (367k points)
selected by
0

Sir, why haven't you considered 0 ( 011100010 ) as the sign bit? I calculated the answer as 226.

0
they said its 8 bit integer
+1
Yes, I missed it. Thanks
0
@arjun_sin, it is not mentioned anywhere in question, first bit will be signed bit, i am confused here when we consider 1st bit is signed bit and when we ignore 1st bit
+1
In this question they have mentioned 8bit integer in an 8085 therefore we are considering 8 bit from LSB to MSB, if nothing is mentioned then we have to consider it as a +ve number.
0
can uh tell me meaning of 8085 based computer,
0

https://en.wikipedia.org/wiki/Intel_8085 

Main thing is we have to take 8 bit from LSB to MSB 

0
@Arjun @ Arjun

Sir , why we are considering it as signed no?
+1
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.
0
But where it is mentioned that numbers are stored n 2's complement representation ?

Is it by default ??
0
given that, implemented in computer ===> 2's complement representation.
+1 vote

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

answered by (367 points)
0
nice explanation
Answer:

Related questions

0 votes
0 answers
7
asked Sep 26, 2014 in CO & Architecture by Kathleen Veteran (59.7k points) | 200 views


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,054 questions
49,578 answers
162,837 comments
65,775 users