Binary: Plusses & Minuses (Why We Use Two's Complement) - Computerphile

Sdílet
Vložit
  • čas přidán 13. 05. 2024
  • Negative Binary Numbers - you may have heard of 'signed' numbers, but do you know how they work? Professor Brailsford explains not just how, but why we use the systems we do.
    Binary Addition: • Binary Addition & Over...
    Most Difficult Program to Compute?: • The Most Difficult Pro...
    Floating Point Numbers: • Floating Point Numbers...
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Komentáře • 539

  • @chswin
    @chswin Před 2 lety +131

    I like how he gives the context of the era along with the story… because he was there, he lived it! What a great teacher!

    • @WyMustIGo
      @WyMustIGo Před měsícem

      Too bad the young people will never experience the 50s - 90s which is when the real tech revolution occurred. These days people google everything and/or use engines or libraries. They lack the understanding of what and why things happen. Now you know why most applications are slow and bloated garbage.

  • @FaizHasif
    @FaizHasif Před 9 lety +551

    7:09 Love how the professor just subconciously did a closing bracket and even the semicolon hand writing gesture after saying the statement "if (i == 0);".

    • @judgegroovyman
      @judgegroovyman Před 5 lety +27

      haha I didnt see that! Thanks for pointing that out!

    • @lukejohnson9696
      @lukejohnson9696 Před 4 lety +24

      @TheSpecialistGamerX2 He clearly says "in your Java program"

    • @Qbe_Root
      @Qbe_Root Před 4 lety +42

      It’s an opening curly bracket, “if (i == 0) {”

    • @GamerTheTurtle
      @GamerTheTurtle Před 4 lety +27

      no he was doing a curly bracket, if you put a semi colon there your compiler calls you a fookin donkey

    • @TheCaoth
      @TheCaoth Před 4 lety +24

      if (i == 0); is valid grammar my dudes. It's unusual, and it's probably not what Professor Brailsford wrote with his fingers, but it compiles fine in C, C++ and JavaScript.

  • @milin_234
    @milin_234 Před 2 lety +57

    None of my professor is as energetic and enthusiastic while teaching like him. Hats off professor 🤩🤩

  • @kencarp57
    @kencarp57 Před 4 lety +21

    I received my CS degree way back in the Dark Ages... 1980. 👴🏼
    I’ve been in the software field ever since, and I find Professor Brailsford’s videos fascinating, enlightening, and just plain enjoyable. I sometimes wish I were a young undergrad again, so I could study under him.
    I learned about ones and twos complement early on, of course... but I don’t remember any prof ever talking about WHY we use them in terms of the need to build the hardware most simply.
    KEEP IT UP, PROF! 👍🏼👍🏼

  • @ehsanmamakani
    @ehsanmamakani Před 3 lety +8

    4 years of undergrad and just now I really understand 1s n 2s complement, thank you Computerphile

  • @danielhale1
    @danielhale1 Před 8 lety +63

    Watching these videos makes me absurdly giddy. I love learning (and re-learning, in case I've forgotten since college) how this stuff all works at the lowest levels. I wish I had more time to watch them throughout the day, but compiling breaks don't take as long as they used to. :D

  • @antonnym214
    @antonnym214 Před 7 lety +54

    This is beyond brilliant. Makes it so much easier when designing little ripple adders and such for ALUs! I especially appreciated the discussion of the rule for overflow. That would have taken me a while to work out. Wonderfully explained. Thank you!

  • @PacketCyclotron
    @PacketCyclotron Před 7 lety +63

    I really like Prof Brailsford.

  • @jeremyfirth
    @jeremyfirth Před 4 lety +4

    Nice camera/focus work on the close-ups on the paper. That was seamless and some high-end professional work.

  • @sevrjukov
    @sevrjukov Před 8 lety +98

    I wish these videos were around back in the days when I was at college....

    • @durragas4671
      @durragas4671 Před 4 lety +9

      There just weren't enough bits back then.

    • @Chaudharys1
      @Chaudharys1 Před 3 lety

      Yeah really glad to be an adult student when things have changed.

    • @_K_y
      @_K_y Před 2 lety

      I hear you and I’m incredibly fortunate to be that college kid :))

    • @MrSkinkarde
      @MrSkinkarde Před 2 lety

      This was taught better in my college 20 years ago

    • @msk0693
      @msk0693 Před 2 lety

      Better late then never

  • @CtrlShiftGo
    @CtrlShiftGo Před 9 lety +2

    Wonderful video! I always enjoy listening to Professor Brailsford, he has a way of telling and introducing the subject matter which is absolutely brilliant.

  • @TimSwast
    @TimSwast Před 9 lety +5

    Really cool explanation. Even after learning this in school I learned something by watching this, which was how hardware can do overflow detection using 2s complement.

  • @darkmage07070777
    @darkmage07070777 Před 9 lety +9

    Yeah, this is why I subscribed. Watching this video for the second time and doing the "math" along with professor Brailsford, I feel like I have a greater inherent understanding of how binary numbers are treated in the machines I work with daily. Thank you!

  • @Gkkiux
    @Gkkiux Před 9 lety +22

    I had computer architecture last year and these videos are still interesting

  • @bhavukgarg3619
    @bhavukgarg3619 Před 5 lety +2

    Clear explanation, Finally I am clear about 2's complement. Thank you sir. I wish I have a teacher like you.

  •  Před 8 lety +8

    Prof. Brailsford is amazing, thanks for the video!

  • @danverzhao9912
    @danverzhao9912 Před 3 lety +3

    This is so much clearer than what my professor told me! Thank you.

  • @srushtikadam1514
    @srushtikadam1514 Před 2 lety

    This is a safe place to accept we all fell in love with this guy('s teaching). I think out of the countless tutorials I've watched to actually "get the feel of this topic", this has hit the bestttttt!

  • @JannisAdmek
    @JannisAdmek Před 4 lety +2

    I love this video! the professor's explanation skills are extraordinary!

  • @bhavikroopchandani8159

    Days of struggling with this and finally I stumble upon the perfect video, the one video to clear them all doubts , one video to find all the the right questions, one video to bind all concepts together and at the last the answers to them(doubts :p).

  • @PNWMan
    @PNWMan Před 7 lety +1

    I thought I was an "expert" on this kind of stuff, until I learned about the overflow rule at the end. This kinda gets me excited again about circuitry; very well explained :D

  • @cpuvec2896
    @cpuvec2896 Před rokem

    Incredible video. Really solidified 2’s and 1’s compliment in my head after being confused in class. Thanks for this video!!

  • @stevea.b.9282
    @stevea.b.9282 Před rokem

    This man is fascinating. So knowledgeable and he was there as this stuff was being developed. Great storyteller and teacher... thanks

  • @NeilRoy
    @NeilRoy Před 8 lety

    Thanks for this. I had a vague understanding of this, but I was never quite clear on it. This really cleared this up for me.

  • @zolan4277
    @zolan4277 Před 5 lety +1

    I love this guy... I could watch his videos all day long.

  • @hrnekbezucha
    @hrnekbezucha Před 6 lety +5

    The ending was a bit confusing but what happens is that you have two bits somewhere in a register that signifies flags. Sign for positive or negative and overflow for out-of-range. These flags are set in hardware automagically whenever the count moves over a specific number in one way or the other.
    In Arm the place it happens is xPSR - program status register.

    • @dannygjk
      @dannygjk Před 9 měsíci

      The twos complement math works logically even if there are no flags. What you are pointing out is an extra function.

  • @LemonChieff
    @LemonChieff Před 6 lety +1

    I'm glad someone solved this before I came around. Thank you mysterious person!

  • @yashashs3191
    @yashashs3191 Před 3 lety +1

    I have been doing ones complement and two's complement from past two years in my university and no one ever told me how beautiful it was until CZcams recommended me this after 5 years

  • @futurecyborg_
    @futurecyborg_ Před 8 měsíci

    thank you so much, i came into this not understanding two's complement at all, and now i feel like i really get it!

  • @Madsy9
    @Madsy9 Před 9 lety

    Long overdue videp lecture. Thanks to Sean and Professor Brailsford for making this :)

  • @maslegoman
    @maslegoman Před 9 lety +311

    Aww, he didn't explain 2's complement the easy(ish) way. It's easiest to think of the sign bit as a negative version of whatever that bit would be if there were no negatives. So if you have this:
    1000
    Then the 1 bit represents -8. If you have this:
    1000 0000
    Then the 1 bit represents -128. Then it becomes really easy to figure out what the number is, assuming you know what the remaining bits mean on their own. For example, if you have 101, which is 5 in binary, slapping a 1-bit on the front of it would be 5-8 = -3. If you have 010, which is 2, slapping that 1-bit on would be 2-8 = -6.
    Essentially, just think of the negative bit as a really big negative number, with the rest of the digits being normal. If that bit is turned on, then everything positive you add to the number will make the value get closer and closer to 0 naturally, because it's cancelling out more and more of the big negative value that the sign bit represents.

    • @NeilRoy
      @NeilRoy Před 8 lety +19

      +LunaticMS This also explains to programmers why signed numbers hold a smaller range of numbers than unsigned numbers. Signed byte = -128 to 127, unsigned byte (or char in C) is 0 to 255.

    • @LPfan95
      @LPfan95 Před 7 lety +62

      It's not a smaller range though it's just shifted. A byte can represent 256 numbers: -128 to 127 is 256 numbers, 0 to 255 is also 256 numbers. Making it unsigned just signals the compiler not to treat it as 2's compliment so 1000 0000 would be 128 not -128

    • @JohnSmith-rj2yt
      @JohnSmith-rj2yt Před 6 lety +24

      I found "2's complement = 1's complement + 1" easier to understand. To undo the operation just minus 1 and take the 1's complement again.

    • @cearnicus
      @cearnicus Před 6 lety +8

      My own preference is to see it in terms of wrap-around (think odometers). With 4 bits, the numbers 0 and 16 are equivalent (0000 vs 1,0000). -1 is the number before 0, which is equivalent to 16-1 = 15, which is 1111 in binary. -2 ~ 16-2 = 14, etc.

    •  Před 5 lety +1

      I liked to think as getting a negative number is substracting the number from 10000 (as many 0s as we use)

  • @shikharupadhyay7435
    @shikharupadhyay7435 Před 9 měsíci

    Nice explanantion.. Cleared the concept pretty easily....

  • @ConernicusRex
    @ConernicusRex Před 8 měsíci

    I learned most CS from my grandfather who was an early pioneer in data processing for State Farm and worked there many years. He was around from the days of the IBM 029 system all the way to clusters of PC clone terminals connected to modern mainframes and the internet (still with the choice of either dedicated ISDN, T1/T3, or 56 kilobaud around when he retired in the mid-late 90s).
    Every time I hear professor Brailsford start talking through a concept like binary addition over pen and paper i'm instantly transported to being shown the same concepts by my grandpa. Such an amazing teacher, and always bringing the context of the invention itself into the explanation of the solution which helps you remember forever.

  • @man_fan
    @man_fan Před 9 měsíci

    This man is an absolute legend in the world of mathematics and computer science

  • @MaggieRoara
    @MaggieRoara Před 5 lety

    Professor Brailsford, you splendid man! Thank you thank you thank you. Now I wish he explained how these get turned into hardware.

  • @vuurniacsquarewave5091

    Very interesting to see the "history" behind $FF meaning -1 and $01 +1.
    I first found out about this representation when I was trying to understand how different digital sound formats work (PCM signed and unsigned, ADPCM, PWM)

  • @hla27b
    @hla27b Před 9 lety +1

    Professor Brailsford is as illuminating as always.

  • @amaraojiji
    @amaraojiji Před 9 lety

    The best speaker in all videos. Love him!

  • @patrickmayer9218
    @patrickmayer9218 Před 9 měsíci

    *A signed bit system is is bad because it's extremely limited in size
    *1's complement is better, but still bad because there is a positive and negative representation of zero
    *2's complement gets rid of both issues by just adding 1 to 1's compliment
    Great video!

  • @markjacobs4926
    @markjacobs4926 Před 6 lety

    FINALLY!!! I now understand what overflow means. Thank you!!!

  • @AlexanderBollbach
    @AlexanderBollbach Před 8 lety +259

    this was a 'bit' confusing. i'll re-watch it, that should help.

    • @AkshayAradhya
      @AkshayAradhya Před 6 lety +21

      Maybe try flipping your monitor upside down.

    • @RinksRides
      @RinksRides Před 5 lety +4

      @@AkshayAradhya you mean GOTO display settings and invert the colors?

    • @allanrichardson1468
      @allanrichardson1468 Před 4 lety +10

      Just don’t byte off more than you can chew!

    • @keysersoze7919
      @keysersoze7919 Před 4 lety +2

      I am pretty sure you waited your entire life to make this joke

    • @lambda653
      @lambda653 Před 3 lety +5

      Me and the boys designing micro processors

  • @ibrahimtouman2279
    @ibrahimtouman2279 Před 4 lety

    Simply impressive explanation

  • @Robin_Nixon
    @Robin_Nixon Před 9 lety +2

    A perfect explanation of negative binary arithmetic.

  • @efeuzel1399
    @efeuzel1399 Před 4 lety

    Thanks for the complete explanation.

  • @helpfullprogrammer
    @helpfullprogrammer Před 9 lety

    This is magic. Thank you for your explination!

  • @Ratstail91
    @Ratstail91 Před 9 lety

    I love watching this guy's vids, he really knows his stuff. Edit: BTW, this guy has taught me so much, I always end up trawling through maths articles afterwards.

  • @krumbergify
    @krumbergify Před 3 lety

    Lovely video and great explanation! Thanks a lot!

  • @wizrom3046
    @wizrom3046 Před rokem

    When I professionally coded 8bit assembler applications many years ago I standardised on using his "bad" example of using the leftmost bit as a sign indicator and the rightmost 7 bits as the number.
    This had big benefits in display and hardware ADC coding, and although you might think it is worse for number adding than twos complement it worked well enough, you just check the sign bit then choose to either add or subtract the number from the total.
    So there are definitely commercial products out there using this "bad" system.

  • @m3ntalfl0ss
    @m3ntalfl0ss Před 9 lety

    Love this guy, so calming.

  • @user-wr2tb9zx8g
    @user-wr2tb9zx8g Před rokem

    great review of the topic

  • @venkataravieluri9625
    @venkataravieluri9625 Před 3 lety

    Great explanation, now I got to understand how hardware overflow is detected.

  • @typograf62
    @typograf62 Před 9 lety

    Very instructive. I learned assembler-programming on a UNIVAC-1100 and machine code programming on a Z80 (I could not quite afford an assembler at first) so I did learn 1's complement and 2's complement. And I can still drive the younger programmers mad by this. Not that I have any use of 1's complement today.

  • @Beesman88
    @Beesman88 Před 9 lety +36

    It's funny if you use abs() function for example in C the absolute value of your lowest negative number will be... suprise: the negative number itself (despite manual page saying answer of abs() is always positive number :P). Thanks to having one negative number more than positive, be carefull with abs() - better to write your own and better to remember that. In fe 16b: -32768 exists, 32768 doesn't.

    • @FerroNeoBoron
      @FerroNeoBoron Před 9 lety +6

      // True, errno isn't even set either. Scary!
      # include
      # include
      # include
      using namespace std;
      int main(){
      signed short a = 0x7FFF; int erra = errno;
      signed short b = a+1; int errb = errno;
      signed short c = abs(b); int errc = errno;
      cout

    • @vytah
      @vytah Před 9 lety +8

      Beesman The standard clearly states that in case of abs() "if the result cannot be represented, the behavior is undefined."

    • @KaiKunstmann
      @KaiKunstmann Před 9 lety +5

      One solution to this problem is to avoid abs() and instead use nabs(). If you don't have nabs() create that utility function on your own [nabs(in) { return (in < 0) ? in : -in; }]. It is supposed to return the negative of the absolute value of the input, which always works. Also, check out the book "Hacker's Delight".

    • @KaiKunstmann
      @KaiKunstmann Před 9 lety +7

      ***** "nabs" is the opposite of "abs" in that it returns the "negative absolute value" of a number, which can always be expressed in 2's complement. The negative absolute value of a negative number is the number itself. The negative absolute value of a positive number, is the negative of it.

    • @simplylinn
      @simplylinn Před 9 lety +2

      Kai Kunstmann I have been thinking about abs before this and how to get the functionality of abs without the problems with the minimum value. Never thought about using the negative absolute value... Thanks for the info! It might prove useful one day.

  • @welshydragon2007
    @welshydragon2007 Před 3 lety +1

    Did this back in the day on my "O" level computer studies course - but what they didn't tell us was why 2's complement was so important i.e. hardware optimisation :-)

  • @MegaDardery
    @MegaDardery Před 6 lety

    The hardware overflow indication was brilliant.

  • @filmfreak988
    @filmfreak988 Před 9 lety

    Other than Tom Scott, Professor Brailsford is my favorite presenter on this channel!

  • @balrampillai5314
    @balrampillai5314 Před 5 lety

    @9:10 Yipee. That was the best explanation to one's and two's ever

  • @Roxor128
    @Roxor128 Před 9 lety +1

    I just remembered another nice thing about two's complement: It makes it easy to convert low-precision to high-precision.
    If you want to convert signed 8-bit to signed 16-bit, all you have to do is fill the top byte with copies of the top bit of the 8-bit value. Just test for whether the top bit is set, then either OR with 0xff00 or use as-is.
    You can do it on a single line of C like this:
    sixteen_bit_val = (eight_bit_val & 0x80) ? 0xff00 | eight_bit_val : eight_bit_val;

  • @stephenliseo7038
    @stephenliseo7038 Před 5 lety

    You Sir are a gentleman and a scholar, great video

  • @esvw1986
    @esvw1986 Před 6 lety

    I would like to "compliment" you on an excellent presentation

  • @battlemode
    @battlemode Před 6 lety

    Great lecture, thank you!

  • @samuelfeder9764
    @samuelfeder9764 Před 9 lety

    I love this episode! =D
    Thanks for making it!!

  • @okanv
    @okanv Před 3 lety +3

    4:46 Such an UK reaction :d Prof Brailsford is amazing.

  • @BatteryAcid1103
    @BatteryAcid1103 Před 9 lety

    Just like that. :)
    Great video as always, guys.

  • @essentia9
    @essentia9 Před 3 měsíci

    The video is a pure treasure

  • @allanrichardson1468
    @allanrichardson1468 Před 8 lety +5

    In the pre-360 world, the IBM 700/7000 series used sign and magnitude for their 36-bit binary integer arithmetic, adding the extra hardware to account for signs and overflows properly. Some programming languages, such as FORTRAN, used -0 to represent a word to which no value has yet been assigned; their compiled instructions tested for -0 before performing an operation, and knew that a programming error had occurred (using an uninitialized variable) if -0 was found. No arithmetic operation would ever GENERATE a -0 result; it could only appear as a result of copying a constant into it, or compiling an object program with that value (octal 400000000000, or in the hex notation devised later for the 360 series, 800000000) loaded into all variables with no initial value specified by the programmer.
    Strangely, although integer math in the later 360 (introduced in 1965) used twos complement notation, FLOATING point math used sign-plus-true magnitude for the mantissa (significant digits) and an excess-64 notation of powers of 16 for the exponent (order of magnitude): in a 32-big (single precision) floating point number, the first bit was the sign (1 for negative) of the entire number, the next 7 bits represented the power of 16 plus 64 (0000000 meant 16^(-64), 1000000 meant 16^0, and 1111111 meant 16^63), and the remaining 24 bits represented a binary fraction. Double precision (64 bits) and extended precision (128 bits) kept the sign and magnitude the same and added the extra 32 (thus a total of 56) or 96 (for a total of 120) bits to the mantissa.
    I suspect the reasons were that (a) floating point required more complex logic anyway, so temporarily generating twos complement for addition and subtraction were not much extra effort, (b) adding precision only required appending zero bits to the right, not the current value of the sign bit, and (c) more multiplying and dividing than adding and subtracting are done in the areas where floating point is commonly used, and those operations ignore the signs until the end, then determine the sign of the result from the signs of the operands.

  • @billyheng4824
    @billyheng4824 Před 8 lety

    Good lesson on binary flaw thanks how about address mode is there any issue and I notice there are problem in Unicode as well if you could have a lesson on those and is there any history on it. Happy to know thankyou very much.

  • @lukezelechoski4504
    @lukezelechoski4504 Před 9 lety

    Thank you for the video!

  • @Mishkafofer
    @Mishkafofer Před 6 lety

    love camera work, live action.

  • @c25789
    @c25789 Před 6 lety +3

    I like how happy he got when +0 and -0 mapped to the same binary representation. It's almost like he won the lottery.

  • @logicaldistraction
    @logicaldistraction Před 9 lety

    very good explaination!

  • @eobardthawne6903
    @eobardthawne6903 Před 3 lety

    5 years and only 6K likes, oh CZcams, you should recommend videos from this channel to every individual engineer.

  • @WayneJohnsonZastil
    @WayneJohnsonZastil Před 9 lety +1

    I have been doing java since start of 2015 and this is relevant!

  • @jm56z43
    @jm56z43 Před 5 lety

    An overflow is what happened to the first Ariane V rocket. It was driven by the same code as Ariane IV, but its acceleration was so great it overflowed, leading to the most sharp turn ever tried by a rocket.

  • @joeldorrington5583
    @joeldorrington5583 Před 5 lety

    Love this guy, he's cool and he loves what he does!

  • @amitkesari2000
    @amitkesari2000 Před 3 lety

    Sir, Why exactly are we moving the overflow bit to LSB for addition in 1s compliment method and discarding the same in 2s compliment method?
    Thank you

  • @QqJcrsStbt
    @QqJcrsStbt Před 3 lety

    zig-zag, offset (bias), bit signed an base -2 are out there. Does IEEE float use signed magnitude for mantissa and bias for exponent? Google uses zig-zag perchance?

  • @rthsw
    @rthsw Před měsícem

    Wow... doing computer for almost 40 Years, and also did some assembly in my younger times... but never realized before for having two zeros for binary signed numbers...

  • @error079
    @error079 Před 9 lety

    Thank you for a geat video. I allways wanted to know about this.

  • @mandeath2971
    @mandeath2971 Před 9 měsíci

    What was the book he was reading? I need it.

  • @NickEnchev
    @NickEnchev Před 6 lety

    Love your videos!

  • @Kriegsdorn
    @Kriegsdorn Před 9 lety

    isn't the 1's complement just a residue class ring of the integer 2^n for a n-bit number, where we shift the representation by n/2 ? (or n/2 + 1, if i want the 'extra' number to be negative and keep 0 represented with all bits as 0s)

  • @squirrelbrains2197
    @squirrelbrains2197 Před 8 lety

    very good video. the small printout is rather out of focus most of the time though, while the handwritten is much clearer.

  • @Grombo79
    @Grombo79 Před 8 lety

    beautiful video

  • @blazze_
    @blazze_ Před rokem

    Woah! I was amazed!

  • @BloodyIron
    @BloodyIron Před 2 lety

    Final solution seems to creation justification for XORs! Nice.

  • @ImrazorZodd
    @ImrazorZodd Před 9 lety +7

    Set a hardware overflow indicator, like a boss. :D

  • @Jebusankel
    @Jebusankel Před 9 lety

    I'd have liked to see a clearer version of that chart in the textbook and an animation of how you shift each system around to get from one to the other. There's such a chart on Wikipedia but I think an animation would make it really clear.

  • @andrewnday
    @andrewnday Před 9 lety

    Literally went over this topic today in Logic design class lol.

  • @Rudxain
    @Rudxain Před 2 lety

    A nice property of 2s Complement is that ctz(n) = binaryTrialDiv(n) regardless of the sign of n. What this means is that the number of bitwise trailing zeros always corresponds to the number of times the number can be divided by 2, this accelerates the computation of CTZ by removing a conditional branch.
    But the real question is, why not use Binary Offsef? It's the same as 2s Complement but with a flipped sign bit, it has the property that all numbers are sorted mathematically, negatives are lower and positives are higher. It also has the nice feature that you only need 1 addition by an offset proportional to the word size of the register, which removes the need for a bitwise-not operation.
    The only downside I see is that the Offset is only constant if you use the same word-size, since every word of different length requires a different offset

  • @leeamraa
    @leeamraa Před 2 lety

    What a teacher!!!

  • @nD-ci7uw
    @nD-ci7uw Před 3 lety

    Genius! Right now I am so curious how did they invented this system

  • @abrahamzayed7399
    @abrahamzayed7399 Před rokem

    I'm studying for the GATE test, and boy does this help with my confusion in the first chapter.

  • @antipattern0
    @antipattern0 Před 9 lety

    Yay! so much closer to an ALU!

  • @Mathijs303
    @Mathijs303 Před 6 lety

    thank you sir!

  • @povilasn4110
    @povilasn4110 Před 9 lety

    Could you also explain binary multiplication is there some tricks doing it and do hardware engineers build some special logic or simply use adding logic few times ? :D

  • @surajmittal7572
    @surajmittal7572 Před 9 měsíci

    Can someone please explain me more about how to detect overflow?

  • @rev.davemoorman3883
    @rev.davemoorman3883 Před 6 lety

    The famous 6502 doesn't do anything except addition. If you SBC (subtract with carry), you must Set the Carry before the action. The chip (evidently) does a EOR 255 on the subtrahend. You set the Carry, which is the +1 of 2's Compliment. Brilliant!

  • @rdvqc
    @rdvqc Před 2 lety

    Worthy of note, most of Seymour's CDC systems (6000, 7000, Cyber 70 & 170) used 1's comp.

  • @rchandraonline
    @rchandraonline Před 9 lety +6

    so, overflow = (carry out of bit 6) exclusive-or (carry out of bit 7)