A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Curry

  • one year ago

Can someone check my answer for this binary combo question?

  • This Question is Closed
  1. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    1 Attachment
  2. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    1. [-2^(n-1)+1, 2^n-1] 2. [-2^(n-1)+1, 2^n-1]

  3. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @wio

  4. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @ganeshie8

  5. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    Let \(n\) = 8 bits whats the largest positive number in 1's complement system ?

  6. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    um, 2^8?

  7. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    nope

  8. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    wait no, 2^8 - 1

  9. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    no no, 2^7 -1

  10. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    Yes, \(\large 2^7-1\) is the largest number in 1's complement system using 8 bits : \[\large 2^7-1~~=~~0111 ~1111\]

  11. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    wait, actually i'm kinda confused about that to begin with.

  12. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    what exactly are you confused about ?

  13. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so, if i have 0000 0000, in one's compliment, cant i write 1111 1111?

  14. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    thats the reason 1's complement system sucks, we have two different representations for 0 in this system : ``` 0000 0000 ``` and ``` 1111 1111 ``` both represent the same number 0 in this system

  15. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    oh ok, so 1 is the smallest number i can write that can be converted to one's complement so that it bcomes the largest?

  16. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    I don't get you, could you elaborate a bit

  17. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    since i'm flipping the bits, the smallest number i write in binary would give me the greatest number in one's complement right?

  18. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    you don't flip bits when the left most bit is 0

  19. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    you flip only when the left most bit is 1

  20. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    oh beacuse it's positive?

  21. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    yes

  22. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so one's complement only works when we're dealing with signed magnitude numbers?

  23. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    signed magnitude has nothing to do with 1's complement

  24. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    well unsigned is always positive isn't it?

  25. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so it has to be a negative number for one's complement to have an effect right?

  26. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    You maybe correct but I'm not getting you First notice that "one's complement of a number" and "ones complement system" are two different things

  27. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    In "one's complement system", binary strings with 0 as left most bit are treated as positive binary strings with 1 as left most bit are treated as negative

  28. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    for example, `010 0000` is a positive number because the left most bit is `0` `1000 0000` is a negative number because the left most bit is `1`

  29. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so how is it different frmo signed magnitude system?

  30. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    isnn't signed magnitude the same thing? where 0 is positive and 1 is negative?

  31. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    before answering that, let me ask you two simple questions : what are the values of `0100 0000` in 1's complement and signed magnitude ? what are the values of `1000 0000` in 1's complement and signed magnitude ?

  32. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    for the first one: one complement = 0100 0000 signed magnitude = 64 second one: one complement = 1111 1111 signed magnitude = 0 ?

  33. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    tell me all the values in decimal form

  34. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    for the first one it'll be 64 both times. second: -64, 0

  35. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    you're correct about first one being 64 in both systems second one is wrong, try again

  36. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    wait positive 64 and 0.

  37. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    what are the values of `1000 0000` in 1's complement and signed magnitude ? #1's complement system : since the left most bit is `1`, we need to take 1's complement of this for the value and put minus sign. 1's complement = 0111 1111 = 127 so the value is \(\large -127\) #signed magnitude system : since the left most bit is `1`, the value is simply \(\large -0\)

  38. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    so what do you notice ? what exactly is the difference between '"ones complement system" and "signed magnitude system" ?

  39. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    http://gyazo.com/ee939ee2e32939bec143ee78b1d6afd1

  40. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    well just with respect to the left most bit, it's the same for positive numbers.

  41. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    OOO! so if i have a binary number, and if it's positive, for one/two complement and signed magnitude, it'll be the same.

  42. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    if there is a one in front of the binary, then i flip all the bits, calculate new decimal value, and add negative number.

  43. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    and for two's compliment, i write teh number as positive first, flip all the bits, and add 1.

  44. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    do i have this right?

  45. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    Exactly!

  46. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    coming back the original question, whats the smallest number in 1's complement system using 8 bits ?

  47. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    -127?

  48. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    Yes \[-127 = 1000~0000\] this is the smallest number in 1's complement system using 8 bits

  49. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    using \(8\) bits, it seems we can express the numbers from \(-(2^{7}-1)\) to \(2^7-1\) ?

  50. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    yes.

  51. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so for the biggest number would it be, 1111 1110?

  52. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    left most bit = 1, so thats a negative number think a bit, how can a negative number be the biggest ?

  53. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    no 1111 1110 is in one's complement. so in just binary, it'd be 0000 0001.

  54. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    1111 1110 = -1

  55. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    how do you say -1 is the biggest number ?

  56. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so if it doesn't matter when it's a positive number, would it be 0111 1111, which is 128?

  57. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    sorry, 127.

  58. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    thats right, 127 is the biggest number using 8 bits in 1's complement system

  59. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    oh so it's just that simple? 1111 1111 , 0111 1111?

  60. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    How would I do it for tw's complement? or should i post this as a new question?

  61. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    wait, ``` oh so it's just that simple? 1111 1111 , 0111 1111? ``` what are you trying to say here

  62. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    so in one's complement, to find the greatest and smallest number given n bits, it's always 2^(n-1) -1

  63. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    wait positive and negative 2^(n-1) -1.

  64. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    thats right, but what has that do with `1111 1111 ` ?

  65. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    `1111 1111 ` = 0 right

  66. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    oh sorry, i meant 1000 0000.

  67. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    now that makes sense, yeah `1000 0000` is the least number and `0111 1111` is the max number in 1's complement system using 8 bits

  68. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    oh ok, this makes a lot of sense now, thanks!!

  69. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 3

    good, sry to ask too many questions but do you happen to know why signed magnitude is not so good for representing numbers in a computer ?

  70. Curry
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    no, i don't. why?

  71. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.