Coa Unit1
Coa Unit1
T-I
Comput
erOrgani
zat
ion:
Itisconcer
nedwit
hthewaythehardwarecomponentsoperat
eandt
he
waytheyar
econnect
edtoget
hert
of or
mt hecomputersyst
em.
Comput
erDesi
gn:
Iti
sconcernedwi
tht
hehar
dwar
edesi
gnoft
hecomput
er.
ComputerArchit
ect
ure:
I tisconcernedwitht
hest
ruct
ureandbehav
ioroft
hecomput
eras
seenbyt heuser
.
Bl
ockdi
agr
am ofadi
git
alcomput
er
Que:
1.Dr
aw&explai
nhardwareconf
igur
ationofBasicComput
er.
2.Dr
awneatsket
chofblockdi
agram ofDigi
tal
Computer.
Ans:
Thehardwar
eofthecomput
eri
susual
l
ydi
vi
dedi
ntot
hreemaj
orpar
ts,
asshowninFigur
e.
Centr
al ProcessingUni t( CPU) :
oI tcontainsanar ithmet icandl ogicunit(ALU)f
ormani pul
ati
ngdat a,a
numberofr egi
st ersf orstoringdata,andcontrolci
rcuit
sforfetching
andexecut i
nginst ructions.
Random AccessMemor y:
oI tisstoragef orinst r
uct i
onsanddat a.
oI tiscal l
edar andom accessmemor y(RAM)becauset heCPUcan
accessanyl ocat i
oni nmemor yatr andom andretri
evethebi nary
i
nf ormat i
onwi thi
naf i
xedintervaloftime.
IOP:
o I tcont ai
nsel ectronicci rcuit
sf orcommuni cati
ngandcont rol
l
ingt he
transferofi nfor mat i
on bet ween t he computerand I /
O Dev ices
key board,mouse, printers,monitoretc.
Fl
i
pFl
ops
Que:
1.WhatisFli
p-Flop?ListtypesofFl i
p-Fl
ops.
2.Li
stanyfourt ypesofFli
pFl ops.
3.Defi
neFli
pFl opandwr it
eanyt woappl i
cati
onsofit
.
4.Expl
ainSRFlipf l
opwi t
hdi agram andtruthtabl
e.
5.CompareRSandJKf li
p-fl
ops.
6.Expl
ainTFli
pf lopwithdiagr am andtruthtabl
e.
Ans:
Def
ini
ti
on:
oI
tisabi
nar
ycel
lcapabl
eofst
ori
ngonebi
tofi
nfor
mat
ion.
Ty
pesofFl
i
pFl
op:
1.SRFl
i
p-Fl
op:
oI
thast
hreei
nput
s,l
abel
edS(
forset
),R(
forr
eset
),andC(
forcl
ock)
.
2.DFl
i
pFl
op:
o TheD(data)fl
i
p-f
lopi
sasl i
ghtmodif
icati
onoftheSRf li
p-f
lop.
o AnSRf l
ip-f
lopisconver
tedtoaD f l
i
p-fl
opbyi nsert
ingani nver
ter
bet
weenSandRandassi gningthesymbol Dt
ot hesinglei
nput.
3.JKFl
i
pFl op:
o AJKf l
i
p-f
lopisaref
inementoftheSRfl
i
p-f
lop.
oI nsteadoftheindet
erminatecondi
ti
oni
nSRf li
pfl
op,t
heJKfli
p-f
lop
hasacompl ementcondit
ionQ(t+1)=Q'( t
)whenbothJandKar e
equal t
o1.
4.TFl
i
pFl op:
o TheT( Toggl
e)f
li
p-f
lophasonlytwocondit
ions.
o WhenT=0( J=K=0)acl ocktr
ansi
tiondoesnotchangethestat
eof
thefli
p-fl
op.
o WhenT=1( J=K=1)acl ocktransi
ti
oncompl ement
sthestat
eofthe
fl
ip-f
lop.
Regi
ster
Def
ini
ti
on:
Ar egi
steri
sagr oupoff
li
p-f
lopswi
theachf
li
p-f
lopcapabl
eofst
ori
ngone
bitofi
nformat
ion.
Shi
ftRegi
ster
Que:
1.Li
sttypesofShif
t-
Register
s.
2.Defi
neShiftRegi
sterandwrit
eanyt
woappl
i
cat
ionsofi
t.
Ans:
Ar egi
stercapabl eofshif
ti
ngitsbi
naryinf
ormati
oninoneorbot hdir
ecti
ons
i
scal l
edashi f
tregist
er.
Ar egi
stercapabl eofshifti
nginonedirect
iononlyi
scalledauni di
rect
ional
shiftr
egist
er.
Ar egi
sterthatcanshi f
tinbothdir
ect
ionsiscal
ledabidi
recti
onalshi
ft
regist
er.
Someshi f
tr egist
ersprovidethenecessaryi
nputandout putterminal
sf or
parall
eltr
ansf er
.
Logi
cGat
es
Que:
1.Dr
awt
het
rut
htabl
eforl
ogi
cORandl
ogi
cEX-
ORmi
crooper
ati
ons.
Ans:
Regi
ster-Tr
ansf
er-
Language
Que:
1.Def
ineRegisterTransferLanguageandexpl
aini
mpor
tanceofi
t.
2.WhatisRegisterTransferLanguage?
3.Def
ineregi
stertransferlanguage.
4.Gi
vet
hedef
ini
ti
onofMi
croOper
ati
onsandRegi
sterTr
ansf
erl
anguageand
wr
it
eshor
tnot
eont
ypesofmi
crooper
ati
ons.
Ans:
Regi
sterTr
ansf
er
Que:
1.Explai
n,withill
ustr
at i
on,howRegi st
ercanbedi splay edandexpr essed.
2.Explai
nanyt hreesy mbolsusedi nregistert
ransf erlanguagewi thexampl e.
3.Explai
nregistertr
ansf eroperati
onwithsui t
ableexampl e.
4.Givehardwar eimplement ati
onformi crooperationP: A←B.
Ans:
Defini
ti
on:
o The" regist
ert ransfer"i
mpl i
est hehar dwar el ogiccircuit
st hatcan
perform ami crooperati
onandt r
ansferther esultoftheoper ati
onto
thesameoranot herregi
ster.
Comput erregist
ersar edesignatedbycapi t
alletterst or
epresentthe
f
uncti
onoft heregister.
Forexampl
e:
o MAR-memor
yaddr
essr
egi
ster(
Ithol
dsanaddr
essf
ort
hememor
y)
o PC-pr
ogr
am count
er
oI
R-i
nst
ruct
ionr
egi
ster
o R1-pr
ocessorr
egi
ster
Bl
ockdi
agr
am ofr
egi
ster
:
Fi
gur
eshowst
heBl
ockdi
agr
am ofr
egi
ster
:
Bl
ockDi
agr
am ofRegi
sterTr
ansf
er:
Fi
gur
eshowst
hebl
ockdi
agr
am ofRegi
stert
ransf
erf
rom R1t
oR2.
Thenout putsofr egi
sterR1ar econnectedtotheni nputsofr egisterR2.
Thel etternwillbeusedt oindicateanynumberofbi t
sforther egister
.Itwil
l
ber eplacedbyanact ualnumberwhent helengthoft heregisterisknown.
Regi st
erR2hasal oadinputt hatisact
ivat
edbyt hecont rolv ariableP.Itis
assumedt hatt hecont r
olv ari
ableissynchr
onizedwi ththesamecl ockas
theoneappl i
edt otheregister.
Asshowni nthet imi
ngdi agram,Pi sacti
vat
edi nthecont rolsect ionbyt he
ri
singedgeofacl ockpulseatt i
met .
Thenextpositi
vet r
ansi
ti
onoftheclockatt i
met+1f indst heloadinput
act
iveandthedatainput
sofR2arethenloadedint
otheregisterR1.
Pmaygobackt o0attimet+1;other
wise,thet
ransf
erwilloccurwithevery
cl
ockpulsetr
ansit
ionwhil
ePremainsacti
ve.
Basi
cSy
mbol
sforRegi
sterTr
ansf
ers:
Thebasi
csy
mbol
soft
her
egi
stert
ransf
ernot
ati
onar
eli
stedi
nTabl
e.
1.Regi
ster
s:
o Theyar edenotedbycapital
let
tersandnumer alsmayf ol
lowt he
l
etters.
2.Parent
heses:
o Theyar eusedtodenoteapartofaregisterbyspecif
yingther angeof
Bits.
3.Arr
ow:
oI tdenotesatr
ansferofi
nfor
mat i
onandt hedir
ectionoftransfer.
4.Comma:
oI ti
susedt osepar
atetwoormor eoperati
onst hatar
eexecut edatthe
samet i
me.
BusTr
ansf
erandMemor
yTr
ansf
er
BusTr
ansf
er:
Que:
1.Expl
ainBusTr
ansf
erandMemor
yTr
ansf
eri
nbr
ief
.
2.Expl
ainr
egi
sterbussy
stem f
ordat
atr
ansf
er.
3.Expl
ainBusTr ansfer
.
4.Expl
ainBussy stem Datatr
ansferf
orf
iveRegi
ster
susingMul
ti
plexer
s.
5.Expl
ainBussy stem Datatr
ansferf
orf
ourRegist
ersusi
ngMul
tipl
exers.
6.Expl
ainregi
sterbussy st
em fordat
atr
ansfer
.
7.Expl
ainBUSTr
ansf
erusi
ngMul
ti
plexer(
4Regi
ster
).
8.Expl
ainBusTr
ansf
erandMemor
yTr
ansf
eri
nbr
ief
.
9.Whati
sBUS?Li
stBusesusedi
nComput
erAr
chi
tect
ure.
Ans:
Amor eef fi
cientschemef ort ransf er ri
ngi nformationbet weenr egi st ersisa
commonbussy stem.
Abusconsi stsofasetofcommonl ines, onef oreachbi tofar egi ster ,
thr
oughwhi chbi naryinformat ioni st ransf er r
edoneatat i
me.
Onewayofconst r
uctingacommonbussy stem iswithmul tipl
exer s.
Abov eFi g.showsbussy st em f orf ourr egi sters.
Eachr egisterhasf ourbits, number ed0t hrough3.
Thebusconsi stsoff our4x1mul ti
pl exer s.
Eachmul t
iplexerhasf ourdat ai nput s,0t hrough3, andt wosel ect i
oni nputs,
S1andS0.
TheFi g.showst hatt hebi t
si nt hesameposi ti
oni neachr egi st erare
connect edt ot hedat ainput sofonemul ti
pl exer.
ForExampl e,MUX0mul t i
plexest hef our0bi tsoft her egist ers,MUX1
mul ti
plexest hef our1bi tsoft her egist ers,andsi mi l
arlyfort heot hert wo
bit
s.
Thet wosel ect ionl i
nesS1andS0ar econnect edtot hesel ectioni nput sof
all
f ourmul t
iplexer s.
Thesel ecti
onl ineschooset hef ourbi tsofoner egisterandt ransf erthem
i
ntot hef our -
linecommonbus.
ForExampl e,WhenS1S0=00,t he0dat ai nputsofal lfourmul tiplex ersare
selectedandcont entofr egi sterAar epl acedont hebus.
Followingi sTr uthTabl eforr egist ersel ect i
onbyt hebus:
S0 S1 Regi
stersel
ect
ed
0 0 A
0 1 B
1 0 C
1 1 D
Thesymbolicst
atementforabustransferi
sasfol
l
ows:
BUS←C, R1← BUS
Thecontentofr
egisterCispl
acedont hebus,
andthecont
entoft
hebusi
s
l
oadedintoregi
sterR1.
Thr
ee-St
ateBuf
fer
:
Que:
1.Expl
ainTrist
atebuff
ergate.
2.Expl
ainthr
eestatebuff
ers.
Ans:
At hree-
stategat
eisadigit
alcircui
tthatexhibit
sthr
eest at
es.
Twooft hestat
esaresi
gnalsequi val
enttologic1and0asi naconv enti
onal
gate.
The t hi
rd stat
ei s a hi
gh-impedance st ate.The high-i
mpedance st at
e
behavesli
keanopencircui
twhi chmeanst hattheoutputisdisconnected.
Thegr aphicsymbolofathree-stat
ebuffergateisshowni nbelowFig.
Memor
yTr
ansf
er:
Que:
1.ListMemor yTransferOper at
ionandDef i
neanyoneofi t.
2.Ex plai
nMemor yTransfer.
Ans:
Memor yTransferOper ati
on:
1.Thet r
ansf erofinformat i
onfrom amemor ywor dtoRegist
eriscal
l
eda
r
eadoper ati
on.
2.Thet ransferofi nformationfrom regi
sterintothememor yiscall
eda
wri
teoperation.
Amemor ywor dwil
l besymbol i
zedbythel et
terM.
Memor ywor disselectedusingthememor yaddress.
Theaddr essofMemor yisenclosedinsquar ebracket
sfol
lowingthel
ett
er
M.
1.ReadOperat
ion:
TheReadoperati
ontransfer
sthei
nfor
mat
ioni
ntoDRf
rom t
hememor
ywor
d
M sel
ect
edbyt headdressinAR.
Assumethatt
heinputdat
aareinmemoryaddr
essspeci
fi
edi
nRegi
sterAR.
Thereadoper
ati
oncanbestatedasf
oll
ows:
Read:DR← M[AR]
2.Wr
it
eOperati
on:
Thewri
teoper ati
ont ransf
ersthecont
entofadatar egi
stert
oamemory
wordM selectedbyt headdress.
Assumethatt heinputdataareinregi
sterRlandtheaddressisi
nAR.
Writ
eOperationcanbest at
edsy mbol
ical
lyasfol
l
ows:
Wr i
te:M[ AR]← R1
Ar
it
hmet
icMi
cro-
Oper
ati
ons
Que:
1.Defi
neMicro-Oper ati
on.ListAri
thmet i
cMi cro-Operat
ion.
2.WhatisMicro-oper at
ion?
3.Expl
ainAr
ithmet icMi croOperati
onwi thexampl e.
4.Expl
ainAr
ithmet icmi crooperat
ion.
5.Expl
ainAr
ithmet icAddi t
ionandSubt racti
onMi crooperati
ons.
6.Expl
ainAr
ithmet icIncrementandDecr ementMi crooperati
ons.
7.Expl
ain4bitbinaryadderwi thblockdi agr
am.
8.Desi
gna4-bi tBinaryAdder -
SubtracterCir
cuit.
9.Drawandexpl ai
nonest ageofAr i
thmet i
cci r
cuit
10.
Expl
ain4bitAr i
thmet icCir
cuitwithexampl e.
11.
Drawonest ageofar ithmeti
ccircuit
.
12. Dr
awandexpl
ain4-
bitar
it
hmet
icci
rcui
t.
Ans:
Mi
croOper
ati
ons:
Def
ini
ti
on:
Microoper
ati
onsar
eelement
aryoper
ati
onsper
for
medondat
ast
oredi
n
regi
ster
sorinmemory
.
Ty
pesofMi
croOper
ati
on:
Therearefourt
ypesofmi crooperati
onsthataredescr
ibedbel
ow:
1.Regist
erTransf
ermicr
ooper at
ions:
o Thi soper
ati
ontransfersdatafrom oneregi
stert
oanother
.
2.Ari
thmeticmicr
ooperati
ons:
o Thi soper ati
onperfor
msar
ithmet
icoperat
iononnumeri
cdatastor
ed
i
nr egist
ers.
3.Logi
cmi crooper ati
ons:
o Thi soperat i
onperfor
msbi
tmanipul
ati
onoperat
ionsondat
astor
edin
r
egi st
ers.
4.Shi
ftmicrooper ati
ons:
o Thi
soper
ati
onper
for
msshi
ftoper
ati
onsondat
ast
oredi
nregi
ster
s.
Ar
it
hemat
icMi
croopr
ati
on:
Basi
cAr
it
hmet
icoper
ati
onsar
eshowni
nfol
l
owi
ngTabl
e:
Oper
ati
ons Sy
mbol
i
cFor
m Descr
ipt
ion
Additi
on R3←R1+R2 Cont
entofR1pl
usR2t
ransf
err
edt
oR3
Subtracti
on ̅
R3←R1+R2+1 R1plus2’sComplementofR2
I
ncrement R1←R1+1 I
ncrementthecontentsofR1byOne.
Decrement R1←R1- 1 DecrementthecontentsofR1byOne.
Compl ement ̅
R1←R1 Compl
ementt
hecont
entofR1(
1’sCompl
ement
)
Negat i
on ̅
R2←R2+1 2’
sCompl
ementofR2
Bi
nar
yAdder
:
Bi
nar
yAdder
-Sunt
ract
or:
subtr
acti
onA–Bcanbedonebyt akingt
he2'scompl
ementofBandaddi
ng
i
ttoA.
Theadditi
onandsubtract
ionoper
ationscanbecombi
nedintoonecommon
ci
rcui
tbyi ncl
udi
nganexclusi
ve-
ORgat ewit
heachful
l
-adder
.
A4-bitadder-
subt
ract
orcir
cui
tisshowninFig.
Themodei nputM cont r
olst heoper at
ion.WhenM =0t hecircuiti
sanadder
andwhenM =1t hecircuitbecomesasubt ractor.
Eachexcl
usive-
ORgat er eceiv esi
nputM andoneoft heinput
sofB.
WhenM =0,wehav eB⊕ 0=B.Thef ul
l-
addersr ecei
vet hev al
ueofB,the
i
nputcarr
yis0, andtheci rcuitperf
ormsApl usB.
When M = 1,we hav e B ⊕ 1 = B'and C0 = 1.The B i nputs ar
e al
l
complementedanda1i saddedt hroughthei nputcarry.
Theci
rcui
tper f
ormst heoper ati
onApl usthe2'scompl ementofB.
Bi
nar
yIncr
ement
er:
Theincr
ementmi cr
ooper ati
onaddsonet oanumberi naregi
ster
.
Forexample,i
fa4-bitregist
erhasabi naryv
alue0110,i
twil
lgo0111af
teri
t
i
sincremented.
Thediagram ofa4-bitcombi nat
ionalci
rcui
tincr
ementeri
sshowninbelow
Fi
g.
Oneoft heinputst ot hel eastsi gnif
icanthalf-adder(HA)isconnect edto
l
ogic-1andt heot heri nputi sconnect edt othel eastsi
gnif
icantbitofthe
numbert obei ncrement ed.
Theout putcar r
yf rom onehal f-adderi sconnect edt ooneoft heinputsof
thenext-hi
gher-orderhal f-adder.
Theci r
cuitreceivest hef ourbitsf r
om A0 t hroughA3,addsonet oit,and
generatestheincrement edout puti nS0t hr
oughS3.
Theout putcarryC4 wi l
lbe1onl yaf terincrement i
ngbinary1111.Thisalso
causesout putsS0t hroughS3, t
ogot o0.
Ann-bitbinaryincrement errequiresnhal f
-adders.
Ar
it
hmet
icCi
rcui
t:
Thebasi
ccomponentofanar i
thmeti
ccir
cuitistheparal
lel
adder.
Bycontr
oll
i
ngt hedatainputstotheadder,itispossibl
etoobtai
ndi
ff
erent
ty
pesofari
thmeticoperati
ons.
Thedi
agram ofa4-bitari
thmet
iccir
cuiti
sshowni nFig.
I thas fourf ul l
-adderci rcuit
st hatconst i
tutethe 4-bitadderand four
multi
plexersfor
choosi
ngdi ff
er entoper ati
ons.
Therearet wo4- bitinputsAandBandone4- bitoutputD.
Thefourinputsf r
om Agodi r
ectl
ytot heXi nputsofthebinaryadder
.
Eachoft hef ouri nputsf rom Bar econnect edt othedat ainput
soft he
multi
plexers.
Themul ti
plexersdat ainput salsoreceivethecompl ementofB.
Thefourmul ti
pl exersarecont rol
ledbyt wosel ecti
oninputs,
S1andS0.
Theinputcar ryCin goest ot hecar r
yi nputoft heFAi ntheleastsi
gni
fi
cant
posi
ti
on.Theothercarri
esareconnect
edf r
om onestagetothenext.
Theoutputoft
hebi nar
yadderiscal
culat
edf r
om thefol
l
owingari
thmetic
sum:
D=A+Y+Cin
Where,
- Ai sthe4-bitbi
nar
ynumberatt heXinput
s
- Yist he4-bitbi
nar
ynumberatt heYinput
softhebinaryadder.
- Cinistheinputcar
ry,
whichcanbeequal t
o0or1.
3.Whicharethebasi
clogi
cmicrooper
ati
ons?
4.Expl
ainLogicMicr
ooper
ati
ons.
5.Whichar
ethebasi
clogi
cmi
crooper
ati
ons?Dr
aw&Expl
ainsi
ngl
ebi
tLogi
c
uni
t.
6.Expl
ain(
anyf
our
)appl
i
cat
ionsofLogi
cMi
croOper
ati
ons.
7.ExplainAppl i
cationofLogi cMi crooperations.
Ans:
Logi cmi cr
ooper ationsspeci fybinaryoper ati
onsf orst ringofbi t
sst oredin
regi
ster.
Logi coperati
onsar eper for medoneachbi tofther egistersepar at
ely.
Exampl e:
o Assumet hateachr egi sterhasf ourbits.
o Letthecont entofAbe1010andt hecont entofBbe1100.
o Theexcl usive- ORmi crooper at
ioncanbeasf ol
lows:
1010 cont entofA
1100 cont entofB
0110 cont entofC
I tspeci f
yal ogicmi crooper ati
ont oexecut edont hei ndi
vidualbitsoft he
regi
sterAandB.
Sy mbolicRepresent ationofLogi calOperation:
o Thesy mbol Vdenot esanORmi crooperation
o Thesy mbol∧denot esanANDmi crooperation.
o Thesy mbol⊕ denot esanEX- ORmi crooperation.
o The baron t op oft he registername denot es the compl ement
mi cr
ooper ation.
Exampl e:theex clusi v
e-ORmi crooper ati
onwi thcont entoft wor egisterA
andBi swritt
enas:
P:C←A⊕ B
Li
stofLogicMi crooperati
ons:
Ther ear e16di fferentl
ogicoper at
ionsthatcanbeperformedwitht
wo
binar
y
vari
ables.
Theycanbedet erminedfrom allpossi
bletr
uthtabl
esobtainedwi
tht
wo
binar
yv ar
iablesasshowni nTable.
Int hi
stabl
e,eachofthe16columnsF0throughF15representsatr
uthtabl
e
ofonepossibl
eBooleanfunct
ionf
ortwovari
ablesxandy .
The16Booleanfuncti
onsoftwovari
abl
esxandyar eexpressedinal
gebrai
c
for
mi nbel
owTable.
OneBi
tLogi
cUni
t.
Thehar dwareimplementat
ionoflogi
cr ni
crooper
ationsrequir
esthatl
ogi
c
gat esbei nsert
edforeachbiti
ntheregist
erstoper for
mt herequi
redl
ogi
c
funct i
on.
Figureshowsonest ageofaci r
cuitthatgeneratest hefourbasicl
ogi
c
rnicrooperati
ons.
Itconsistsoffourgatesandamultipl
exer.
Theout put
soft hegatesareappliedtothedatai
nputsofthemulti
plexer
.
The
Two selecti
oni nput
sS1andS0chooseoneoft hedatainput
soft he
mult
iplexer
anddirecti
tsvaluetotheout
put.
Foralogiccir
cuitwit
hnbits,
thediagram mustber
epeat
ednt i
mes.
Appl
icat
ionofLogi
cMi
crooper
ati
on:
Logicmi crooperati
onsar everyusefulformanipul
atingindiv
idualbit
sora
port
ionofawor dstoredi nar egi
ster.
Theycanbeusedt ochangebi tvalues,delet
eagroupofbi t
s,orinsertnew
bitv
al uesi ntoar egister.
Thef ollowingexampl esshowhowt hebi t
sofoner egist
er(designatedbyA)
aremani pulated.
Inat y picalappl i
cation,registerAi sapr ocessorr egi
sterandt hebitsof
regi
sterBconst i
tuteal ogicoperandex tr
actedfr
om memor y.
(
1)Sel
ect
iveSet
:-
Thesel ect
ivesetoperat
ionsetsto1t hebit
si nregi
sterAwher
ether
ear
e
correspondi
ng1’sinregi
sterB.
I tdoesnotaffectbi
tposit
ionthathas0’sinregist
erB.
Exampl e:
-
1010 Abef ore
1100 B( LogicOperand)
1110 Aaf t
er
Here,thetwoleft
mostbit
sofBar e1’s,
sothesetto1.
Thetwobi tsofAwithcorr
esponding0’
sinBremainunchanged.
From observat
ionofthet
ruthtabl
ewecansayt hati
nselect
ivesetORmi
cro
operat
ionisbeingused.
(
2)Sel
ect
iveCompl
ement
:-
Thesel ecti
vecomplementoper
ati
oncomplementsbi
tsi
nAwher
ether
ear
e
corresponding1’
sinB.
I tdoesnotaf f
ectbi
tposi
ti
ons.
Exampl e:-
1010ABef ore
1100B( Logi
cOperand)
0110AAf ter
(
3)Sel
ect
iveCl
ear
:-
Thesel
ect
ivecl
earoper
ati
oncl
ear
sto0bi
tsi
nA onl
ywher
ether
ear
e
correspondi
ng1’
sinB.
Example:-
1010 A before
1100 B( Logi
cOper
and)
0010 A after
Here,t
hetwoleft
mostbitsofBare1’s,sot
hecorr
espondi
ngbit
sofAare
cl
earedto0.
WecanobservedthatBool
eanoper
ati
onperf
ormedonindi
vi
dual
bitsi
nAB’
.
(
4)MaskOper
ati
on:
-
Themaskoperat
ionissi
mil
artothesel
ect
iveclearoper
ati
onexceptt
hatt
he
bi
tsofAarecorr
espondi
ng0’si
nB.
Exampl
e:-
1010 A bef or
e
1100 B( LogicOperand)
1000 A af t
er
Thetwori
ghtmostbi
tsofAar
ecl
earedbecausethecor
respondingbi
tsofB
are0’
s.
Thetwolef
tmostbit
sofAareunchangedbecausethecorrespondi
ngbit
s
are1’
s.
Themaskoperat
ioni
sanANDoperat
ion.
(
5)I
nser
tOper
ati
on:
-
Thei nsertoperati
oninser
tsanewv alueint
oagr oupofbit
s.
Thisi sdonebyf i
rstmaki
ngmaskingt hebitsandthenORingthem wit
hthe
requirevalue.
Exampl e:-
Supposer egist
erAcontentsei
ghtbit
s01101010.
Tor eplacef i
rstfourl
eftmostbit
sbyt hevalue1001,weshouldfi
rstmask
thefourunwant edbit
s.
01101010 A bef
ore
00001111 B( Mask)
00001010 Aaftermaski
ng
Andi nsertt henewv al
ue:
00001010 A before
10010000 B( i
nsert
)
10011010 Aaf t
erinser
ti
on
Themaskoperat
ioni
sanANDoper
ati
onandt
hei
nser
toper
ati
oni
sanOR
micr
oOper
ati
on.
(
6)Cl
earOper
ati
on:
-
ItcomparesthewordsinAandBandproducesanal l0’
sresul
tift
het
wo
numbersareequal
.
Thisoper
ati
onisachi
evedbyEx-
ORmicrooper
ation.
Example:
-
1010 A before
1010 B( LogicOperand)
0000 A after
Shi
ftMi
crooper
ati
on
Que:
1.Whati sShi ftmi croOper ation?Expl ainanyonei ndet ai
l.
2.Expl ainanyt woshi f
tmi crooper ati
on.
3.Dr awbl ockdi agr am of4- bitshiftregister.
4.Whati st hedi fferencebet weenAr i
thmet i
cShi f
t&Logi cShiftmicr
o
operat i
ons?
Ans:
Shi f
tr nicr ooper at i
onsar eusedf orser ialtr
ansferofdat a.
Thecont entsofar egistercanbeshi ftedt othel ef
tortheright.
shi f
t-l
ef toper ation:
o Theser i
al inputt r
ansf er sabi tintother i
ghtmostposi ti
on.
shi f
t-rightoper at i
on:
o Theser ial i
nputt ransf ersabi tint otheleftmostpositi
on.
Thei nf ormat iont ransferredt hrought heser ialinputdeter
mi nesthet
ypeof
shif
t.
Ther ear et hreet ypesofshi fts:
1.Logi cal Shift
2.Ci r
cul arShi ft
3.Ar i
thmet i
cShi ft
1.Logi
calshi
ft:
Thesy mbolsshlandshrar
eusedf
orl
ogi
calshi
ft
-l
eftandl
ogi
calshi
ft
-
r
ightr
nicr
ooper
ati
ons.
Forexampl
e:
R1← shlR1
R2← shrR2
I tspeci
fya1- bi
tshif
ttotheleftofthecontentofr
egi
sterR1anda1-
bit
shi
fttot
her i
ghtofthecontentofregist
erR2.
Thebitt
ransferr
edtotheendposi t
ionisassumedtobe0duringal
ogi
cal
shi
ft.
2.Ci
rcul
arshi
ft
:
Thecircularshi
ft(al
soknownasarotateoperati
on)cir
culatesthebi
tsof
theregist
eraroundt het
woendswit
houtl ossofinf
ormation.
Wewi l
luset hesy mbol
scilandci
rf orthecircul
arshiftlef
tandright
,
respecti
vely.
Thesy mbolicnotati
onfort
heshi
ftr
nicrooperat
ionsisshowni nTabl
e.
3.Ar
it
hmet
icShi
ft
Anarit
hmeticshi
fti
sar ni
crooperati
ont hatshif
tsasi
gnedbinar
ynumber
tothel
eftorri
ght.
Anarit
hmeticshi
ft-
leftmulti
pli
esasi gnedbi nar
ynumberby2.
Anarit
hmeticshi
ft-
rightdi
videsthenumberby2.
Ari
thmeti
cshift
smustl eavethesi gnbitunchangedbecausethesi
gnof
thenumberremainst hesame.
wheni ti smul ti
pliedordividedby2.Thel eft
mostbi ti
nar egist
erholds
the
signbit,andt heremai ni
ngbi tshol dt henumber .
Thesi gnbi tis0f orposit
iveandIf ornegative.Negat i
venumber sarein
2'scompl ementf orm.
Below Fi gure.showsat y
picalr egisterofnbi ts.BitRn-1 i
nt heleftmost
posit
ionhol dsthesi gnbit.Rn-2 i
st hemostsi gnifi
cantbi toft henumber
andR0i st heleast
Signi
ficantbi t
.
Thear ithmet icshi f
t-
ri
ghtleav est hesi gnbitunchangedandshi ft
st he
number( t
ot heright.ThusRn-1 r emai nsthesame;Rn-2 r eceivesthebit
from Rn-3andsoonf ortheotherbi tsi ntheregister
.
Thebi tinR0i slost.
Bl
ockdi
agram of4-bi
tshif
ter:
Acombinati
onalcir
cuitshi
ft
ercanbeconst
ruct
edwi
thmul
ti
plexer
sas
showninbelowFig.
The4- bitshi
fterhasf ourdatainputs,A0 throughA3,andf ourdataoutputs
H0t hroughH3.
Ther ear etwoser ialinputs,oneforshiftleft(IL)andtheot herforshi
ftri
ght
(h).
Whent heselecti
oni nputS=0,t heinputdat aar eshi
ftedr i
ght(downi nthe
diagram) .
WhenS=1, theinputdat aareshift
edl ef
t( upint hedi
agram) .
Thef unct i
ont ableinFi g.showswhi chi nputgoest oeachout putafterthe
shift.
As hifterwithndat ainput sandoutputsr equiresnmul ti
plexers.
Ar
it
hmet
icLogi
cShi
ftUni
t(ALU)
Que:
1.Dr
awonest
ageofar
it
hmet
icl
ogi
cuni
t(ALU)
.
Ans:
Toper f
orm amiaooperati
on,thecontentsofspecif
iedregi
stersareplaced
i
nt he
i
nputsofthecommonALU.TheALUper f
ormsanoper at
ionandt heresul
tof
theoperat
ioni
sthentransfer
redtoadest i
nati
onregi
ster
.
Onestageofanarit
hmet i
clogicshi
ftunit(ALU)i
sshowni nbelowFig.