Adobe Scan 26-May-2023
Adobe Scan 26-May-2023
I1
I • n,r, M•r~fd "' 1 hHrt·t urr hu• llf1 1tr1vAn4w (,I ttnu,.,,, tn.afru1'tlntU i t,
t·vrf<'I thrin Prtru•rfm1 tV11n Nt·1HnNttll) ttH hfln httt, "ftu• f.t beatHt" A rtm• h ..c,r. thir •m,,,urt
I of 1n~tr,1ttllon r,nu,Urlt~t,1 t'.flf1 1,,. Adil( ivt"1 tn th,. ff•rvMtl nrehtt,.rh1rt. du.- ftl stipnr ttA
mtrnory bnnki.
1,4. l Dtffer-ence b etw-een Von Neunt1nn 111d ff 1,-.ud At-c'tthutvre ,
LW
P,og m.tm
mlm , mlm O~mlm
Add 11
-Control bu1
__ J L _J
Aoor11t &. control oin
f
Figure 1,8 Control Bu•
i ....._-:,,-----------------------L____ Figure 1·9 Add,••• aJ1d Conuol Bu•
--- ---
lA.2 A.dvantagea and Dh1adva.ntages of Vo n Neuman
and Harvard Arch ,tecture :
Advantagea of Von Neuman :
I I
I
I l\ticropro«&Sor Based S3istems
f nstructlons In fewer 1·nstrucU01
• fhe Harvard architecture has an advantage of executing
Is because a much greater amou
!' _cycles than Princeton (Von Neumann) architecture. This
f of instruction parallelism can be achieved In
the Harvard architecture due to separa
j memory banks.
f
ard Architecture :
! 1.4-.1 Difference between Von Neumann and Harv
i
f Data bus and address bus are separate.
i
• Data bus and addr~ss bus are not separate. •
So greater flow of data is possible.
♦
;
tr So greater flow of data is not possible.
• It is called RISC microcontroller. (RISC ·
I
I , It ts called CISC microcontroller. (CISC - Reduced Instruction Set Computer).
I
Com plex Inst ruct ion Set Computer)
It has less number of instructions .
•
• It has mor e num ber of instructions . No diVisfon and multiplexing is requ ired
•
i' • Division and multiplexing Is requ ired to because address bus and data bus are
'f'
use prog ram and data . separated.
i
! Instruction Data
! Data bus bus bus
f
I
Data m/m
l CPU Program: Data
Prog m/m
i m/m I m/m
I
I
j
1.4.2 Advantages and Disadvantages o
f Von Neuman and Harvard Architecture :
2• Simple construction
.3 . Bus structure 1s not complex
not be used simultaneously.
Disadvantages of Von Neuman : e not separate, it can
I As the data and address bus arl becomes difficult.
I .
2. The Implementation of pipe Un ng .
I
I _cycles than Princeton (Von Neumann) architecture; This Is because a much greater amount
f of instruction parallelism can be achieved In the Harvard architecture due to separate
i' memory banks.
I
i
I 1.4.1 Difference between Von Neumann and Harvard Architecture :
I
!
f
I
I
!
I
i
'
I
• Data bus and address bus are not separate. • Data bus and address bus are separate.
'
I
l
r So greater flow of data is not possible. So greater flow of data is possible.
;
I
Data m/m
I
I
!
CPU Program, Data
m/m , m/m
I Figure 1.8 Control Bus Figure 1.9 Address and Control Bus
'
I
! · d Di dvanta.ges of Von Neuman and Harvard Architecture :
I.4.2 Advantages an sa
r'
tatlon, taUon.
5. Very few addres sing modes . 5. A large numbe r of addres sing mode.s.
f
i
I ► QuestJ on.s :
I I. Explain wtth block d~am of ciJgital cornpute-r.
I 2.
S.
Write dl!ferencc between Microp rocesso r & Microcontroller.
Wnte short notes about Micro Com.pute:r.
can rtad, wrne nnd proceM 8-..blt data at a ume. The tnttrn.af arcfHttcture of 8085 mtcroprocessor
ts shuwn tn Figure 2.'11 . Thi~ includes the foJlowtng bfocks:
(l) ~egtst-er Stock (ff) Arfthrnettc and Logi c Unit (ALU} Block.
Ott} Control Unit Block {fv) tnterru pt. block
I I
' >
\J 1
\J
I, . ., I \J ,;
j Accumulator! Temporary IFlag Register I Instruction
1
i-
WReg ZReg
1
register register
B Reg C Reg
D Reg E Reg
,_, .. r--- \)
-,)i Arithmetic H Reg L Reg
Instruction
-
f-
Logic
Unit
- decoder Stack Pointer
and Program
) ALU
y machine Counter
Power
Supply
C GND
+5V T cycle
encoder Incrementer/
Decrememer
Address latch
___ .J___ _ _ _ _ _ _ _ ~•J_)~ -
CLK x,_ r Timing and Conirol
,..,
-
IN X2- CLK
CONTROL STATUS DMA RESET Address Addr~'i-'i/Dalll
GEN ~ ~ ~ ~ buffer buffer
l
CLKOUT RD
RE.ADY WR
I t
ALE
So
l
SI
JO/M
I
HOLD RESET IN
RESET
I
V
A, 5 - Ag
Adur~s~bus
I
)
e
AD1 - AD 0
Datu / Add~s
OUT bus
~ D6 D5 D4 Flag register ls
D3 D2 a gr ou p of eigh
I II I I I I I
s \ z X AC X
p
D1 D0
X CY
ou t of which five
Information ab ou
fllp-flops ar e us
ed
t lndlvidual flip
-flop ,
to st or e si gn if ic
t th e re su lt of th an t
X-Don't Care op er at io ns : T he e ar it hm et ic an
ot he r th re e fl ip d logic
Figure 2.13 Flag -f lo ps ha ve un
Re gi st er values . The bi ts de
of th e flag re gi fi ne d
st er an d th ei r
• Carry Flag {CY)
it ls re se t (0)
: If an arithmetic
. The ca rr y flag
al so
op
se
codes ar e show
eration results In
n ln figure 2. 13
carry, a th e ca rr
.
y flag ls se t ( l );
co nd it io n
\
th e dual pu rp os rv es as a borrow fla otherwise
e of showing carr g for su bt ra ct io
y an d borrow in case of n. T he ca rr y flag solves
It is re pr es en te ad dl ti on an d su
d by D bi t of fla bt ra ct io n respec
0 g register. tively.
• Pa ri ty Fl ag {P)
: T hi s nag bi t
nu m be r of on es (D 2 ) shows the
re su lt of th e ar it
or od d. Si nc e 80 hm et ic op er at io
nu m be r of ones 85 m ic ro pr oc es so r follo n is having even
in ac cu m ul at or ws even pa ri ty
It is cleared (0) af ter arithmetic op sy st em so lf th
. eration Is even, e
th is flag is se t (
l ), ot he rw is e
• A ux ili ar y C ar
ry Fl ag (AC)
: In an ar it hm
nibb le an d pa ss et ic op er at io n w
ed to up pe r ni hen a ca rr y Is
in te rn al ly for bb le, th e auxiliar ge ne ra te d by lo
BCD (B in ar y C y ca rr y fl ag (AC) ls se t. wer
programmer. D od ed Decimal) T hl s flag ls us
bl op er at io ns . A C ed
4 t of fllp-flop re pr es en fl ag ca n no t be us ed
• t th e au xiliary ca rr y fla by th e
Zero Flag (Z) g.
: T he zero flag
ze ro or non-zero sh ow s th at the re su lt
. T he zero flag of any ar lt hr ne tl
Is se t ( l) when th c or logtc op er
_Zero flag ls re pr e re su lt ls zero at io n ls
es en te d by D : ot he rw
6 bi t of flag register. is e it ls re se t {0).
• Si gn Flag (S) :
T he sign flag Is
D7 of th e re se t re pl ic a of th e D
is l; ot he rw is e 7 bl t of th e re su lt .
It Is re se t (0) . Si T he sign flag ls
N ot e : Flags gn flag ts re pr es se t ( \} If bi t
ar e m od if le d on en te d by D bl t
ly af te r the exec 7 of flag register.
E u m p lc 2. 1 : ution o f an ar
lth m et lc or lo gi
Add tw o he xa c operatton.
{l ag re gi st er fo de ci m al nu m be
r th is op er at io rs 93 H an d 15 H. D et
n. er m tn e the st at
us o f the
So lu ti on :
Internal
FET
.I
I
I
pull up I
Internal bus -- -1 D I
0
Write to
latch
LATCH
CL Q
Pin
3.X I
Read Pin data
Alternate Input
Figure 3.18 Internal Circ uit of
Port 3
Th e Por t 3 alte rna te use s are
shown in the followtng table :
Table 3.4
P3. l TXD
SBUF
Serial Data Output
P3. 2 SBUF
INTO External Int err upt 0
P3. 3 INTI TCON.l
External Int err upt I
P3. 4 TO TCON.3
Ext ern al Timer 0 lnp ut
P3.5 Tl TMOO
External Timer 1 Ou tpu t
TMOD
P3. 6 WR Ext ern al Memory Write Pulse
P3. 7 RD Ext ern al Memory Read Pulse
Vlll\.. ' J V ~ .. - .. -- - - •
• I
Serla1 110•
Tim ers/Coun ters. and a clock cfrc utt
The 51 1s one of the most popular mtcroco
80 ntrollers today. Many deri vative mic ro-controlle
rs
have stnCe been developed. that are based on compatible wtth the 805 1. Thu s, the abil ity to
program an 8051 1s an Important sklll for anyone who plans to develop products that wtll tak e
advantage of mtcrocontrollers. The fig. 3. I shows block diag
1-'~u.:~pt::F~~?
J.r '7·•;i,.
f!;.'f{~p: .
f;:~"'¢_o~~i l a'.t".cta
C , . , D .~W
~
.; oo.Uf
_uf fttt~
fnif~
1'
ram of 805 I mlcrocontroller.
l\
.
The descrtptlon of each block ts as follows :
a.4.1 CPU Registers :
• ALU:
Arithmetic & Logical Unit (ALU) ts capable of
operating on byte level and bit level. ALU
performs arithmetic functions like addition,
subtraction. multiplication and division. It ls
capable of performing logical functions normally also
called Boolean functions.
• Register A :
The A regtster ls also called as accumulator.
It ts used for many operations. particularly
mathematical and logical operations, and Boo
lean bit manipulations. The A register ls
used for all data transfers between the 8051 and also
any external memory. If stores the answer of
logical & Mathematical operation.
• Register B :
The B register ls used wtth the A register
for multJpllcatlon and division operations and
1as no other function other than data stor
age.
3,4.2 PC and DPTR :
Program Counter (PC) :
Byte
Address Byte
AddreH
1F R7 7F . - - - - - - i
1E R6
10 R5
qi M
'lh~ 1C R4
·-Cll 111
C
Q) a) 18 R3
1A R2
19 R1
18 RO
17 R7
16 R6
,._ 15 RS
SN 14
~~ R4
Cl Ill
a: m
Q) 13 R3
12 R2
11 R1
Byte Bit
\
10 RO address address
OF R7 2F 7F 78
OE R6 2E 77 70
,._
OD RS 20 6F 68
s..- OG R4
Ill~ 2C 67 60
i'ial OB R3 28 5F 58
OA R2 2A 57 50
09 R1
29 4F 48
08 RO 28 47 40
07 R7 27 3F 38
06 RB 26 37 30
05 RS 25
~c 2F 28
- JI. 04 R4 24
ii 27 20
03 R3
" Ill 23 1F 18
02 R2 22 17 10
01 R1 21 OF 08
00 RO 20 07 00
7, .__ _ 0 30 '- '- -- -- -'
Working Registers
Bit addressable General Purpose
3.4.4 PSW :
It Is also called as Program S tatus Word . PSW contain nag ,rcglstcrs. which stores 1-blt
, r rtaln prrn,warn tnstructton 9., 'the 805 1 has four math, nags : , Carry0),(C), Auxiliary
resu It o ce · -e-· -
Carry CAC). overfl ow {OV) and Pa ri ty (P). It also contain§ user program nag (F .
s.4.8 Memory :
• Internal Memory :
'l'he 805 J has 128 bytes of Internal RAM , called data memory and 4KB of Internal ROM ,
called program memory.
Intern al RAM Is dlvtded In three categories
• Four register banks (RBO-RB3), each containing eight registers.
• 16 bytes, which may be addressed at the bit level (20h - 2Fh)
• 80 bytes of general-purpose data memory (30h - 7Fh)
Internal ROM 4KB occupies code address space 0000h to 0FFFh.
• Enernal Memory :
I Add!ttonal both RAM & ROM memory can be added up to 64 KB externally using suitable
circuits. External memory fetched by connecting the external access pin (EA pin no. 31 on
805 I chip) to ground .
Special Function Register IP, IE, TMOD, TCON, SCON and PCON contain control and status
bits for the interrupt system, the Timer/Co unters, and the Serial port.
• IP, IE are used for interrupts .
• SCON ls used for serial communlc atton.
• TCON, TMOD are related with timer/cou nter .
• PCON for power saving mode.
3.4. 7 I/0 Ports :
There are 32 Input/Out put pins arranged as four 8-bit ports; each port pln has a latch bit.
Port can be configured as Input by writing Logic l and Output by writing Logic o.
Q Port O : An 8-btt port for the Input/Output (l/0) and data bus cum lower order address
bus (AD0-AD7).
:t
g (~
lo
l\'
PO WE R{ - + SV
) SUPPLY -G ND
TECHNICAL PUBLICATIONS®
- An up thrust for knowledge
8085 Interrupts
No
f-~ ·!i:ff!bttr
!41t,,,~m"#t
Fig. 3.6.6 Flowchart for Interrupt sub
routine
TECHNICAL PUBLICATIONS®
• An up thrust for knowledge
Define T state in microprocessor and microcontroller
10:35 am ✓/
e tv, essage
In microcontrollers, SJMP and LJMP are two differ ent
types of jump instru ctions used for contro lling the program
flow. The main differences between these two instru ctions
are as follows:
In summ ary, SJMP is used for short jumps within the same
code segment, while LJMP is used for jumpi ng between
differ ent code segments such as subro utines .
10:51 am
In microcontrollers, JB and JNB are two jump instructions
used for controlling the program flow. The main difference
between these two instructions is:
1 Unread Message
e ~ essage