This topic is useful for KTU Regulation 2019 1. EET206 Digital Electronics ( ELECTRICAL AND ELECTRONICS ENGINEERING) 2. CST203 Logic System Design ( COMPUTER SCIENCE ENGINEERING) 3. ECT203 Logic Circuit Design (ELECTRONICS AND COMMUNICATION ENGINEERING) 4. EBT205 Logic Circuit and Design (BIOMEDICAL ENGINEERING) 5. ITT203 Logic System Design (INFORMATION TECHNOLOGY) 6. ECT203 Logic Circuit Design (APPLIED ELECTRONICS ENGINEERING) KTU Regulation 2015 1. EE204 Digital Electronics and Logic Design (ELECTRICAL AND ELECTRONICS ENGINEERING) 2. CS203 Switching Theory and Logic Design (COMPUTER SCIENCE ENGINEERING) 3. EC207 Logic Circuit Design (ELECTRONICS AND COMMUNICATION ENGINEERING) 4. EC207 Logic Circuit Design (APPLIED ELECTRONICS ENGINEERING AND INSTRUMENTATION) 5. IC207 Design of Logic Circuit (BIOMEDICAL ENGINEERING) FOR FULL CLASSES : https://youtube.com/playlist?list=PL2UV2EJdMQmgLuA8dwLY7-4DsbNQTsUOg #digitalelectronics#ktu#eee#electrical#cse FOR FULL CLASSES : https://youtube.com/playlist?list=PL2UV2EJdMQmgLuA8dwLY7-4DsbNQTsUOg #digitalelectronics#ktu#eee#electrical
Hello students, today we are going to discuss about Signed Number Representation
Hope you have understood the previous classes, let's go to the topic
Today we are going to discuss about Binary Number Representation
Magnitude form and complement form can be split into two
In magnitude form, there is unsigned representation and signed representation
In complement form, there is one's complement and two's complement
What is unsigned representation?
Unsigned representation is the same as binary addition and addition
Signed representation is not important, only positive numbers are represented
What is the difference between a normal number and a signed number?
We are not mentioning positive or negative number
But if it is a signed number, we are mentioning that sign
If it is plus 5, I am representing a plus sign
That is what we have to note in a signed representation
In signed magnitude form, both positive and negative numbers are represented
But in unsigned magnitude form, only positive numbers are represented
Sign is not important
Similarly, signed representation can be represented in complement form
That is one's complement and two's complement method
Signed magnitude form can be represented as positive binary numbers
How can we represent negative numbers?
Negative numbers can be represented as signed magnitude form
or one's complement method or two's complement method
We can represent any signed numbers in sign magnitude form and complement form
There are two classifications of complement form
One's complement and two's complement
For example, positive 7 and negative 7
Positive 7 and negative 7 create confusion
How can we represent it?
To avoid confusion, we use signed number or signed magnitude representation
Let us see what is signed magnitude representation, one's complement method and two's complement method
First case is signed magnitude form
In signed magnitude form, both positive and negative numbers are represented as 1
Both positive and negative numbers are represented as sign bit
Sign bit representation for plus is 0 and minus is 1
How to write its syntax?
Syntax of signed magnitude form is
Signed bit is in this box or block
What is coming here?
Actual binary
In signed magnitude representation, positive indicates 0 and negative indicates 1
0 and 1 are given inside this signed bit
In signed magnitude representation, positive indicates 0 and negative indicates 1
Where is it represented?
Inside this signed bit
0 and 1 are represented
If signed bit is 0, number is positive
If signed bit is 1, number is negative
Actual binary is given in this box
Consider an example, minus 7
Normally, I represent 7 in binary form as 1, 1, 1
I represent 7 with 4, 2, 1 code
But when sign bit comes, actual binary is written here
1, 1, 1
In sign bit representation, sign is negative
What is negative?
It is 1
Here 1 is given
In signed magnitude form,
When we give syntax of signed magnitude form
First box is for signed bit
Next box is for actual binary or magnitude
In minus 7, first box is minus
How is minus represented in signed magnitude form?
It is represented by 1
I gave 1 in signed bit
Actual binary 7 is given later
That is how minus 7 is represented
In any negative values,
In signed magnitude form,
In 1's complement form,
In 2's complement form,
Positive is also represented in this
When positive is given,
Signed magnitude form, 1's complement form, 2's complement form has same numbers
Let us see another example
In minus 6, I have to represent in signed magnitude form
What is the binary value of 6?
I represent 6 with 4, 2, 1 code
It is 1, 1, 0
Here, actual binary or magnitude is represented in signed bit
Here, negative 6 is represented
Negative is represented by 1
What is actual binary of 6?
It is 1, 1, 0
In signed magnitude form,
Negative 6 is represented in this form
Let us see the next question
The first question
Express 1, 1, 1, 1
It is given in signed magnitude form
What should we do for this?
Decimal
We have to convert this in signed magnitude form to decimal
We have given the options
Option A, Option B, 0, Option C, 7, Option D, 7
In signed magnitude form,
I have given the options
Let us see the MSB of this question
MSB is the most significant bit
The most significant bit is the bit on the extreme left
The value of MSB is 1
What is MSB 1?
It is negative
Let us note it
We know that the value of the question is negative
What to do next?
Actual binary
MSB is written here
Here, it is signed bit
We can take MSB in the position of signed bit
Let us represent MSB
Let us see the signed bit
MSB's position is 1
Since it is 1, it is written here
Now, let us take the actual binary
Actual binary
1, 1, 1, 1
1, 1, 1
What is 1, 1, 1, 1?
It is 7
The answer is
Minus 7
Let me repeat it
Express 1, 1, 1, 1
In signed magnitude form,
I have to change it to decimal
What to do next?
Let us check the MSB
MSB is the most significant bit
The most significant bit is the bit on the extreme left
Let us check the MSB value
MSB is 1
What does MSB 1 indicate?
The number is negative
It is given to the signed bit
The actual binary 1, 1, 1 is also represented here
What is the actual binary 1, 1, 1?
It is 7
The answer is negative 7
This is how the signed magnitude form of the question should be represented
First, the ones complement
How do we get the ones complement?
By complementing each and every digit of a binary
For example, I have a binary 1, 0, 1
We have to find the ones complement of it
What is the definition of ones complement?
By complementing each and every digit of a binary
We get the ones complement when we take the complement of each digit of the binary
We start from LSB
LSB is the bit on the extreme right
What is the complement of 1?
It is 0
What is the complement of 0?
It is 1
What is the complement of 1?
It is 0
We have to take the corresponding complement of each and every digit given in the question
That is the ones complement
Next example
1, 1, 0, 0
How do we get the ones complement?
We start from LSB
The complement of 0 is 1
The complement of 1 is 0
What is the complement of 1, 1, 0, 0?
It is 0, 0, 1, 1
Next example
1, 0, 1, 0
How do we get the ones complement?
We start from LSB
The complement of 0 is 1
The complement of 1 is 0
The complement of 0 is 1
The complement of 1 is 0
What is the complement of 1, 0, 1, 0?
It is 0, 1, 0, 1
What is the once complement?
How do we get the ones complement?
We need to take the complements of each and every digit given in the binary
Then we will get the once complement
We took the complements of each digit given in the binary
This is reversible
For example, we take the ones complement of 0, 1, 0, 1
The complement of 1 is 0
The complement of 0 is 1
The complement of 1 is 0
when we add 1 to 1's complement, we will get 2's complement
for example, 1 1 0 0
find the 2's complement
write 1 1 0 0 and find the 1's complement
replace 1's complement with complement of each bit
0's complement is 1, 0's complement is 1, 1's complement is 0, 1's complement is 0
we are starting from LSB
2's complement is adding 1 to 1's complement
add 1 to 2's complement
add 1 to LSB
1 plus 1 is 0 with a carry over 1
1 plus 0 is 1, 0
2's complement of 1 1 0 0 is 0 1 0 0
next question
find the 2's complement of 1 0 0 1
find the 1's complement
1's complement is 0, 0's complement is 1, 0's complement is 1, 1's complement is 0
we got 1's complement
next is 2's complement
add 1 to 1's complement
0 plus 1 is 1, 1
2's complement of 1 0 0 1 is 0 1 1 1
we got 1's complement of 1 0 0 1
we replaced 1's with 0's and 0's with 1's
we got 0 1 1 0
add 1 to 1's complement
0 plus 1 is 1
answer is 0 1 1 1
this is the method of 1's and 2's complement
now we will see the syntax representation of 1's and 2's complement in signed number representation
first we draw a box
then we give sign bit
in signed magnitude representation syntax is
sign bit and actual binary
but how to write when 1's complement syntax representation of signed number comes
sign bit
sign bit and 1's complement
1's complement
actual binary
actual binary is represented here
here it is same as signed magnitude form
instead of actual binary we have to give 1's complement
1's complement of actual binary is represented in this box
let's see the example
minus 6
for minus 6 i have to give 1's complement as signed number representation
so how to write
actual binary of 6 is
4 2 1 represents 1 1 0
actual binary of 6 is 1 1 0
now take 1's complement
1's complement of actual binary is
1 0 0
we got 0 0 1
now where we have to give this 0 0 1
0 0 1
now the question is what is minus 6
minus represents 1
sign bit is 1
so how to represent minus 6 with 1's complement
how to represent with signed number 1's complement
represented in this form
1 0 0 1
sign bit indicates 1
actual binary's 1's complement is represented
this is how 1's complement is represented
next
how to represent 2's complement
next
2's complement is represented with signed number
sign bit is represented in this form
2's complement of actual binary is represented
this is the difference
same question
minus 6 is represented with 2's complement of signed number
actual binary of 6 is
1 1 0
how to get 1's complement
1 0 0
now take 2's complement
2's complement is added with 1's complement
1 1 0
carry 1
1 1
0 1 0
2's complement of actual binary is represented
0 1 0
minus 6 is represented with 1
2's complement of minus 6 is
1 0 1 0
next
express the decimal number minus 15 in sign magnitude form
1's complement form
2's complement form
minus 15 in sign magnitude form
1's complement form
2's complement form
15 to the decimal number
15 to the base 10
convert it to binary
we have learnt decimal to binary conversion
how is the division
7 times
14
remainder 1
6 times
remainder 1
1 time
remainder 1
how to write
1 1 1 1
actual binary of 15 is
1 1 1 1
now i have to represent it in 3 forms
first is
sign magnitude form
first case i have to represent it in sign magnitude form
to write in sign magnitude form
draw a box
give a syntax
this is sign bit
negative 15
sign bit will be 1
write the actual binary
1 1 1 1
negative 15 is represented in sign magnitude form
second is 1's complement form
draw a box
sign bit
1's complement is sign bit
sign is 1
it is negative
now take 1's complement of 15
actual binary of 15 is
1's complement is 0 0 0 0
0 0 0 0
now take 2's complement
draw a box
sign bit is represented
sign bit is given
now
we can add 1's complement
with the previous 1's complement
do not find it separately
adding 1's complement with 1's complement
is 2's complement
0 plus 1 is 1
0 is written below
0 0 is written below
0 0 0 1
so
minus 15 is represented in sign magnitude form
how to get it
in this form
sign bit of all is 1
because question is negative
because question is negative 15
sign bit of all is 1
rest of the values are different
1's complement in sign magnitude form
is not 1's complement
it is 2's complement
ok
next question
express the decimal number
minus 31 in 8 bit binary number
in sign magnitude form
1's complement form
2's complement form
here
8 bit is given
8 bit binary
8 bit binary representation
we have to change
in sign magnitude form
1's complement form
2's complement form
8 bit
8 bit is
MSB
sign bit
remaining bits
7 bits
remaining bits
7 bits is
actual binary
8 bit binary
8 minus 1
is actual binary
8 is given
MSB
it is sign bit
see
31
we have to change it to binary
to change it to binary
we have to do division
15
714
36
1
2
1
0
1