0% found this document useful (0 votes)
0 views

Architecture of 8051

The 8051 microcontroller architecture includes an 8-bit CPU, an oscillator, memory components (128 bytes of RAM and 4kB of ROM), and various registers such as the accumulator and data pointer. It features a bus system for communication, a stack for temporary data storage, and an interrupt system to manage higher priority tasks. The architecture supports various operations through its instruction set and registers, enabling efficient processing and control in embedded applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Architecture of 8051

The 8051 microcontroller architecture includes an 8-bit CPU, an oscillator, memory components (128 bytes of RAM and 4kB of ROM), and various registers such as the accumulator and data pointer. It features a bus system for communication, a stack for temporary data storage, and an interrupt system to manage higher priority tasks. The architecture supports various operations through its instruction set and registers, enabling efficient processing and control in embedded applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

ARCHITECTURE OF 8051

Block Diagram Of 8051


Detailed Architecture of 8051 microcontroller
8051 Microcontroller consists of
 An 8-bit ALU&CPU(Central Processing
Unit)
 Oscillator
 Interrupt Control
 Bus Control
 8-bit PSW(Program Status Word
Register),
A and B registers ,
16-bit Program counter ,
16-bit Data pointer register(DPTR),
128 bytes of RAM and 4kB of ROM and
four parallel I/O ports each of 8-bit
width.
CPU(Central Processing Unit):
 The CPU is the brain of any processing machine.
 It is the part that is responsible for managing all
the tasks of the microcontroller. The CPU is an
independent unit.
 It identifies the tasks present in the ROM and then
processes them.
 In the 8051 microcontroller architecture, the CPU
is responsible for managing registers. Registers
are a type of memory in a computer. They can
store and manipulate data.
Accumulator or A register:

 The Accumulator or Register A is the 8 bit register which is most important


and most used 8051 Microcontroller
 The Accumulator is used to hold or store the data for almost all the ALU
Operations like:
 Arithmetic Operations like Addition, Subtraction, Multiplication etc.
 Logical Operations like AND, OR, NOT etc.
 Data Transfer Operations (between 8051 and External Memory)
 register is used to accumulate (or store) the result of all Arithmetic and most
of the Logical Operations.
 More than half of the 8051s 255 instructions manipulate or use the
B Register
accumulator in some way.
 8 bit register
 Used with multiply and divide operations
 In multiplication- after operation it stores higher
byte in B
 In division- holds 8 bit divisor & reminder is
stored in B
Oscillator :
Generally, we know that the microcontroller is a
device, therefore it requires clock pulses for its
operation of microcontroller applications.
 For this purpose, microcontroller 8051 has an
on-chip oscillator which works as a clock source
for Central Processing Unit of the
microcontroller.
 The output pulses of oscillator are stable.
 Therefore, it enables synchronized work of all
parts of the 8051 Microcontroller.
Memory:
 The next part of the 8051 microcontroller
architecture is the memory. For any data
manipulation to occur, we require a set of
instructions.
 8051 microcontroller architecture include two types
of memory, such as : program memory and data
memory.
 The instructions of the CPU are stored in the Program
Memory. It is usually implemented as Read-Only
Memory or ROM, where the Program written into it
will be retained even when the power is down or the
system is reset.
 Data Memory in a Microcontroller is responsible for
storing values of variables, temporary data,
intermediate results, and other data for the proper
operation of the program.
BUS:
 A bus is a group of wires.
 Communication within the microcontroller happens
through this bus. There are either 8 or 16 or more
wires in the bus.
 If the 8051 microcontroller architecture has 8 wires,
it can carry 8 bits of data. If the 8051
microcontroller architecture has 16 wires, it can
carry16 bits of data.
 The bus further falls into two categories: Address
Bus: The address bus in the 8051 microcontroller
architecture is of 16 bits. This bus transfers data
from the CPU to the memory.
 Data Bus: In 8051 microcontroller architecture, the
data bus is 8 bits. It helps in carrying the data from
one place to another
The stack is a part of RAM used by the CPU to store information
temporarily.
 This information may be either data or an address
 In 8051 the RAM locations 08 to 1F (24 bytes) can be used for
the Stack The register used to access the stack is called the
Stack pointer which is an 8-bit register.
 There are two important instructions to handle this stack. One is
the PUSH and the other is the POP.
 The loading of data from CPU registers to the stack is done by
PUSH and the loading of the contents of the stack back into a
CPU register is done by POP.
Stack Pointer (SP)
It contains the address of the data item on the top of the stack.
Stack may reside anywhere on the internal RAM. On reset, SP is
initialized to 07 so that the default stack will start from address 08
onwards.
Data Pointer Register (DPTR) :
 It is a 16-bit register which is the only user-accessible.
 DPTR, as the name suggests, is used to point to data.
 It is used by a number of commands which allow the 8051
to access external memory. When the 8051 accesses
external memory it will access external memory at the
address indicated by DPTR.
 This DPTR can also be used as two 8-registers DPH and
DPL  Data Pointer (DPTR) – DPH (Data pointer higher
byte),
PSW DPL (Data
(Program pointer
Status lower byte).
Word):
 The program status word (PSW) register is an 8-bit
register. It is also referred to as the flag register.
 Four of the flags are called conditional flags, meaning
that they indicate some conditions that result after an
instruction is executed.
 These four are CY (carry), AC (auxiliary carry), P (parity),
and OV (overflow).
CY, the carry flag:
 This flag is set whenever there is a carryout from the D7 bit.  This
flag bit is affected after an 8-bit addition or subtraction.
 It can also be set to 1 or 0 directly by an instruction such as “SETB
C” and “CLR C” where “SETB C” stands for “set bit carry” and
“CLR C” for “clear carry”.
AC Auxiliary carry flag:
• This flag is used by instructions that perform BCD (binary coded
decimal) arithmetic.
• parity flag: The parity flag reflects the number of 1 s in the A
(accumulator) register only.
• If the A register contains an odd number of Is, then P = 1.
Therefore, P = 0 if A has an even number of 1s.
OV, the overflow flag:
 This flag is set whenever the result of a signed number operation
is too large, causing the high- order bit to overflow into the sign
bit.
 In general, the carry flag is used to detect errors in unsigned
arithmetic operations.
 The overflow flag is only used to detect errors in signed arithmetic
operations.
Interrupts:
 In the 8051 microcontroller architecture, interrupts stop
the microcontroller’s current task. Interrupts are caused
when some other program has a higher priority request
for execution.
 When an interrupt occurs, the ongoing task stops, the
sub-routine for the interrupt is executed, and then the
previous job resumes.
 8051 has 5 interrupt sources, out of which two are
peripheral Interrupts, two are timer interrupts and one is a
serial
Control unit: Generates control signals necessary for
port interrupt.
communication between the processor and peripheral
Instruction Register (IR):

 store instructions
 When one instruction is completed, next
instruction is fetched in memory for processing.

Interrupts:
 In the 8051 microcontroller architecture, interrupts stop the microcontroller’s current task.
Interrupts are caused when some other program has a higher priority request for execution.
 When an interrupt occurs, the ongoing task stops, the sub-routine for the interrupt is executed,
and then the previous job resumes .
 8051 has 5 interrupt sources, out of which two are peripheral Interrupts, two are timer
interrupts and one is a serial port interrupt.

You might also like