Binary Subtraction Tutorial

Поділитися
Вставка
  • Опубліковано 5 лют 2025
  • An example of binary subtraction. Subtraction in binary works like subtraction in decimal. In some ways it is even easier because there are less "cases" of what we need to do. This method, however, becomes obsolete when we switch to subtracting using two's complement negative numbers.

КОМЕНТАРІ •

  • @lukevickers204
    @lukevickers204 5 років тому +869

    who'd have thought a 1:1 ratio, potato quality video from 9 years ago would teach me beautifully in 3 minutes

  • @pandalover555
    @pandalover555 9 років тому +519

    My prof went over this for an hour, never got it... and then you taught me in 5 min haha thank you!

  • @seporokey
    @seporokey 10 років тому +202

    FINALLY someone does a clear example with borrowing! Thank you!

  • @fakrulotaku5655
    @fakrulotaku5655 11 місяців тому +19

    Watching this in 2024, 13 years after the upload and this tutorial was the only one which I found useful. Thanks a lot sir ❤

  • @owususekyerenana4827
    @owususekyerenana4827 2 роки тому +25

    I had just started primary school when you posted this video. Now, I'm at university watching it. Thank you very much :)

  • @AdriannaAnandan
    @AdriannaAnandan Рік тому +7

    after 12 years ur video is saving lifes

  • @remixisthis
    @remixisthis 3 роки тому +28

    Great way of explaining borrow as two 1s. I spent 15 minutes stuck on another video that explained it a different way, and got it within less than a minute with your video!

  • @The_guy_who_asked
    @The_guy_who_asked 2 роки тому +3

    Bruh we spent like 5 periods learning binary subtraction and here you are making it clear as the difference between day and night in 5 minutes

  • @iniubong
    @iniubong 6 місяців тому +5

    3 minutes in and everything I'd been struggling to understand became so clear to me

  • @sneakyboii732
    @sneakyboii732 Рік тому +1

    man hearing that type of mic after all these years, it brings me such nostalgia. Thank you for the tutorial

  • @jayyzee5708
    @jayyzee5708 9 років тому +12

    I've seen many videos on subtracting binary, and this one was, by far, the most straightforward with less fluff and complexity.
    thankyou

  • @Rhalmarius
    @Rhalmarius 13 років тому +63

    I was so confused with this and your explanation really helped me out. Thank you, and again, thank you.

  • @michaelyuabov5056
    @michaelyuabov5056 Рік тому +6

    Nah bro is goated in teaching binary subtraction

  • @BangMaster96
    @BangMaster96 6 років тому +9

    My Assembly Language professor spent an entire lecture going over Binary addition, and subtraction,
    yet he failed to explain it.
    And here you are, making it clear as sky in 5 minutes.

    • @KingFaizDubai
      @KingFaizDubai 2 роки тому +2

      the sky is kind of cloudy for me right now tho

  • @xx_gamer_xx8315
    @xx_gamer_xx8315 3 роки тому +30

    11 years later and still very usefull, thank you!

  • @frishdaw
    @frishdaw 13 років тому +33

    Thank you so much for this explanation. My CS 350 course text has a terrible explanation for binary subtraction, and you have really cleared it up. Awesome!

  • @MichaelOfRohan
    @MichaelOfRohan 11 місяців тому +1

    this is the most windows-xp-on-a-toughbook thing ive seen in a while. thanks for the upload!!

  • @gopalmali8653
    @gopalmali8653 5 років тому +4

    Wow, you taught me it in less than a minute which I was trying to crack since an hour. Hats off to you sir.

  • @dillanmistry
    @dillanmistry 2 роки тому +1

    SIR, you YOU, just taught me perfectly 2 days before the exam and i was so lost on this, you legend

  • @Shibshankar_Roy
    @Shibshankar_Roy 11 місяців тому +1

    Ok the quality of the video might be bad but he really explained this thing beautifully..

  • @sunjaykumarsingh7908
    @sunjaykumarsingh7908 5 років тому +25

    I always had confusion in binary subtraction😓
    But after watching this video I can easily do binary calculation 🤓
    You are good teacher!
    Thx for sharing quality content🔥🔥

  • @Bhaktisanatan101
    @Bhaktisanatan101 9 місяців тому +1

    My teacher spend a freaking 2hrs to teach this and never got it but you taught in 5mins clearly😊😂😂😂

  • @dillanmistry
    @dillanmistry 2 роки тому +2

    You have a special place in heaven, teachers never taught me this and i just realised how simple it is W

  • @jyslakay
    @jyslakay 12 років тому +2

    THANK YOU SO MUCH. Saved me for my exam tomorrow. My lecturer didn't explain the borrowing concept of "two 1s" properly.

  • @Naruto_X-op.
    @Naruto_X-op. 9 місяців тому +1

    My tuition and c school teachers took 4 f**king hours to taught it but i dont understand it but you, you taught be in only five minutes and i understand clearly
    And is anyone in 2024

  • @bandanadebnath3497
    @bandanadebnath3497 7 місяців тому

    Even after my teachers and friends showed me multiple times how to do this I still couldn't solve one equation correctly but this video made me understand in just 1 second. Love this video!❤❤

  • @lordenglish2654
    @lordenglish2654 5 років тому +1

    You, sir, are a gentleman and a scholar. Thank you very much.

  • @PRIYANSHRASIKKUMARKOTADIASVNIT
    @PRIYANSHRASIKKUMARKOTADIASVNIT 3 місяці тому

    i was in kindergarden when you posted this and now i am watching this for my comp sci degree

  • @yasser28000
    @yasser28000 10 місяців тому +1

    he posted this when i was 7 who knew he would help me 13 years later

  • @thomasw.eggers4303
    @thomasw.eggers4303 3 роки тому +2

    The video is very good. I thought I could add some details for the truly nerdy, and for those who have an interest in how computer hardware does binary arithmetic, particularly subtraction. If you are new to binary, I suggest you skip this posting.
    There needs to be a way to represent negative numbers. There are three common ways:
    (1) Sign magnitude
    (2) One's complement
    (3) Two's complement; this is by far the most common, and the description follows:
    All of the explanation will be given assuming 4-bit words. Extending the description to
    32 bits (or n bits) is left as an exercise for the reader. (LOL, don't you just hate
    it when instructors say that?)
    The 4 bits have the weights: -8, +4, +2, and +1. Note:
    --- Only the left most bit (the sign bit, the most-significant-bit MSB) has a negative weight;
    All the other bits have positive weights.
    --- If you set any bit to a 1 (except for the sign bit), the number becomes more positive (or less negative).
    --- The zero value is represented by 0000
    --- All ones, 1111, has the value -1. (Since -8+4+2+1 = -1).

    To get the negative of a number (that is, to get -N given N), the rule is "complement all the bits and add 0001".
    First, define the bit-complement operator ~ to be: "Change each 1 to a 0 and each 0 to a 1". Examples:
    ~0000 = 1111, and ~1111 = 0000
    ~0001 = 1110
    ~1010 = 0101
    Proof: note that N + ~N = 1111 = -1
    Example: 0101 + ~0101 = 0101 + 1010 = 1111 = -1
    Rearrange: ~N = -1 - N
    Rearrange: ~N + 1 = -N
    Finally: -N = ~N + 1 (QED)
    Examples using the complement+1 negation rule:
    +1 = 0001; -1 = ~0001 + 1 = 1110 + 1 = 1111
    -1 = 1111; +1 = ~1111 + 1 = 0000 + 1 = 0001
    +5 = 0101; -5 = ~0101 + 1 = 1010 + 1 = 1011
    -5 = 1011; +5 = ~1011 + 1 = 0100 + 1 = 0101
    0 = 0000; -0 = ~0000 + 1 = 1111 + 1 = 0000 (Notice: negating 0000 results in 0000.)
    And finally, negating twice returns the original number, a requirement.
    Now any two numbers, positive or negative, can be added or subtracted.
    To subtract a number, first take its negative (using the complement+1 rule given above) and then add.
    NO "BORROWING" IS EVER NECESSARY.
    The subtraction method used by hardware inside a computer CPU is: Change the subtraction problem to an addition problem (by negating the subtrahend using the complement+1 rule), then add, propagating the carries right to left. Note that the longer a computer word is, the more carries need to be propagated. The time to propagate the carries is proportional to the length of the word, O(length), which is slow for long words.
    There are "carry skipping" methods which reduce the carry time to O(log(length)), but these methods are another topic.
    Addition and subtraction can cause the integer overflow exception:
    -- If two positive numbers added result in a negative (MSB=1) sum, overflow has occurred.
    -- If two negative numbers added result in a positive (MSB=0) sum, overflow has occurred.
    Adding a positive number to a negative number never results in overflow.
    The negative of 1000 (= -8) results in 1000 and overflow, since the largest positive number is 0111 = +7.
    In hardware, it is easy to calculate overflow by looking at the carries into and out of the MSB:
    Overflow = ExclusiveOR(CarryIntoMSB, CarryOutOfMSB).

    Note that there is always a "strange" number for any of the three number systems:
    --- Sign magnitude has the number 1000 = 0000 (-0 = +0) since the MSB is the sign and has no value; there is no +8 or -8.
    --- One's complement has the number 1111 = 0000. Again, -0 = +0, and there is no +8 or -8.
    --- Two's complement has the number 1000 = -8, but there is no +8; the largest positive number is 0111 = +7.
    Two's complement has the "strange" number in the most out-of-the-way place, so it rarely causes a problem.
    The other two systems have the "strange" number at zero, which causes all-to-frequent, and unexpected, computational difficulties.

  • @55ban
    @55ban Рік тому +2

    Still works in 2023
    Thanks❤

  • @rho8931
    @rho8931 2 місяці тому +1

    I’m watching this literally 10 minutes before my quiz

  • @shujamukhtar4563
    @shujamukhtar4563 Рік тому +1

    Thank you. Finally, can solve the tricky ones.

  • @DrFA-u3l
    @DrFA-u3l Рік тому +638

    Anyone In 2024??

  • @jaideepwarrier9092
    @jaideepwarrier9092 5 років тому +25

    "Cut off one head, and two more shall take it's place."

    • @sumitupadhayay2270
      @sumitupadhayay2270 4 роки тому

      In decimal 10 will take Its place haha

    • @atharvapatil3248
      @atharvapatil3248 6 місяців тому

      @@sumitupadhayay2270 Never noticed that fact . Your open minded

  • @TheGugunea
    @TheGugunea 2 роки тому

    Currently on track of learning Kotlin, making a small project about Steganography and Cryptography, your tutorial helped me understand this topic, THANK YOU!

  • @mahbuburrahmanshanto7905
    @mahbuburrahmanshanto7905 8 років тому +23

    finally got it.......... your explanation was straight to the point.THANK YOU :)

  • @Linkfyre
    @Linkfyre Рік тому

    I didn't understand this when reading my text book for my CSIS110 Course, but this made the process infinitely clear.

  • @gumball1872354345
    @gumball1872354345 2 роки тому

    holy shit my professor dragged on for about an hour about this and it was so confusing, now I understand after 3 minutes thank you so much

  • @Vila_279
    @Vila_279 Місяць тому +2

    Still comes in handy in 2024

  • @teresaosebe4996
    @teresaosebe4996 2 роки тому

    I've been stressed about this the whole weekend😂 and you've made me get it in 3 minutes haha😅.....video from 9yrs ago🤦‍♀️😅

  • @dhananjayjhala
    @dhananjayjhala 6 років тому +1

    TYSM finally after so many classes in my college and still nothing,, one video and bam! i know binary subtraction! yay.. thnx

  • @jessetello7620
    @jessetello7620 7 місяців тому

    thank you for this! you actually taught about the case in which you have to borrow from the next columns which my professor seemed to avoid. so easy thank you for explaining

  • @AeolusMN
    @AeolusMN 12 років тому +3

    Excellent explanation, alot more clear and concise than my book...or teacher.

    • @yasser28000
      @yasser28000 10 місяців тому

      how is your life right now

  • @yukiriser
    @yukiriser 6 років тому

    I haven't gotten this for months and I have exams but I got it in 5 mins from you!

  • @Tilly883
    @Tilly883 2 роки тому

    Bro just helped me in my computer science homework, thanks

  • @senaustun4380
    @senaustun4380 Рік тому +2

    thank you man, ı gues knowledge is truly immortal

  • @Motiv8Mogul
    @Motiv8Mogul 2 роки тому

    And 12 years later still useful thanks man

  • @EmilWelton
    @EmilWelton 4 роки тому

    DUDE. You're the man. My prof made this so much more complicated

  • @ahbarahad3203
    @ahbarahad3203 Рік тому +1

    Bro sounds like hes narrating a battle during the second world war

  • @noobgaming2799
    @noobgaming2799 3 місяці тому

    Video launcher:- 15 years later. Me:- watching in 2026😂😂😂

  • @comrade4354
    @comrade4354 5 років тому +7

    Oh god,thank you so much lmao. I.m having a test in 3 days and i.m struggling on how to "borrow",but after watching this video it all makes sense to me now. Thank you so much now i can go through my test peacefully.

    • @勇駺
      @勇駺 3 роки тому +1

      me too

    • @dacongteh
      @dacongteh 3 роки тому +1

      buen trabajo comrade

    • @comrade4354
      @comrade4354 3 роки тому +1

      2 years it's been, how time flies. Also stfu you two.

    • @haoyinng9187
      @haoyinng9187 3 роки тому

      i asked

  • @nooralnasser4588
    @nooralnasser4588 3 роки тому +8

    You made it so easy to understand, thank you🦋💕

  • @91sk64
    @91sk64 2 місяці тому +1

    Tomorrow is my xam and here im at 10:55 pm taking notes

  • @CirkuitBreaker
    @CirkuitBreaker 8 років тому +2

    This is a lot better than the way my professor explained it.

  • @AI_Master420
    @AI_Master420 9 років тому +98

    thank you sir
    i am giving five star
    from Afghanistan

  • @joytalukdar5838
    @joytalukdar5838 3 роки тому +1

    Searched for hours but couldn’t understand finally got here.

  • @ArtChannel400
    @ArtChannel400 5 місяців тому +1

    Thank you so much, It helped me out, my exam is on 6th September, Thank You So Much🎉🎉🎉🎉🎉🎉🎉🎉🎉

  • @retajalshafei4574
    @retajalshafei4574 8 років тому +10

    Thank you so much!! I've got exams coming up about this and you just saved me from failing, great video!

  • @jacobparrott973
    @jacobparrott973 8 років тому +1

    great video, binary subtraction finally makes sense

  • @Ma_Mobin
    @Ma_Mobin Рік тому

    I used your tutorial now and it was awesome and I completely understand it.Thanks a lot.

  • @hirenjetani2852
    @hirenjetani2852 4 роки тому +1

    Really good explanation sir. Your video viewer from Canada

  • @RayhanRafid-gg5sz
    @RayhanRafid-gg5sz 7 місяців тому

    watching this on 2024 july. Thanks man. you are a Legend!

  • @sandipchakraborty7921
    @sandipchakraborty7921 10 місяців тому

    Thanks sir I'm from India and tomorrow is my exam so it helped me a lot .

  • @duytruong5012
    @duytruong5012 Рік тому +1

    Aug 25 2023, you're still a genius!!!

  • @krishnashakya2858
    @krishnashakya2858 8 років тому +40

    this is what i call clarification!

  • @amrapalidasgupta1543
    @amrapalidasgupta1543 7 років тому

    this is the best video on binary subtraction....!!!!! no doubt at all....

  • @BL-ec3nq
    @BL-ec3nq 2 роки тому

    Gosh, this is better than the lecture I had. Understood it in just less than 5min as compared to the near 30min ver I had in my course =.=

  • @lankeswardas6787
    @lankeswardas6787 Рік тому

    Was really helpful..better thn my CS professor thank you

  • @Gladiator1911
    @Gladiator1911 2 роки тому

    man, look how cool and nostalgic this is: win 7 xp with a good teacher... can't get any better.

  • @killaburribo
    @killaburribo 3 роки тому

    thank you, you explained this so much better than my professor

  • @Quartz512_
    @Quartz512_ 4 місяці тому

    I managed to figure it out within 1 minute, thanks!

  • @cengizhan.caglayan
    @cengizhan.caglayan 4 роки тому +2

    10 years later you save my ass, sir

  • @Arwym
    @Arwym 8 років тому +3

    Best method for me so far. Thank you!

  • @VishalKumar-kr9me
    @VishalKumar-kr9me Рік тому

    12 years ago I didn't know that I can study from UA-cam. I just started watching songs and teasers on UA-cam

  • @sykuzo
    @sykuzo 5 місяців тому

    WHY IS UA-cam BETTER THAN MY UNIVERSITY!!!!

  • @NWbeats
    @NWbeats 3 місяці тому

    Finally! I got it, nobody explained it properly it was so frustrating

  • @Ashely_999
    @Ashely_999 8 років тому +8

    Thank you good sir!! first clear explanation, why couldn't my teacher just say this?

  • @YOAARONONTHEBEAT
    @YOAARONONTHEBEAT 3 роки тому

    Can't imagine this is still helpful in 2021

  • @QmdVJ4KrCjUk888
    @QmdVJ4KrCjUk888 7 років тому +1

    Thank you sir! Finally, I discover a very concise video telling me how to borrow! Good job :):):)

  • @eeennnoooccc1
    @eeennnoooccc1 8 років тому +3

    FINALLY understood it...great explanation!

  • @CuriousCaseC2
    @CuriousCaseC2 2 роки тому

    This 5 minute video saved tonnes of my time!!

  • @itssrm870
    @itssrm870 9 місяців тому

    Thanks dude....for the uploading this video in the era of windows xp

  • @thorixtg3024
    @thorixtg3024 Рік тому

    12 years passed and still thank you

  • @muhammadashrafi.f.s6658
    @muhammadashrafi.f.s6658 20 днів тому

    My worst mistake was choosing computer science, probably will end up jobless

  • @uzmaazhar5099
    @uzmaazhar5099 7 років тому

    Best explanation of borrowing in binary subtraction I got frm this video 👌

  • @munalkhadka5224
    @munalkhadka5224 Рік тому

    Best vedio ever for binary subtraction, thank you ❤❤

  • @lionelmuskwe
    @lionelmuskwe 3 роки тому

    I just want to say thank you so much. This video is gold. Well done

  • @awoo1622
    @awoo1622 8 років тому +3

    Very simple and also good explanation👍. Take this bottle 🍶 of cold beer🍻

  • @aayushmashiwakoti9247
    @aayushmashiwakoti9247 Місяць тому

    so in summary the number asking for borrow will be 2, numbers giving the actual borrows i.e. 1 will be reduced to 0 and intermediates passing the borrow i.e. 0(as they can't give borrow by themselves and give borrow to lower significant bit by taking borrow from higher significant bits )will be 1.

  • @amarachiamaechi-odunsi4794
    @amarachiamaechi-odunsi4794 3 роки тому +2

    Thanks for this. You made it so easy to understand.

  • @tyraelhermosa
    @tyraelhermosa 5 років тому +1

    Thank you. Straight to the f-ing point. Nice job.

  • @mohammadrohail8905
    @mohammadrohail8905 8 років тому

    Probably the best one out there. Understood it clearly!

  • @apoorvgusain6573
    @apoorvgusain6573 7 років тому

    I love it, the way u explained borrowing i was struggling for 2yrs u made it easy and simple to understand thank you

  • @Nirajzion
    @Nirajzion Місяць тому +9

    Any one in 2025

  • @Fanxsmite190
    @Fanxsmite190 8 місяців тому +1

    Thank you so much! I can now understand it!

  • @SummerAlAli
    @SummerAlAli 9 років тому +1

    that was amazing :), I have an exam tomorrow in digital design, and I benefited thank you.

  • @johnbennett834
    @johnbennett834 6 років тому +1

    thanks for the short, simple, and informative video.

  • @algerianproudthatheisrussi7345

    I learnt this in 2019 forget it and came back in 2024
    Thats crazy how time passed so fast

  • @AminaAmina-yn5uc
    @AminaAmina-yn5uc 9 років тому +2

    finally .. an explanation that really helped. thanks !!