Convert a negative integer to binary using Two's Complement.

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 80

  • @BigBangLuv3r
    @BigBangLuv3r 3 года назад +31

    Thank you so much I was stuck on this and your explanation was the easiest to understand.

  • @Yosanloko
    @Yosanloko Год назад +9

    your explanation is really good, you're the best teacher I've ever seen

  • @blainemartin7437
    @blainemartin7437 2 года назад +7

    This was the best breakdown of twos complement I've seen... THANK YOU!!!!

    • @jcchurch
      @jcchurch  2 года назад +1

      Happy to help. Have a great day.

  • @zakariya5106
    @zakariya5106 Месяц назад +1

    This helped me alot, you saved me from my test bro I cannot thank you enough.😀

  • @slippywhenwet7435
    @slippywhenwet7435 3 года назад +15

    This was so easy to understand!! THANK YOU!!!

  • @ramonjales9941
    @ramonjales9941 8 месяцев назад +5

    I am from Brazil and i had to search in english to find a tutorial simple and beautiful

    • @jcchurch
      @jcchurch  7 месяцев назад +1

      You should create the Portuguese version of this video to help others in Brazil. I'm glad this video helped you.

    • @ramonjales9941
      @ramonjales9941 7 месяцев назад

      @@jcchurch sure! Can i use your vídeo?

    • @jcchurch
      @jcchurch  7 месяцев назад +1

      @@ramonjales9941Sure. FIgure out a way to download this video and record over the audio with your own.

    • @ramonjales9941
      @ramonjales9941 7 месяцев назад

      @@jcchurchthank you!

  • @arslanraza4142
    @arslanraza4142 Месяц назад

    Bro is saving lives even after 5 years , Cheers Mate !

    • @jcchurch
      @jcchurch  Месяц назад

      @@arslanraza4142 I try. Thank you.

  • @zorawarsinghboparai
    @zorawarsinghboparai Год назад +3

    Thank you 🙏 best explanation I’ve heard on this topic.

  • @bobb3
    @bobb3 Год назад +2

    great video, hope you know youre saving students everyday

  • @MarioRodriguez-bi9me
    @MarioRodriguez-bi9me 2 года назад +2

    THANK U SO MUCH, THE OTHER VIDEOS REALLY BE DOING THE MOST. I HOPE MORE PEOPLE FIND THIS VIDEO IF THERYE STRUGGLING

  • @willardmwape1065
    @willardmwape1065 6 месяцев назад

    As simple as it is it has really helped me. God bless you

  • @HIDlarissaTERRY
    @HIDlarissaTERRY 5 лет назад +5

    Thank you james! Truly appreciate timing !

    • @jcchurch
      @jcchurch  5 лет назад +4

      Glad you like my super short video.

  • @misstiwari00
    @misstiwari00 Год назад +1

    thank you i had this confucius for a long time

  • @baconpancakes8899
    @baconpancakes8899 Год назад +2

    You made my life easy

  • @OfficialBoominBeats
    @OfficialBoominBeats Год назад +1

    thank you sir

  • @fanti4372
    @fanti4372 Год назад +1

    Two's complement made EASY!👍

  • @shawnlambert5604
    @shawnlambert5604 9 месяцев назад +1

    GOAT

  • @dhammikawickramanayake3580
    @dhammikawickramanayake3580 Месяц назад +1

    Hi! How to convert two's complement number back to denary with the same number (-57)?

    • @jcchurch
      @jcchurch  Месяц назад +1

      Sure. I can do that.

  • @nickthewinner2194
    @nickthewinner2194 5 лет назад +4

    so so soo helpful and short. Prosper

    • @jcchurch
      @jcchurch  5 лет назад +2

      Thank you, thank you. I try. Should I do now super short videos?

  • @witnessdube-b5m
    @witnessdube-b5m 15 дней назад +1

    this is good i enjoyed

  • @KingsleyRobertson
    @KingsleyRobertson Год назад +1

    Simple and understandable😎👌

  • @mahisarpal4328
    @mahisarpal4328 4 года назад +2

    thanks so much for a brilliant video

  • @ESEben10
    @ESEben10 4 года назад +3

    why did you add the dash 128 if we can represent 57 only with 6 bits(only until dash 64)?

    • @jcchurch
      @jcchurch  4 года назад +5

      A full byte is 8 bits. That's all.

  • @rafalzasada8826
    @rafalzasada8826 3 года назад +2

    Worth to add that bit 7 (MSB) is not 128, it's a sign bit. Otherwise it might be confusing, e.g. how would you convert -150 into binary?

    • @jcchurch
      @jcchurch  3 года назад +1

      Well, you can't. That's not in the spec for 8 bits.

    • @davidomar742
      @davidomar742 3 года назад +1

      2's compliment doesn't use a sign bit.

  • @BlueDoggy
    @BlueDoggy 3 года назад +2

    help how do u convert -18 into binary because the binary of 18 is 10010 but if I do your trick it will become 11101101 and its wrong

    • @jcchurch
      @jcchurch  3 года назад

      Step 1: +18 is 00010010
      Step 2: ~18 is 11101101
      Step 3: ~18+1 is 11101110
      Looks like you missed the last step, which is to add 1 to the flip of all the bits.

    • @BlueDoggy
      @BlueDoggy 3 года назад

      @@jcchurch wow ok thanks!

    • @totallyrayanyt
      @totallyrayanyt Месяц назад

      so it is like adding 11101110+00000001?

  • @prathish3169
    @prathish3169 2 года назад +1

    Nicely Explained

  • @promaster1289
    @promaster1289 Год назад +1

  • @indistantdreams
    @indistantdreams Год назад +1

    Short but to the point

    • @jcchurch
      @jcchurch  Год назад +1

      I could have included the story about how this was my grandmother's favorite way to encode integers from the old country.

  • @totallyrayanyt
    @totallyrayanyt Месяц назад

    bro saaved my lfe

  • @udayy4448
    @udayy4448 2 года назад +1

    thank you so much

  • @creatorz6739
    @creatorz6739 2 года назад +1

    thanks man !

  • @tareq5264
    @tareq5264 2 года назад +1

    bro. bro BROO thank you so muchh!

    • @tareq5264
      @tareq5264 2 года назад +1

      straight direction to the point no zig zagging

    • @jcchurch
      @jcchurch  2 года назад

      @@tareq5264 Yeah. I wanted to cut to the chase.

  • @lowkeycam9151
    @lowkeycam9151 Год назад +1

    Tysm!

  • @vallalamadhuviratian1894
    @vallalamadhuviratian1894 2 года назад +1

    Thank you easy pizi

  • @marwanalaghbry1171
    @marwanalaghbry1171 11 месяцев назад

    how can I know if the binary code represents a negative numbers ? and how can Convert it to decimal again

    • @jcchurch
      @jcchurch  11 месяцев назад

      You know because you intended to store a binary sequence as two's complement.

  • @tocolanka
    @tocolanka 3 года назад

    What if we get a 1 at the end,so do we still need to add a 1 to it

    • @jcchurch
      @jcchurch  3 года назад +1

      Well, you do what you normally do in addition: add 1 to 1, which is "10" in binary. You write down 0 into the blank and carry the 1 to the next column of digits.

  • @danishijaz845
    @danishijaz845 2 года назад +1

    hi. how would you convert -74 to 16 bit binary? Thanks

    • @jcchurch
      @jcchurch  2 года назад

      Do the same basic steps, just with 16 dashes instead of 8:
      +74: 0000000001001010
      ~74: 1111111110110101
      ~74+1: Add one to the previous number. I'll let you figure this out since I don't want to give out homework answers. :)

  • @flmxahmy8310
    @flmxahmy8310 2 года назад +1

    Tysm

  • @aourose
    @aourose 10 месяцев назад

    Hi first step how to get 01 first line

  • @gauravghimire662
    @gauravghimire662 3 года назад

    Hi how do you convert -333 into binary(16bit)? Plz help

    • @jcchurch
      @jcchurch  3 года назад

      1. Draw 16 blanks instead of 8.
      2. Number them from 1 to 32,768 under all 16 blanks. (I do this from 1 to 128 in my video).
      3. Figure out the binary for +333.
      4. Flip all the bits.
      5. Add 1 to that result.

    • @gauravghimire662
      @gauravghimire662 3 года назад +1

      @@jcchurch Thnx mate. I finally understand it.

  • @Daniel-tg8wm
    @Daniel-tg8wm 2 года назад +1

    thx

  • @hussein2698
    @hussein2698 2 года назад +1

    Thank uuuuuuuuuu

  • @zr60
    @zr60 2 года назад +1

    why is it 8 dashes?

    • @jcchurch
      @jcchurch  2 года назад

      There are 8 bits in one byte. If you want to support larger numbers, you'll need to go up to 16 bits, 32 bits, or 64 bits.

  • @oo7.109
    @oo7.109 3 года назад +1

    Why add 57 with 1

    • @jcchurch
      @jcchurch  3 года назад

      Those are just the steps to two's complement. There are longer videos on this topic that get into the "why".

  • @krypton1142
    @krypton1142 2 года назад +1

    Legend😅

  • @sijokuriakose3895
    @sijokuriakose3895 2 года назад

    isn't -57 two's complement ==> 0011 1001 ?

    • @jcchurch
      @jcchurch  2 года назад +1

      "0011 1001" is +57.

  • @WembaEditz
    @WembaEditz Год назад +1

    YAY

  • @sasdos6670
    @sasdos6670 15 дней назад

    banger

  • @phantmspisn9859
    @phantmspisn9859 8 месяцев назад +1

    Sorry, but this is wrong, you forgot to substract 1 from 57, than switch 1 and 0

    • @jcchurch
      @jcchurch  8 месяцев назад +2

      The math works out either way.

    • @swethakaki
      @swethakaki 3 месяца назад

      Right