354 39 solutions instructor manual 9 introduction 8051 microcontrollers chapter 9
TRANSCRIPT
-
8/12/2019 354 39 Solutions Instructor Manual 9 Introduction 8051 Microcontrollers Chapter 9
1/1
91
Chapter9
Introductionto8051Microcontrollers
SolutionstoThinkandAnswerExercises1. Findthecontentsoftheflagsinthe8051afteraddingthebinarynumbers01011100B
and11000101B.
Resultis00100001BflagcontentsareP=0,OV=0,AC=1,andCY=1.
2. WritethebinarywordtobewrittenintothePSWofthe8051,toselecttheregisterbank2intheinternalRAM.
PSW CY AC F0 RS1 RS0 OV P
Bitaddress D7H D6H D5H D4H D3H D2H D1H D0HX X X 1 0 X X X
ThedatatobewrittentothePSWforselectingtheregisterbank2is(00010000B)or
10H.
3. Giveatleasttwoexamplesofsituationsinwhichtheoverflowflagisset.The conditions under which the OV flag is set after adding signed numbers are as
follows:
Positive+Positive=Negative
Negative+Negative=Positive
Positive Negative=Negative
Negative Positive=Positive
4. Whatdoesa0inthezeroflagmean,afteranarithmeticoperation?Azerointhezeroflagmeansthecontentoftheaccumulatorisallzero.
Microprocessors and Microcontrollers Kumar, Saravanan & Jeevananthan
Oxford University Press 2011