BInary Number Representation

SrikrishnaThota 656 views 17 slides Aug 25, 2020
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

Digital Electronics


Slide Content

REPRESENTATION
OF
BINARY NUMBERS
T.SRIKRISHNA

Representation of Binary Numbers:
•Binary numbers can be represented in signed
and unsigned way.
•Unsigned binary numbers do not have sign bit.
•Whereas signed binary numbers uses signed
bit as well as these can be distinguishable
between positive and negative numbers
T.Srikrishna, M.Sc, M.Tech. GVP

T.Srikrishna, M.Sc, M.Tech. GVP

1. Unsigned Numbers:
•Unsignednumbersdon’thaveanysign,thesecan
containonlymagnitudeofthenumber.
RepresentationofUnsignedBinaryNumbers:
•Sincethereisnosignbitinthisunsignedbinary
number,soNbitbinarynumberrepresentits
magnitudeonly.
•Zero(0)isalsounsignednumber.Thisrepresentation
hasonlyonezero(0),whichisalwayspositive.
•Example-1:Representdecimalnumber92inunsigned
binarynumber.
(92)
10=(1011100)
2
•It’s7bitbinarymagnitudeofthedecimalnumber92.
T.Srikrishna, M.Sc, M.Tech. GVP

2. Signed Numbers:
•Signednumberscontainsignflag,this
representationdistinguishpositiveand
negativenumbers.Thistechniquecontains
bothsignbitandmagnitudeofanumber.
•(a)SignedMagnitudeMethod.
•(b)1’sComplementMethod.
•(c)2’sComplementMethod.
T.Srikrishna, M.Sc, M.Tech. GVP

2.(a)Signed Magnitude Method
•Inthismethod,numberisdividedintotwo
parts:SignbitandMagnitude.
•Ifthenumberispositivethensignbitwillbe0
andifnumberisnegativethensignbitwillbe1.
•Example:Letweareusing5bitsregister.The
representationof-5to+5willbeasfollows:
T.Srikrishna, M.Sc, M.Tech. GVP

•The drawback of this system is that 0 has two
different representation
•one is -0 (e.g., 1 0000 in five bit register) and
second is +0 (e.g., 0 0000 in five bit register).
T.Srikrishna, M.Sc, M.Tech. GVP

2.(b) 1’s Complement Method
•Positivenumbersarerepresentedinthesame
wayastheyarerepresentedinsignmagnitude
method.
•Ifthenumberisnegativethenitisrepresented
using1’scomplement.Firstrepresentthenumber
withpositivesignandthentake1’scomplement
ofthatnumber.
1'scomplement
•The1'scomplementofanumberisfoundby
changingall1'sto0'sandall0'sto1's.Thisis
calledastakingcomplementor1'scomplement.
T.Srikrishna, M.Sc, M.Tech. GVP

•Example of 1's Complement is as follows.
T.Srikrishna, M.Sc, M.Tech. GVP

•Example:Let we are using 5 bits register. The
representation of -5 and +5 will be as follows:
T.Srikrishna, M.Sc, M.Tech. GVP

•+5 is represented as it is represented in sign
magnitude method.
•-5 is represented using the following steps:
(i) +5 = 0 0101
(ii) Take 1’s complement of 0 0101 and that is
1 1010. MSB is 1 which indicates that number is
negative.
•MSB is always 1 in case of negative numbers.
T.Srikrishna, M.Sc, M.Tech. GVP

•Notethat drawback of this system is that 0
has two different representation
•one is -0 (e.g., 1 1111 in five bit register) and
second is +0 (e.g., 0 0000 in five bit register).
T.Srikrishna, M.Sc, M.Tech. GVP

2.(c) 2’s Complement Method
•Positivenumbersarerepresentedinthesame
wayastheyarerepresentedinsignmagnitude
method.
•Ifthenumberisnegativethenitis
representedusing2’scomplement.
•Firstrepresentthenumberwithpositivesign
andthentake2’scomplementofthatnumber.
T.Srikrishna, M.Sc, M.Tech. GVP

2's complement
•The2'scomplementofbinarynumberis
obtainedbyadding1totheLeastSignificant
Bit(LSB)of1'scomplementofthenumber.
•2'scomplement=1'scomplement+1
•Exampleof2'sComplementisasfollows.
T.Srikrishna, M.Sc, M.Tech. GVP

•Example:Let we are using 5 bits registers. The
representation of -5 and +5 will be as follows:
T.Srikrishna, M.Sc, M.Tech. GVP

•+5 is represented as it is represented in sign
magnitude method.
•-5 is represented using the following steps:
(i) +5 = 0 0101
(ii) Take 2’s complement of 0 0101 and that is
1 1011. MSB is 1 which indicates that number is
negative.
•MSB is always 1 in case of negative numbers.
T.Srikrishna, M.Sc, M.Tech. GVP

•The advantageof this system is that 0 has only
one representation for -0 and +0.
•Zero (0) is considered as always positive (sign
bit is 0) in 2’s complement representation.
Therefore, it is unique or unambiguous
representation.
T.Srikrishna, M.Sc, M.Tech. GVP
Tags