0 ratings 0% found this document useful (0 votes) 57 views 76 pages DLD Unit 1 Part1
The document provides an overview of various number systems, including binary, octal, decimal, and hexadecimal, explaining their bases and symbols. It also covers conversion methods between these systems, detailing the steps to convert numbers from one base to another. Additionally, it discusses the representation of signed numbers using complement methods.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save dld unit 1 part1 For Later
UNI! 4
,
Zl Reviews Of Number systems pe Codes ®
,
Numbey = grep of digits 25 collect qumber-
age os Each Sarobol an the number iS
called Figit . ‘
Classifications of lumber System
Rodix:— The rodix or base of the
cusnber syste denotes he | numbey ™
of digits usd fo the ai
> Types of Number systema
a Number Sytem
octat Number Syste
2 Decimal number — sysiem
* bexa Deckrnel — Ntunnbew Spiem.
Deftoition of auumber system?
A number System Consist of oa set of
Symbol S and yules for vepreseohing ony
ee , JfNusnber Suygsteno = ‘
Hor NEOs
$ c
> the vadty of — Bicor oumnber Sypleme
1 Bemuse He Symbsls presente
“2
this System ore 0’ ond ‘Te And
coll “em os BS
Bit A sgl agit
‘axe called as
either ‘0 ove
BE.
mHbe :- group of “4H BES ove
called a@s nibble .
Bye oe group of ‘g bis ove
called oS byte .
ssepresen tation »
Exo ( olor ey,
“NS
® Cit-o1o),
radix- OCtol Number — Sybtem 5
@
> the symbols presented fn this
Ry
d are
syster
0,1, 2) 3,4, 5, Sr T-
> So the
sad?x of octal number system
es tg
> en C eds /, (430s
Decimal ntumber Syatem 1—
> the Sqrnbels> (ox) dtgits presented |
Sn
decimal umber Sysiem ase 10
fnetude (0, 1,2, 3,4,5, 6, 1 8, 9): So
the yadfx of — Deckmal number System
{Ss 1o-
ers C4599) oy (C148. 280
Hexa Decimal ntumber
Syste ;
> the vadip of Hexa Decfmol
Number
“fs 16.
System
> The Symbel s Presented fo This SypterSypnbols += 0,1, 2, 3,4) S, 6, Wy 8,9, *,®&
c, BD, E,-F
Tothes System a represents 10
g— p- "3
c- 1e 2-14
FAIS.
Ext CAB DDS
(a3)
2 Conversions from @e vadty to anothe
va.dtx
aerate we ore penis 1a conversions.
Q Defmal to other rad? x
C)o = Ce Hee Ye, Cie ©
@ other yadtx to Decimal
Ge sy Ce, © de ad yo, 36
@ Binary to cetal ©
@ octat 0 Binary _
@® octal to Hexadecimal 6
© dexa +o octal
@ Binary to Hexa decimal
Yo Hexa clecimoh to Binory BD_—
Hexadecteal — to Benny table .
_* no Hexa clec? ra. t Bono
~ > 8 ma
x al oo 0!
7 : 0010
: iz : oo! \
7 q o 100
! 7 5 o1 01
1 6 out oO
4 % 1 orld
7 f 8 10 00
ee i 1004
u 1 0(A) 1o1o
ai = oul
EP c 1100
1y D 1104
S E en)
isa =e Proveure oe
©
Bicory to vectmal conversion +—
oe
> The dectmol value of she Broory number 'S
of the — Praducts of all ts
the sum ;
ba ~the weights of thet
__ bits muliplied
" vespective positions, In general. 7 binary
Number — worthy a Hae Port of -Cn+!)
BES and a -frocton port of h bits can be
written as
dn dani dan = dy doe dy da dogdn.
Its dedmal equivalent is
(dn 2) + Got afl) 4p -- $d x2.) + (dox2) $ (are)!
(daror)a -----
Bir O emer Grose CDi
a 1101) = palpi? oxo p Peet 1x22
16+ 8+07+2H!
QDio
ie
\rball
@ Convert (nott0!), to decimal
Sols
Ly 3
Yoo 2 Lv ’ 1 [x2
= REF Wy on mee eZ KD FORD T
+S 404241 + OF +0 +
Ne (at 625 dip
0.1257
t
@
Comevt Crtrorly), to dectmatl
Sols-
: ; 8 diya) + 1X2
Pq 1x0) + be + OTH, +
ae 416 +8 40 +77)
= (69),,@® octal oumber susie to — decfmal number Syphon
Jo comvert an octal umber +0 a decimal
number » mul tiply gach df t %m the octal
number by the we. ihe of ts Position
ond — add all the product terms.
the decimal value of he octal number
dn dy daw ---- dido --- dda --- dis
(doxe) 4 (aa Xe) Fo + (ARS) 4(doBS) +
(d-1¥8") 4 (dare )ar- a
Fxomples -—
©. Paver, CSF Te ut Cvstdhy
So]2— & 5 7q
o
= ORS HE SAS FRB
= (A200ewe
BO — convert (B6s2- 14S) to decimal
Solt— 3 6 = 2 ; ras
3 i; Sennen \ ° 4 2k &
BAS + CAE +SXE + 2xXG f KF +UXRKG 4 5*E
"
= 1636 + 384 + GO Fe + O2S 4 00625 0.003}
= (1962+ 1942) 10
_
&y Heoca decimal to = pertmal conversion ;— ©
To convert 9 Hexadecimal number to
decimal , mal biply gach agit fo the
hex — number by SES Postkion wetaie and
odd all those Product = terms.
zt the her number as dn dav” Ado -dada~dx
Ses dec?mal equolont ai
(da x16”) + (doa xO) get (hints! 4 (doK1 6°) +
Car xtet) + (da x1e*)4-—Fromples +—
@® Convert SCT +o decimal ,
Sols— 5 c 1
W
L °
BAG + CXIG + IKIG
Vl
BKIEN + XIE + TEIC?
= U4t ao
@ Convey (64-02 Jig to pectmol +
Soli—- BR YW. pt
1 ° -! -L-
BKIG FURIO + 1ZXIG 42X16
— fotet osies + 00078125 °
"
(eu: S203128 ) lo
Practce(pr) solve
0
convert CBIA3) i to C Dio
@ comer C143c.2AE) et C dy,
@ convert (esac. DDE) yy toe %za oe
&y Dectenal to Bioory conver sioN @
Rules
1 owrtte down the. cumbey
a. Diide ft by 2 and note the remainder
3B. piuide she gquottent obtained by 2 and
note the vermaindey
4G. Repeat the same proce UL weg ee
O os the quotient.
Bq: e.
write the Values of all the vewainders
Stasuking from the bottom 40 the bop
O C4Bo=° 0
[4 8 Gi ese
4 ;
R=? 1 9000),
6-—d-
Z3-—d. ;
1 a1 Ms Most signi feat BE
Msp LSB least signi Rok bit -
esis i Aa)
fake traction p
O13%2 = 0263 0 |
/
o26%2 = 0-52 30
Oo S2XR2 = POY s 4
BOUXL = 00% 6
(426-13),
(10101010. 010),
® (as: 15)p = ¢
Oe
OISA2= [+d
o-SO%x = }00
0: 0O%2 = 6100 -3 oO
0 00xL = 000 730
(as-95) 0 = Litoo. 1100),_& Decimal + octol number System conversion :
> Divide jt by 8 and note he vemoinder,
> Finally See down vemotnders rom bottom
4p 40P
exomples:-@ C6°U6)in= Cy
% (60946
Sele —
dH (6046 yo = (134 20g
® se- 4S50= C Vg
Slt SRE HK ZEB % 3%
O6XB = Us Sy y % Q- 2
OEXE =6USE 1-4
O4xe = 322-5 3
TBS4S) yp = Gurr . xue2& Deckmal to Hex «= dectnal conversion
— a oe pone an
> pivide deetmal number by 1G and
: tovite down yematnders cdrom bottom to
+op to gk dex decimal number -
Ge © (urre)io= 6 Deg
16/4044
16| 256 —0
16, 16 —0o
ee
Solt— (40496) io = C10 do) 7
® ($945), = Cone
(S49 ue
6,569 -1
1b 34 —IS +F
Lt —2
Solt- (89e5) lo = (2 ae ae@ (49 BS)w= C Me
Solt- OSS Ab = 13-6 D3 \ 16/496
0 6 XIb = 956 3 9/ ) wlel-2
or 6xlb = 966 95/9 ae
06x16 29-659
arse — (496-89) = (EO D919) jg
QL. Beary to octal
sumber sysiem conversion
Rulet- Take the Binary number. and from
vighE to left, group all place hollers *9
fplets- add leodtng Beros if necemany.
EL
@ covert (loony = .¢ Yeo!
Sol .- bor1olt
gor Ol OL}
: Ueintokoh ites)
Amsi- (roo) = C133) —
@ cwrvert Ctrot-ollo)2 +0 Cc y
Solt— sO LL OLL. O11 000
= C3 3: 30g@
@ _ Birory to Hexaclecinl agversion 7
“Rulez- Take. the bicary cumber and group
gach 4 bits from: Right —to — left
betore -the decitmol. porot ond tom
ett — to — ought adter re deotval pomt-
£2-- O coovert Atorsi0)1), to Kena”
Sol Ooo! JOO
Ses aa
® covert Crrierity. ©0110)
ya
to Hexa dec? mal.
Sol .- jot t 03111, 0011 0 ooo
(Gres); ,
Arse (MONIT 00110), = (e = 30)
16,G octal number to, Birory Conversion
Rule?- ‘Take, @ach etal igi and convert”
och digit to a benaxy ciple.
Sxt— — @ ~Goowert (uss 20g =. yy
Solt— 4 3 5 2 O
too ol) 10) 010 000
Hod t- (43520) 5 2 (dooor! 101 b10000),
geomet (ED, = Ce
Soli— a 5 4
00) oro .- 10) 1th
Hrai— (iest)e = (oororoltt),Hexa decfmal to Bfoary Cooversion *_
“Rule :— Take Hexa decfmal digit and jwavert
Eoch digit io 4 fs 4 - bit bioasy
POP
Fx O tomers £ AIS), to Binary.
Sols — ER 9g &
1110 fo1o (00 1000
ans (E98) ¢= (10 1010 10011000")
® coverE (5G 3+ CTH), to Binary.
Soi FO UE 3 CG
1000 100) {ll} ool! too Olt 0100
An (89F3- C1416 = (iv00100) Holl. OOOl! 10100),® octal
Rule s—
to +P2.0.
Conversion .
octal —> Binowy —> Hexo
cone
mi (res4)g =
D6
slt- (4 6S 4 )g-(t Wo 101 100)
= (FRO'NG
@O convert : :
T1644. =
| C1644 326)¢ ae Ve
Sele 4 6 44> 32 6
= JIT jlo 100 loo - OU CID NOoovo
MW
(FRY OBO)
Ange (64-326 )q = (FAY 6B0)\¢a
» Rule 2- ‘
UL Hexa —> BG octal .
Hexa decimal to octal cumber Saptem @
Eerowt(F ACV = (
%
So l— FR 6 4
= it to1o Olo
=ppy 11010 0! 10100 \
e151 SI),
err QO Coorvert” (etc y- aid )y
octal number system .
Sols — eA7C4 21D
ve 1000 OLN! 1100 0100 -0010000) 101
1 0,3 F © 4 a oO 3as
a
(1 0 3404 - 1036 \,Loecimal 40 onjothey “dfx + —
y.
ext- O LYFE) m= C 5
3
(uss Dro = (2.0000).
Bowl 32.14 t= Ce
pote RUB axe Trandl + DEP
6u¢ US 454)
(12) 1p
It
4
@ > Convert Ctz10),-t C Ye
step it- ConverE = -fevst — Craio)g t2 C Diy
then (Din «tO octal,_ Representation of Signed Numbers vsing the ©
as Cov i's) Comple ment Method :_—
Sign r magnitude corm, an additional
sign bit 45 ploced tq
at -the Sian be
os
> Fo
bit called the
tvont of the number .
js o 0 » the oumbey 13. pocitive-
at, the _)pusober Gs “negative.
S44 ts
ee
jo pyolfoleTy = +41
co BE. ee
etude.
cigoste ie
the a's (ov 1's) complement sugtem se (peg
qumbers — works tke this:
is Pposttive ; =the | ‘meantiude
io ts true Loa form
© is plozed $n front
signed
a4 - the number
fs 3 sepresented
ond a Sign bit
of Re MSB -
mognitix
Q- aR Pe oumley %s negative , the
is sepresented fq $45 als Cont's) Complemant-SND and a sian LIE } 4s) ploced 85 5
front of 4+Re MSB,
z ify Tojot: |! = 451
on 8,0 (G0 Sign ituda
Signet rognitude : roe
Can 9° as Complement -form)
(aq sigo "'S. complemenk form )
‘Juli tol ofr ft = -51
A ~~~ Cin Sigo ePognitode
sign BE Mognitude tos a)
Lloret + -<)
Sign Bit Magnitude Cin sigo "S complement
Tt oa sfocm’)
ohh poli) -+5)
a enero
sign bit Magnitade
“In sign 3's complement
fori)
Q's Coxmplament form ,
Epes as in gute
Sol +A 4q GE Sor = 9 010110)
's jmp > 11010010
ogy
Seeme Ploroohs -> -457Complements
—_—
ds ond | 10's Complement S *
©
Subtroction of dectinal numbers an be.
accom plished by -the q's and (10S complement
methods.
> the © 4's complement of a decimal
curober %5 obtained by subtracting gach
dite of that — deefmal number from 9.
The 108 complement of O dectmal number
fs obtained. by adding a 1 to 4 Q'S
Complement
Exacoples o—
Find she qls
and 105 complements
-tor Re hollowing decimal numbers .
® 4064
solt- FS complement of 4007 49.9 4
yo 64
3 0
ee
10S complemen” of 4069'S S930
+!
Tits
AMethod of ‘Subtyaction -_
a's comple ment
@- obtain qs complement of the Subtyahand
to the miouend. call
sand add. ft
this cumber is the resule-
Foterymedtate
@® af there ts @ corny, 1 Pt Fndicakex
© the vesutt % pogikive and add te airy
fo the LSD of his wesulk to gee the.
ealca ela a 3S called nd around corr «
® tt there fs 90 carry , FE fedteates
‘the angwey %s negakive
vette 9S FES gig - Complement”. Take the.
q!s complement of = vesutt and “place o
eae Sigh
subtract ‘the “Blowing oe osing 9's
fo
Complement enethod +
O ays -— 385
Solt— a's complement of 387 3
Add 61q to tar Ly
74
3 &
é
yas
ose
Be 3059
ae Add oacund
0
mou
and the Yntermedioke.
front +o dt the * ongoer .
LhSubtract the following osing q's. complement (19)
©
G) uss. 12 — 23614
solt- 4's complement of 2.36.14 18
J. 4 A 94
6
z
tT 63+ 8S
Add 4S5I12 and 463.8@5°
Cie 7
+ V6 3. 3s Feats
Orts-97
Lost 5 Add anound carry ,
243-98
The result fs + gue. 48
Gry 98-15 = Praqere
Sole— a's compl’ pe -yQu2 78
4 ea
Ve a be
poy LPL 1 Geta eee Eel
$457 37 ;
Add 98-95 @ 845.84 9st
; sis: 7
Theat 1S mo cosy wesult ig —ve etre =
So +d 9'5 cormp of jotermediale wexrlt-
AAA AD | vocubkis — 25-37
44 Be
AS.to's Complement’ method of subtraction
> obtain ~— the to's complement of. -Ihe
reyauerAd and add fb to He subhrend—
Subtyahend minuend ,
> Tt there is Corry fn Sntermedale
a t - ¥9 ore the care 4 and the sau b-
1S postbive +
—+> If wu is no carry fo Fokeamedioke
result . Find te ols womplememt™ of tha
{nteamedioke vedull and place negout ve
Sign before “bea Susu Beau FL indicobey
xtsub 4s negative :
Example -— Subtract te following oumbers
vsing 10'S cosmpleme wi *
GY) GSO — 3226
Sols 10'S Complement o-+ 324 ts
Add Uso to 614 en
east
> qs . +)
erg
Oe: ae
igoere the Cons
~The suautb 7? te
SO he vesubis +124S
(Q) Subtract the ~follow'n9 dectwol ovumber
Using 9°8 and 10's complement —_ mekhed.
1) : ie
Cia ae Cet Sa 13).- (365-485
Solt— Using as complement
ee etna
265-18
coan eee eee
634-21
634-21
o's, corp. of 365-1% 3
Add W46-13 to 634/29)
A4GS13
6342)
aah -
M3719 fy Cd ossbind cons )
aaa
344 °35
solution ts (tas-13) — (3688) = +379-35~
using to's Complement
SS 499-44
to's Comp. of «365-18 S 3 6S: 1B
ie see
TGS-13 Cees ei ae
C3yor 63y -22-
+
Gare s
Zi:
4 ignore the Cadoug: -
So the Solubion 1S (44-13) — (868-18) 54319: 35(it) subtract C465 36) 19 -— (897-1310
vsing gs complement 1—
\ 494-949
a's comp. of (8911310 —> sat 3
To2’ 86
Add 6S +36
s6g.2e —> Sotermediote reyule-
5 68°
there §g 90 conor so the weyelb is -vVe
so find ouk 9! Comp, of — Fotermadiabe regu
999+ 94
a's @mp- of 56S 22 ieee
agra
Finally he antuer $8 — 43-17
using ws corplemert— 3 — a
fe re : 494-49
1's Complement oF Ceqt 3) p> F911 3
1o2:36
!
add 46s 36 >
10287 Tegned si
—_——_}+4+
S625
"Here, onto carry preseats Sd eee the result
4s ve. find out 10'S Comp. OF * intermadionbke
wes 499-99
pols comp of 66°23 56 &-23
. oe 3 N eats
Sola rwesull 7S — ; sei ee
: : nena Gatedts and 8's complement —_ subtraction ®
@ Subtract ae Plein osing +3 and 3/3
complement -
(? 46S Yo
( J - (436)5 Hs
a complement of G26 7S uae
ber | 37?
5
Add aet to 165° 34}
Se Wo-S 22
oo
SE
he vest 18 4304
vsing alg complemen b—
if ne ae 4.97
aS complemenr of 436 195 Uses
Ba)
\ 4)
Ciera
add 3uz to 5 5 ce BQ
327 1o-B= 2Ory Subtract the eer vsing B's and 1's
Complement method -
Gaé6-12g — (643.23
( de 4a,
tS 643-23
als Complement of 643-23
134-o4
add shear
a lay sy 10-2
G6 2-646
Hee “There fs no carry so dake the t's onplout
ot “iokermedioke — vautlb -
711.779
t's comp. of 462.66 18 ues, 6%
So the wesult 1S ~3i5.u
eee sae
= 7 6U R28
a's cop. et 643-23 1S Taes4
4)
) a 134-057
Zr
a
Ad 13B4SS ere
gered
“thexe 13 re casey So take siscompumak of
Yotermediake rexel =
tt) 17
6067 eater tere
B1IS71 d
1
BO VdL
Vs and” als Complement! s a)
Notes the mon —aadtan tage of — Partorm “4
Subttactos by the Coenplarneot melhod is.
xeduchos Im the hoadWare,.
Ns and a's Compliment fs used. 79
Binoy athemeble operaktons .
NS tocaplimentt:- Ta 1's Complement
b's vecoms 11'S ad ls becowes O'S
hel
for a. Fireo boon Oumber :
ats Complement t— Add 41 to the 158
of . sls compliment of & ee numbey-
chorackent Shes of o's compliment -_
1 There TS. oe _ unique Zero
Qs the old complement of O 38 O
3. the left most bot cannot be vsed te
eapress A quonkity . Te isa gigo bit -
at 44 13 al ,the number ts eo and
2846 45 A +0, the oumber is posrbine
&)Table. > signed bioary oumbers
pectma | 880 sign ls SPO US oy
j Magnitude -forr, complument Bim Complement form
44 OM ont: ory
46 Ollo * 0110 Did Os,
+5 010) on oe ae
+4 0100 “or 60 o {00
+3 0011 oo' 1 Ole
xx | 0 010 oo1o 0010
+A 0001 000} “000 \
+0 000.0 0 000 0000
-0 1000 | 1 bait ie
i fool | t 410 bys
a2 1010 Hgeplstt yOu | 1.1.10
-3 “1011 1 100 4101
-y 11 00 bP Ode 11 00
-5 1101 1 010 1.0 14
at rio | | ool 1 010
-4 ruil 1-000 1 oo}
-$ oo aad | 00.0Rules or 18 Compliment Axtthmese ; e
= =
1
> To 's complement eubtraction , add the
"3 complement of the gubtrahand to the
minuend -
> aif sthere 1S a coney ouk bring the
Corry oround ond Ye to the LSB. “this is
colle 4 end axraund cont :
> Now — Look at mse, tf this is a 0,
the vesult ts positive and 43 io tue Gea
at the. MsmB fs a | , te sesulé is
negakive and 33 Io. FES Ys comple ment frm ,
> ‘Stoke i's complement to gee the cognitude
aa Bioorg :
Rules or alg Compliment Artth mete ¢—
ieee fae te UR ae
ion M8 _coroplement™ Subtrackion , add the
sis compliment” of the Subtiohend 40 the rrrournd-
> at here is & corer out , iqnere ae+> took ak th MSR, ft +he msg iS 20,
the vesult. ts positive and fg jo true
Broo cforro -
> at Arm mspais ail the wesult Fake 3 Complement to find tks
rao mi EWE ko binor4 -
Erompes + _
Subtract 35 from 95 usingedt!s ood o's
Compliment form.
aac. BS
7 tt
Solt- AS- 3s” u i cen
; We a-O
Binary do aS —> oyowe Sion Us
BS > ~—-g 0100011 eee ei
i-0
\ °
apy VS Comp. of 35" 1S WoWt080 Ls
as pron) ape
* 3S oS 11041100
ary ty tt
oe Doors
rs (Add around corr)
=
DoIIiid2 :
Coote
he result 45 posikive thob is + 00111100gs als Complement method . CY
qs - 3
7
als complement of as is 001000 14
NS compe 11OLI (00
41
eee
go > oho prota!
—35 —> 110119) jeer
asd yy vit
Go D0,11100
go the | result iS = 4 ool 02:
@ Subtract 49 -+from 35 vsing e-bit "8 aod
3s Complement ~fose .
$ol— Bioosy ewe or 9S O10
Broact|. NOUEe do 35s 3 00109001!
35-95 ;
co dace 1S complement of - 957
35 0010001)
= 45° > ,10100000 > Li's compen)
_— oso a
fea 60d Tr} 0000 wa
so the
Here “Thane fx 90 Cassy ood Msb=!wesull- 1S negative :
60 -fted «out MS coroplamew oF — Yotermuadiale
wesutt and put (—) before tha vesutl:
'S comp. of Fatermediale wesull
= O01l!100
So -+he vesultis ~ooll!1060 “(-60)
by usted a! comp. eaekhod
= = a ——
35-457 = ora’
'S"109100000
35 ~—s 001 0001) erro
as > 41010000!
Yo} 0001400
Here -tRere 78 90 Casry presentS and: HMSB= |
so the result 75 oegpkive So od als
complement of Sabermedioke vesule-
tg Comp - ool
2'p eon P- ee
Doli od
So the yesule{s - 001100 te -6da
® Add -25 bo ~45 osing e-bt is £28
complament , fern.
using 1's comP
Soli- 1S complement of —2¢ to alas
ae-)
° ° — 0
sot form iS > 09011001 2G=e
1!
11100110
Be las
S-brE form of 453 001 01101 5
t Vs
Vs tomplement of 46-3 11010010 =)
foe
Add 25 +o -457
se 2D Hoon.
THe NT Od OP LO 4
— 11no 0 en
1d Ovortie al (add around Grd)
1oirtoo!}
A
Lok at MSb=) ‘so the vesute is VE ge is
aa it's Conplement + So find cub — s commplemerd
ot Fntermedioke veswtE te o1000110
Pesce
So the | vesuUrE iS — O1000IL0=-40 2784
= 4
10° 1
using Qs Comp
Shik ar
representokvoo of 25 —> 0001) 00\
1's complimenE of 35 5 1100110
S-kk po sepresentokion of as 3 0010/10)
gis compliment of 45 —5 1010010
+
Hee eee
pporeey
(ee
FS tornpliment” of 25 _y , 100110
+)
i shee ae
Toot
Add aS+o—4s
Hog —S 10011)
“fs +> rigroon)
=A et. 1ti _—
“ao OM 101210
look ot MSB=1+ $0 -the wesult ig © negakive
and 3t 98) fm ‘its compliment - So fend ook
als compliment of fotermediote result and
Put ‘_’ ‘Belove the wesull-
a's comp. of — LOI 1010 1% 0100010)
+)
so the xegult ig
Ee et
oO 10003) 0
ieee eaten
— Oolo00lloO, = 2710eY
@® -pdd +25 to +45 usingrtl's and a's
; Compliment method -
Sa\- vsteg Ng compliment
00011001
“Bt by ‘
; oe a por lol
i 0
Swit | | dor of 445° 1S
1'3 compliment —vepresentation of +25 ig 0001100!
"compliment cepreseotakton af 445 75 00101101
Add +28 f +45
0001100)
yor 7 oto Sl
eis eae, ri \ a
ape 01000110 at
so the
Here 90 tel Presents but =NISB=O
sesulE {S$ 4NVE-
vs 7 2s cocoplinersy—
9 001100 |
0110)
oo)!
O)pd 0110
ee
as wmp. of 28 >
oi] ome To ras 3
Here 74sa20 Hence the vesuth 15 Positive.
So the vreswt 18 401000110 FE + TO® Add -89.18 to +4325 ein athe abet 1!
Ng
complementr —methads .
“\'- Bloasy -for B41 8
ea
x
or1SX 2 = LS 14 .
OsxD eno ay SI
O-0%2 = 6-0 = 0
0-0Xr2 =00 = O
1A-biE “sepresentakion of gq,
pionool . 100
Bin
ay for Aaas
OWRr= O'S DO L
OSA) = tO 3)
0'0%0 = 0-0 30
0'OXO =00 30
bik represent att on of 43.25 18
001010)" D100
Is comp, of 89,718 —5 10100110-001)
Bid 43:25° —> 0010101), 0100
es ° do »oo)
aes OS
=— 46°50 110,900! O88 g
: ian ae.
SF
— 00101110:1000 =—46-S0 = 463°
———
tto00 --2y
—20
were saktsty the le 2 Lor tt real
wren m6 = F1y =y gr-t= BL
re T= ahiy oy RL aI
So Here wetalce 6 bts tor subtrahend € minuend
ee poo100 se
Di1000 24
VWs compob 24 =) yoo NI
& 0.0000 000100
© 11000 ~~ vodit1 (1's come)
}o101!
erence
V $0 FE 73 in is” Bcomplenot
Ns comp. of vesutle -
Here MS@=>
so we home +o -téod
bs Cocop = -0 LOLoo ZB oes
Bats ¥ oe =
wl } Gee |
ai AS comp
a ss 10081)
ry)
pvo1oo _.\. 000100 eae
011000 ~ VDOO C2"s comp) Terpe
10% oo 3 5
yee HsR1 $0 Hod ots comp-o€ dntonL nes ~
fa ooioll
We D> Ott i
TO8Using » als: Coca &, 1 oot)
= = = ie
oo 00100 [e190
000! > 101000 (2s )
, 000 eee peeaegeceeeuatrtee
7 Tet»
MSBe1.- So Had 2's Comp. of Inkormads abe
weSOle * Ws 5 61001)
A Il
Psy»
10100
roe
ous ee
—— }
So the result Wt OLN 00 =—20,
oe
as's 18s compliments
> Iq Hexadecteral cumber subtrachons 15/5
and Ws complements ave used.
> 15'S compliment of (a. Wexadetina) number
1S obtained by exbpracting Boch agit
of Hexadecimal number tyomy 15
Example ,— find 18'S comp. oF (ABe)y
igs weep. of 6A ge SIS 1 IS 6
: 6 A 8 ¢
ase 2 =
a ' a Hexadecimal number i's
obtained by ek) t! to t5's compliment -
a S13,
BE ils wmmp. of eARC =
ate P eae.
~ 18s compliment 9(D subbvact- the —fellowing Hera decimok number
(using 15'S aod les coon plame nk--
= (89 -U6C),.
Solt- Da 15'5 compleme wt-
1S aS 15
15'8 ton. of Ee SS ‘
4 6 ¢
64 4
Add GAS" amd B49 3. Luge) »
GH GAB abso
— 46c 4 BAS 1-6 o2
oo ba) " (Biel oreund eovty)
cromalh.
2S al
ERE Contin oe PS pay
lol's comp. od ee > a
a
add | '6A3. ont yee
ee 6AB W-16 = 3B
oer mw Pe ee
agnor’ St
Hence ~He. result ty. +234Gray code ;_ _
eee 24
> “the Groy code %S OG On weighted code ,
and #8 not suttable for avtthmetic operations.
> F ts a cyclic code becouse succers'e
code words. to thts code dtHer one bE
ees i
Position ooly bE fe fs a ont distance
code -
> Te 48 oko called aS *efleckive code-
> Gro codes gyre vsed fo tastrumentation and
linear OF
data —acquistion sysiems where
They Ne.
on gulor displacement ts ‘measured -
also used in shagt Encoders’, Tlo devices ,
AID @overterS and other — pexipherall aqustprnent.
Boe ae Gro conversion’
Tf an mbit Boary cumber fs wepresented
ba. By Bra “=n By and Rts Grey Code
Equivlent by Gn = Gri" Ga “toheré Gn &Sp
ore the H6Q5, Then the G@ code bits
oxe obtained from “the btoary code 43Gaz 8n > Gort 8a @ Bn ; Gost BiG) Sra #-
6 = BOR.
Examplez— — Conver t- ee eos 4 1001 to the
Gray code + '
[>@> 0-80-04
4 yd
“t 1 1 a4
Grey — to ~ Binoy Con\ier 09 —
—
Baz Go Bate Cn) Gr} Ser® BOG
ee Dh 8+. BOG,
example~
CooverE = Ilo} tO binar ¢ -
So |4— Binory
#
col Greg ol
hh hUlL
Binam UP aeur
| Oo QA-Nt binar4y +0 Goro sable .
2S.
ea A-bit- A-o te
so baat ag
4 ¥ ooo
0 000 :
i 00) Oe
fi 0 ; to.
> | 5 010
ol
3 ® +o WA ih
: y
: 0.2 \
foe oN owl
5 ot on ot
110
7 St 0! 0?
oa | 1 p00 f ua 0
4 1 00d pry ky
lo" VOd Dy ab whos!
Nn 0.14 Le
ay yt 0d yo vo
13 -4u0t i 10) at
i ,ii9 100)
is tt 1 Tt (07-0'O)
ae
Example § eae
@ coovert O10 1,10), +0 Groy code
Birat4
Grog
1 Or Qovor Ov Oo
v wy yw
| 0 fees
y
0
y
\@ , comert (521)g “to Coro ede
sol't- fisst — Coovert ( 52g =C Oh
(52Vy= G 001000010),_
Btoors > 1 ®@ 0 Oo ©! O0G0 0806160
v Se] YY dys
OF Tg bey 6 004 y WEB
ety - Fy cede is Gi0110001!)
© convert Gray oumbeys 1011 0010 to
phoary! and Hera > aed | ockal number -
ele Gro =>) 1 op
, Q @7} 4 us 7 vp dy
se a 78 a ee f
Btn} > aioe
“EL code => rr10o\IVOO
(D.C dng:
octal, - Code 5 ONOUIO®
6 64)
(e805Chasstficattion of Binary codes -_
igh poetic ee d ——
® Numeric, aod. Alphaoumerte codes Pi
> Numesic ‘codes ove codes «which represent
aumerte. fnfesmation - be “only numbers Ag
Series of 03 and IS - §
Eut- B42l, Exceg-a Gray code .
> Numeric “codes used to wepresent- the
a degtts ore called ; Bioary Coded Deion
(eed) codes
Et%- B42', ou21, S21) ove’ BCD codes
s Alpko numer?e toles are Codes : which are
sepiesent alpha numexte ferformatton , ‘Le
letters of “the. alshoker Boal decimal eummbers
as A sequence of 08 and JS.
Eun Ewevie , Asc codes .
Nokes A — of - Kroon y ages which
vepresents a - decimal digit is called a
cede word : All BCD codes’ hove at least six egal codes,@ Weighted and = Non- ede cade s
SS oc op
ne weighted codeR axe — those which
obey the postlion — weighting principle .
Foch position of the — aumber represents
a specie welghr. For foch ger of
sum of the weights of Hore
ies || athe
\
Positions where. the binary digi E is
4s equal +o the dec? mal a which the
Group ee :
€xt- 6421, 242), Sy-2-1 “ane Rei ghled codes,
> Non- weighted codes are codes which
oxe not assigne 4 with an woe ght to
gach di re Posi tion re gach dig 7s
position uithio “Re cumber ts ook assigned
ited Value:
ext- Exeeh—3 (H-3) > Grog once -
® Positively weighted @ Hapkivaly Lighted cols
‘Positively weigintt d Codes 2 —'@y2",2U2, S21,
Bart, 4a.
neegodtucly wee giuted Codes 4 642-73),68 141, 8491)© sequential codes :
an 24
JA “sequentiok code *5 one, tq which
gach
Suceee ding. code wosd tS 9 one non cumbe ¥
green than tS precedtog code word. Such
a ode ~factlitakes ‘nokh ematical crori pulakion
of daka. the sq2i a %S-3 Codes one,
seqinentratl Codes »
© Self complementing codes 2—
Big cepfe is t gasd, | ~bem eet “complementing,
> pp the code fof 4 fs. the complament of
tne code for 0» rhe oie for 8 35 the
commplemen od. he © code. fos 1: and .So 60,
ext aart, T2N", pura BY-P—V, QHZ
®) cyclic codes o
cyclic ; codes ove “Robe - fo whieh a
succurive code word difleres trom precesty
ene tn only oné bit - position. the
or e
also called
, unit digtance cades. he
unit —_dfstanee_ code kame Spectal advantage
fo > that they eninimige -trongitonal Errors,eee Dav}
\ Spe ~GoB_sPAML
lin ait lois} Wa Ppa} @tolypyia
aii | (oN F gan | otvt fF grat} pool | avai
(aul A9°N)} ggoif,arl Fi aol aoolh yal
109 | yivo} (iro | aig rita | 00!
paod | M92} 109] qi. 0 | caro] orto | 1191.
6900+} 1009] ooo |i 01a] arog|ioie| ate!
Spe N MEY VATU ASE VOtO lisa vault 1 taro) ss
(fat eso Fo co (un We MLW a ga a Pr pated Fae (Cerin Tt | Co Nk |
aiot}yoo!t},ortlarotlagaithortiriire
yaol}a19ll}ayie 10a '}qiOljaol
\ 1e+O th &
cools}, tO yO looo@Pooo! {i190 Bir ore
1VEF}oQa1 9} 9019], aH 0 vir G@lgor1ajool?
fen 19109]; GO! piqolyor1of, 190} rie?
att %lgto%-a1e @, 1o0}g1 ee}?
aol a
1110] ,or%-.,ooo;1 000
1000}1000
ylaa aoaee 00a00\-0qa000 0000
Am Tb or No
:
i
Weal ithe] ichs
esx |i-c-he]e-249| \e-44® Retleckive codes -_ :
= = ° 28
code ts binary cede in’
“A vefleative
5 code
which the ‘oleast — 3i aa bits fo
fecal atte “teough arty, ase The = mmivfor
‘mages of itobe ‘fox 0 shrug Por
EA Graq code. ae
B42 Bed COE + (nota Bed ade )
eee
=
> do ths code, gach ° dectral digit , 0 through
Q ’p ts coded by a 4 bik Pa number -
Tt is olso called the | noturall _ binary code
becarige of the iS ,4,2y 00d | weights attached
+o tb : a
> Bt Woo metahted ‘code on fs alo
sequential: . :
the main advantage of Ris , cede ts
tts cose of- conversion +o and. -*4o™m
dectmo.l -
Peohe fe cilesg cefficient than the » pure binory,|
or Example the decal. number 14 con be
ssopresented . OS U0 fm puve benory but a4 0001 0100
2a Burl Code : :
> he fsaceatoge of ‘the ‘Red code %s ‘at,
ovttheneti c operations ose | were _ comple tron ey
Ox in pure frase .
> here axe six illegal covbinations 1010,
en. AREA , Code .
TOU, WOO, NOL, tO ond, tn)
~ Rules for) Bed addftions
© the Fy med addttiod «ts. performed by ;
individually adit “ihe aa tgs of
“the deePinal’ “ otimbeirs expressed . fo Albi
foioary Gate stoaking ror “tha. «LSD.
© af there ete oo 7 and “she Sim
ee an Sllegal code’, correction
wy needed + J 5
® qi shéve a out of one que
to the = next grou ) oF
4% an Weg all veede , + “ene by (oilo) ts added
+o “the Bum tera of ffok group.
Pf the - gum termdedwal additions
Examples
Examples 7 Perfor the “lolowsing
fo the: «= B42! Code. 24
©. B5+23
Sol 8 a5 ool oto) (3s to Be D>
Sea 9010 001d (8 te BeDD
— t never
5 8 Oto] 1900
ore} —*’~
Io he above , mo carrey no tlegad codes axe
Present . so the wesutt %s 5 @=.0101 1000
© 614-6 + 536%
Sel“ ; 6 iNBCD
= 619.6 O1tO ‘Oly 1001. Ore Gra )
= 7 oO 8 iNAdD
wag:6 e104 ool! orp. 1000 (S366 ined)
- 1110
1216: yoty 'dto iitet Cones
eee eeEEE 4 O10 go tro pio ot 10 im egal codes,
us
aT D110 +0100 (Add otto to
Gach)
_ 0010 O00:
poo 0010 0001 OO: 0100
ite ct Pd aN Oe eee
‘ i eee 6 + Y Corrected
Sum )
Bed» subtraction. ¢— ‘
©, wep . -Subsracton ts Performed by subtyacsting
she | diets of goth 4 - bit Goer of the
Subtrahend = -from the tovcespondiog Abe qe
of +he wiquend io Soory Stankicg dron the LSD.TL. here %s 00 bovTOW ror the ete highey
qr the n 20
25 a borrow from the ert group, ther, Gi Ono)
TS subttacded from the difference erm of this
op:
Ez les
correction #5 requsived - Sf there
FS Perfor the ee deci subtractions 1
the $421 BcD code
© 38-10
e
(38 fn BED)
a 001) 1000
TS. 0016 000! tno. beerar?
ecled deference ),
zw 3 Ceost
& 206.1— utd .
er “oO 000 110 ory Gee. Fo eco
206-7 oolo 0000-0 )
eae 0001 9100 Olly» 1000 C1478 SoRCd)
Eh 0000 a ere
ATT ood TDOI «| SHAwM One
13 hea WIDE Ee Sug (toweeded
i gibferente =
58-0Bed +» gubtraedton vsion gis and 303 complement™
Hethads : 20
> subtiachon ts peclormed by Whe complement
Ot he deetmal method. Since 2 Ne
subtracting decimal dig ts, we must form the
“Tals ‘or tots Complement ofthe decimal
Subtwhend -and- Encode that number 70 the.
‘Sunl .code -
Examples
Pecfore> the “folowing decimal subtractions
fn Bep by the’ “als Cormple ment” method.
@ 4os-S — 208.%
‘ : cla)
' 2oe-%
Sols— 43'S cornp, of 206-§ 14
= sa)
4os. =
aos _.
= Soe AAted
aap 19q6°6 Cesa :
196-4 SEE fe axouind coreg )
(46.4
aeoo (Hoss in BH)
HOd Ss ©0100 0000 Olo|,
m1 > gO ttT 1001 0001 0001 (2oB% 4s comp),
potl 100! OOD |
4 oto (one Tivegall (ode,
coae | eee varthere
0) DDD. 1001 OUD+ OUD edd oo)
Seneca (end around
ci ae caxry’)
000) loo) OUD. ott) o e
\ 4 6.4 Ctowetled
didgrence ) ,
© 88 — vos. s- i <)
q's comp. o¢ GOSS 7. aang
‘i SS 8S Nee
vagy
20S'S pereeereeer eet
S944 :
SOs 12 Here ne carry peeseotS So tare
: e949
q's complement of $03.2 ee
piesteeee
-V96' 3
Lis’ 7
2086'S _ 9010 9000. 1000. 1000
s4u4 ae O101 006 0100+ 0100
“yore O1t1 100% 110011100
See [eu 6 or cote dtd
ieee eters SL aa aera
lo DDD Doo H 001170010
° Beu
6
mahmeete coded Present. sheactore ee vesube
ONd FS in HS als complement” dori. ~the 4! comp-of oR 3-6-7
ra —VE.~ Pertorm the — follow Subtraction fo B42)
_ vsing the ols @mfamnent method .
@© BAIT —108 9
444.
Is complement” of 108-9 1S at nae
sqiro
one
Bua O01 clove 0010: INN Saran
ie ’ oO
Sateeee 1800 100! ooot + 000) ea
* . "
eee T0111 tor OFL +1 0:00
Saco 0110 old
apo “4
oe @ 0d, 0 00!! ool!» 1000
v ;
Aqnoe the comp:
code
uence tha. corrected Suen FS “0010 001) o0}1+1000 = 223-%® 206-8 501-6
\ds
206-4
UA ry
eee
693'8
S465 = wl
206'Y4
wary 7
Were
Nie
' 9949-4
Complement of Bone) fs Sot 6
A723
+)
492-4
Here 0 Carr Presents tore Lol
complement oo d-vesulb
: a 444 gy
complement => (ONS
‘ Zool)
pategeect dena
0010 ©0000 Oflo, dI00 )eelge
0100 1001 0010 »oL00
a to \
7
0110 1001 100011900
°° ean qyeneroked MeONS vesulle is
to's complement of 696.6 iS = 30l,2~EXcess—3 codDe;—'
eben ; Fc
> “the x$-3 code ghted . Red code.
tf, @ oN— wer
cane fro the foct
word 18 The corresponding
Tr twa sel4
ahs code derives ts
that gach — binar code.
Burl Code, word plus (00 11) 3 -
code hos Six
Complementing code. the %$-3
fovalid stakes 0000, 0001, 0010, N01, 10 and WI)
XS-3 Add?kod =f ory
ea eS.
add the XS-3 oumbers by
8: Each column
Lop. at mthexe %s on
hon | of any’ ot sre 4e-bit-
adding the” ae qrers
stoakiog for he
cquk.,, from the
groups = sulstoct” ‘ool
aide groups + ad Gere “28 & Cant
oon "40" the © Shen Hein’ o-f es FoUrs >
|
> To add 9 X8-3,
addi
|
cron the. Suro jason oF
t
ouk-
add
ex ocpple
Aoupe
“5 perform the browsing addons 49 8-3 de.
© 31428
oe al oto taro
Sot nna aol lou} .3q 010 «lol. C3 Fo x8-3)
>= 010) Vl
+28 ia Co8in xs-3)
aeeeeeeee eee :
65 10110010} '
aera wd)
See ( Propogole carey)
1100 0101
too oe aCOk
vy ee
TOO! 100° Ceorrecked sumin MS-3=65.
: i - 10/
© AQtb + 3sqy
AU dior ory 1rd» pond C2Keé inxs-3)
254 0110 (000 1100+ OL} (35914 in AS-3)
Coase. Sarah oes ee
foarte ‘Vout bittQ@0110-00000
2 : 1
far ey i : nd Preegste carry
0000 :
1os1 Oooo O11!
a\y :
: See “40
[100 ~pd00 oll » 0000 0000) 0111,000 &
port spolt 00 40011 Stab. Obl Ato
4 ee yjn HOR)
loo)” poy) 1010 0015 i
(tovecte Sun 10
XS-3= 607,00XS-3 Subtraction
cabtract'
23
mea To °.
‘2 subtract fo xs-3 , Subtract the *s-3
bx3
numbers *4 subtraching gach 4-bit group of
the subtrahend from + ‘he corresponding qbit
group oF “pehquend cad trom ‘the LSD:
borrow from the next 4bit
a4 -there . is ne
/ ditternce term ot
Yor > add oot)
such - YOUPS - a4 “there
00 \ trom “ane diferente “erm:
es “the
ts a ‘borrow , sebbratt
Per fore> the. followt og Subboetion io
xs-y_ Code -
Jor. bdfe
@ russ a
24s Lisp! F ovod 1d ON}L 5 1000
eS HOMO F009, 1ODVE 1000 (tes ia 25-3)
(sus fA x5-3)
082 0000
A Bus “on 0.000 : UO 000
4 001N edowy ,o0t!
pot Toll, ool),
this ts corvected — difference is XS—3
ce ool! 10 OOL| = +O%O® fe Ge
B16 I 1000 Yolo . 100) (57-6 in x5-3)
mace o10\ old. 1 eo
: t » ‘tos ‘
ne ea i (21. © in xs-3)
LAWG if “0.01 0 el age
a
4 001! goth +-00t!
uu
This 1S the TT :
No.8 correckd didference &@ 29°6 19
XS-B = 0101 Noo, 1OIl, ,
© asyise vies
asus o10\ -\0ll olbg - 1000
ce pioO gi0l 101 1000
at anon
156°° “Y gob Olot: 110.0 +0002
an cae 1 «001
+ oor! oo on
a
|
O100 [900 joo! ooll
fae
ee
corrected’ yitference; CS: 0100 1000 100) +00'
=, ,/ 1960.29, 8-3 9