[Digital Logic]1's compliment question

7 views
Skip to first unread message

Varun Shinde

unread,
Feb 8, 2010, 2:36:17 PM2/8/10
to VANI_GATE_CS_2010
1's Complement of (0.0110) base -2

a) 1.1001 b) 1.0110 c) 0.1001 d) 0.1010

the answer to this question is C....why the exponent part is not
complimented....

amol bhangdiya

unread,
Feb 9, 2010, 12:40:36 AM2/9/10
to vani_gat...@googlegroups.com
general method for (r-1) complement for ( base r ) number N is
r^n-r^(-m)-N
where n number of integer part (which is 0 in above case) and m is
number of fractional part(4 in above case)
so ans is 0.1001

shripad sarade

unread,
Feb 9, 2010, 1:52:39 AM2/9/10
to vani_gat...@googlegroups.com
@Amol
can you explain complement of 1.0110

In this case
n=0
m=4
N=0.0110

complement value = 2^0 - (2^(-4)) - 0.375
= 1 - 0.0625 - 0.375
= 0.5625
=0.1001 base 2

if N = 1.0110
n=1
m=4
complement value = 2^1 - (2^(-4)) - 1.375
= 2 - 0.0625 - 1.375
= 0.5625
=0.1001 base 2

so complement of 0.0110 and 1.0110 is coming same.
I think i have made mistake taking 1.0110 = 1.375
whether it should be -0.375
but then ans will be
= 2 - 0.0625 + 0.375
= 2.3125
=010.0.01 base 2

Somewhere I am wrong in calculation.
Can you explain complement of 1.0110

Varun Shinde

unread,
Feb 9, 2010, 2:18:53 AM2/9/10
to VANI_GATE_CS_2010
@amol
hey plz elaborate why u wrote......i am nt getting that....
@shripadsarade
N=0.0110...why u wrote 0.375..means is this is decimal equivalent of
0.0110..


On Feb 9, 11:52 am, shripad sarade <shripad.sar...@gmail.com> wrote:
> @Amol
> can you explain complement of 1.0110
>
> In this case
> n=0
> m=4
> N=0.0110
>
> complement value = 2^0 - (2^(-4)) - 0.375
> = 1 - 0.0625 - 0.375
> = 0.5625
> =0.1001 base 2
>
> if N = 1.0110
> n=1
> m=4

> complement value = 2^1 - (2^(-4))* - 1.375*


> = 2 - 0.0625 - 1.375
> = 0.5625
> =0.1001 base 2
>
> so complement of 0.0110 and 1.0110 is coming same.
> I think i have made mistake taking 1.0110 = 1.375

> whether it should be *-0.375*


> but then ans will be
> = 2 - 0.0625 + 0.375
> = 2.3125
> =010.0.01 base 2
>
> Somewhere I am wrong in calculation.
> Can you explain complement of 1.0110
>
>
>
> On Tue, Feb 9, 2010 at 11:10 AM, amol bhangdiya <amol....@gmail.com> wrote:
> > general method for (r-1) complement for ( base r ) number N is
> > r^n-r^(-m)-N
> > where n number of  integer part (which is 0 in above case) and m is
> > number of fractional part(4 in above case)
> > so ans is 0.1001
>

shripad sarade

unread,
Feb 9, 2010, 6:05:58 AM2/9/10
to vani_gat...@googlegroups.com
yes...
0.0110
= 0*0.5 + 1*0.25  + 1*0.125 + 0*.0625
= .25  + .125
=0.375

Mayur Mahrotri

unread,
Feb 9, 2010, 10:33:35 AM2/9/10
to vani_gat...@googlegroups.com
Hi,

This is a spooky question. First of all, why are we considering that trailing zero in 0.0110. We should consider 0.011, right ?

Also, don't you think, the first 0 before the radix point in 0.0110 will be counted as a number of bits before the decimal point = n. i.e. in 0.0110 also, the value of n will be 1 ? I am not sure about this, though!!

If i do that, then, for 0.0110

n=1
m=3

For 0.0110
1's compliment = 2^1 - 2^-4 - 0.0110
                       = 10.0000 - 0.0001 - 0.0110
                       = 1.1111 - 0.0110
                       = 1.1001
                       = option (A)

For 1.0110
1's compliment = 2^1 - 2^-4 - 1.0110
                       = 10.000 - 0.0001 - 1.0110
                       = 1.1111 - 1.0110
                       = 0.1001

This even agrees with 1's complement definition, which is to invert all the bits, which i think you should be following. :)


On Tue, Feb 9, 2010 at 12:48 PM, Varun Shinde <varunsh...@gmail.com> wrote:



--
With Regards,
Mayur.

Mayur Mahrotri

unread,
Feb 9, 2010, 10:34:22 AM2/9/10
to vani_gat...@googlegroups.com
Sorry, i considered below m=4. :)
--
With Regards,
Mayur.
Reply all
Reply to author
Forward
0 new messages