Neso Academy lecture solving one's and two's complement binary examples, including the r-1 complement formula, bit-inversion method, and two's complement via adding one.
Key Takeaways
- One's complement of a binary number is obtained by inverting every bit (replacing 0 with 1 and 1 with 0).
- Two's complement is computed by taking the one's complement and adding 1.
- The general one's complement formula is r^n - 1 - N, where the r^n - 1 term is a string of maximum digits in the given base.
- Binary addition with carry is required when adding 1 to the one's complement to get the two's complement.
What the video covers
- Introduces the one's complement formula (r^n - 1 - N) and explains why the r^n - 1 part equals all maximum digits in any radix (9s, 7s, Fs, 1s).
- Explains that for binary numbers the one's complement is found by subtracting each bit from 1, which is equivalent to inverting every bit.
- Worked example 1: finds the one's complement of 1010 by subtraction, yielding 0101.
- Demonstrates the same result using four NOT gates, showing that inverting each bit gives the one's complement.
- Worked example 2: finds the two's complement of 10101010 (noted as 1011 1010 in transcript context) by first computing the one's complement and then adding one.
- Shows binary addition with carry during the addition of 1 to the one's complement.
- Assigns two homework problems: one's complement of 100111 and two's complement of 11001111.
- Previews a shortcut method for computing two's complement in the next lecture.
Chapters
- 00:00Introduction to one's and two's complement
- 00:05Radix complement formula and r^n - 1 explanation
- 00:40Examples of maximum digit strings in different bases
- 01:27Finding one's complement of 1010 by subtraction
- 02:37One's complement using NOT gates
- 03:18Two's complement of 10101010 example
- 04:36Homework problems
Full Transcript — Download SRT & Markdown
Speaker A
we have decent knowledge on RS and Rus one's complement in this lecture we will solve few examples on ones and two's complement in first example we have to obtain one's complement of one 1 0 a binary number and we already know Rus
Speaker A
one's complement r - one's complement is given by R ra to^ small n minus capital n - 1 or I can write it as R ra to^ small n -1 - capital n and we have to focus on
Speaker A
this part of expression and let's consider a situation in which base or radic is equal to 10 when base or Ric is equal to 10 this part of expression will give us 9 9 9 all the way to n NES
Speaker A
because number of Digit is equal to n for Simplicity let's say we have four digit number so small n is equal to 4 and we have four NES if base is equal to 8 Redix is equal to 8 this
Speaker A
part of expression will give us 7 777 if redic is equal to 16 hexadecimal number system this part of expression will give us f f f f and if Red X is equal to 2 binary number system this
Speaker A
part of expression will give us 1 1 1 1 so there is no need to solve this part of expression because you have to perform conversion and subtract one from it and eventually you are going to have these numbers so what we will do we will
Speaker A
take our n the number given to us and we will subtract it from this results in this question we have to find one's complement of 1 1 0 it means we have to calculate R minus one's complement so I
Speaker A
will take four ones because I have 4bit number and I will subtract 1 0 1 0 from it one 0 1 0 from it 1 - 0 is 1 1 - 1 is 0 1 - 0 is again
Speaker A
1 and 1 - 1 is 0 so I have 0 1 0 1 as the answer as the one's complement of 1 0 1 0 and let's take four not Gates input of first not gate is zero input of
Speaker A
second not gate is one input of third not gate is zero again and input of fourth not gate is one let's try to find out the output of this not Gates complement of 0 is 1 complement of 1 is
Speaker A
0er in the same way we have 1 Z this is the number given to us one 0 1 0 given number and 0 1 0 01 is the one's complement so this is the one's complement so from next time when we
Speaker A
have to calculate one's complement we will just take complement of the given number complement of 1 0 1 0 is 0 1 0 1 and this is the one's complement now we will move to Second example in which we
Speaker A
have to obtain two's complement of 1 0 1 1 1 0 1 0 and if you remember in case of two's complement two's complement we have to first find one's complement and then we have to add one to it so let's first find out one's
Speaker A
complement I will just simply take complement of the given number so one's complement is equal to 0 1 0 0 0 1 0 1 and then we have to add 1 1 + 1 is 0 with carry equal to 1 1 + 0 is 1 then we
Speaker A
have 1 0 0 0 1 0 so this is the two's complement of the given number this is our answer so this is all for this presentation now we will move to homework problem in first homework problem you
Speaker A
have to find one's complement of 1 0 0 1 1 1 and in second homework problem you have to find two's complement of 1 1 0 011 1 so these are the two problems and in next presentation we will try to find out
Speaker A
two's complement by a shortcut method so see you in the next one
Topics:one's complementtwo's complementbinary number systemradix complementdigital electronicsNOT gatebinary arithmeticnumber systemsNeso Academycomputer arithmetic











