architecture
The architecture of 8051 consists of the following parts:
- CPU
- Clock oscillator
- Bus Control Unit
- 4 I/O Ports
- 4 kB ROM
- 128 B RAM
- Timers
- Interrupt Control Unit
- Serial Port
- ALU (8-bit)
It can also perform 1-bit operations.
- Accumulator – A Register (8-bit)
It is the only register that can interact with external memory devices.
- B Register (8-bit)
It holds operands along with accumulator and also the result.
- Program Counter (8-bit)
It is used to fetch instructions and provides the ROM address during data transfer.
- DPTR (16-bit)
It stores the 16-bit addresses of external RAM or ROM during data transfer.
- Stack Pointer (8-bit)
The Stack can be placed anywhere in the internal RAM.
PUSH and POP instructions are used to alter the SP
When 8051 is initialized, SP contains the value 07H.
- Program Status Word (8-bit)