All Exams Test series for 1 year @ ₹349 only
Question

What is the internal general purpose memory of 8051 micro controller?

This question was previously asked in
RRB ALP 2018 CBT 2 Fitter Question Paper (21-Jan-2019) (Shift 3)
The correct answer is 128 Byte

Understanding 8051 Microcontroller Internal Memory

The 8051 is a popular microcontroller known for its integrated peripherals and memory architecture. When discussing the 8051 microcontroller, understanding its memory organization is crucial. The memory is broadly classified into program memory (ROM) and data memory (RAM).

The question specifically asks about the internal general purpose memory of the 8051 microcontroller. This refers to the on-chip RAM that the CPU uses for storing data, variables, and the stack during program execution.

8051 Internal Data Memory (RAM) Structure

The 8051 microcontroller has 128 bytes of internal RAM, located from address 00h to 7Fh. This 128 bytes of internal RAM is structured into three main areas:

  • Register Banks (00h to 1Fh): This area consists of 32 bytes, divided into four banks (Bank 0 to Bank 3) of 8 registers each (R0 to R7). Only one bank is active at a time, selected by bits RS0 and RS1 in the Program Status Word (PSW). While primarily used as registers, these memory locations can also be used for general data storage when their respective bank is not selected.
  • Bit-Addressable Area (20h to 2Fh): This 16-byte area (addresses 20h to 2Fh) is unique because each individual bit within these bytes can be accessed directly. This is useful for managing flags and single-bit variables. These bytes can also be accessed as general bytes.
  • General Purpose RAM (Scratchpad Area) (30h to 7Fh): This is the main area for storing variables, arrays, and for the system stack. It comprises 80 bytes. This area is specifically designated for general data storage and the stack.

The total internal RAM available on the standard 8051 is \(32 \text{ bytes (Register Banks)} + 16 \text{ bytes (Bit-Addressable)} + 80 \text{ bytes (General Purpose)} = 128 \text{ bytes}\). This entire 128-byte block (addresses 00h to 7Fh) is often collectively referred to as the internal general purpose memory or internal RAM, in contrast to the Special Function Registers (SFRs) which reside in a separate memory area (80h to FFh) and have dedicated functions.

Considering the options provided and the typical architecture of the 8051 microcontroller, the 128 bytes of internal RAM represents the internal memory available for general data storage and program variables, making it the internal general purpose memory.

Analyzing the Options for 8051 Internal General Purpose Memory

Let's look at the given options:

  • 16 Byte: 16 bytes corresponds to the size of the bit-addressable area within the internal RAM, not the total internal general purpose memory.
  • 128 Byte: 128 bytes is the total size of the internal RAM (00h-7Fh), which serves as the primary general purpose data storage area for the 8051, distinct from the SFRs.
  • 8 Byte: 8 bytes is the size of a single register bank (R0-R7), not the total internal general purpose memory.
  • 64 Byte: 64 bytes is not a standard size for any specific section or the total internal general purpose RAM in a standard 8051 microcontroller.

Therefore, 128 bytes is the correct size for the internal general purpose memory (internal RAM) of the 8051 microcontroller.

Memory Area Address Range Size (Bytes) Purpose
Register Banks 00h – 1Fh 32 Register storage (R0-R7 in 4 banks); general use when bank not active
Bit-Addressable RAM 20h – 2Fh 16 Byte and bit-level access; general data storage
General Purpose RAM (Scratchpad) 30h – 7Fh 80 General data storage, stack
Total Internal RAM 00h – 7Fh 128 Internal general purpose data memory
Special Function Registers (SFRs) 80h – FFh 128 Control and status registers for peripherals

Revision Table: 8051 Memory Overview

This table summarizes the key memory areas in the 8051 microcontroller.

Memory Type Location Size (Standard 8051) Description
Internal RAM (Data Memory) On-chip 128 bytes (00h-7Fh) Used for general data, variables, stack. Includes Register Banks, Bit-Addressable area, and General Purpose RAM.
SFRs (Special Function Registers) On-chip 128 bytes (80h-FFh) Registers controlling timers, serial port, I/O ports, etc.
Internal ROM (Program Memory) On-chip 4 KB (0000h-0FFFh) Stores the program instructions.
External RAM (Data Memory) Off-chip (optional) Up to 64 KB Additional data storage accessed via DATA pointer.
External ROM (Program Memory) Off-chip (optional) Up to 64 KB Additional program storage accessed via PC.

Additional Information on 8051 Memory Usage

The way the 8051 uses its internal general purpose memory (RAM) is important for efficient programming:

  • Stack: The stack typically grows upwards from a starting address defined by the Stack Pointer (SP) register. By default, the stack starts at 07h (within Register Bank 0). However, it's common practice to initialize the SP to a higher address within the general purpose RAM (30h-7Fh) to avoid conflicting with Register Banks or the bit-addressable area.
  • Register Banks Selection: Using the PSW register's RS0 and RS1 bits (PSW.3 and PSW.4), you can quickly switch between the four register banks. This is useful for subroutine calls or interrupt service routines to save and restore context quickly without pushing registers onto the stack.
  • Data Addressing Modes: The 8051 offers various addressing modes to access the internal RAM, including direct addressing (using the memory address directly) and indirect addressing (using registers R0, R1, or DPTR as pointers).
  • Bit Manipulation: The 16 bytes from 20h to 2Fh allow individual bits to be set, cleared, or tested using bit-level instructions like SETB, CLR, CPL, JB, JNB, etc. This is very efficient for handling boolean flags or control bits.

Understanding the organization and usage of the 128 bytes of internal general purpose memory is fundamental to programming the 8051 microcontroller effectively.

Was this answer helpful?

Similar Questions

  1. How many 16 bit registers are there in 8051?

  2. The size of internal RAM of 8051 Microcontroller is _______.

  3. In 8051, Pin number 30 is used:

  4. How many counter/timer does the 8051 microcontroller have?

  5. 16-bit registers consist of:

  6. The Size of internal RAM of 8051 Microcontroller is?

  7. For pulse generation, the IC used is:

  8. While designing a system using an 8051 microcontroller, the lower address byte and data are multiplexed on the same lines. Which hardware component is required to hold the lower address byte temporarily for correct memory access?

  9. In an 8051 microcontroller, during a debugging session, several PUSH instructions are executed, and the stack pointer reaches address 31H. Which memory area is now being used for stack storage?

  10. Which component in a PLC architecture is primarily responsible for executing control instructions and managing logic operations?


Important Questions from Microprocessors and Microcontrollers

  1. Cycle stealing mode of DMA operation involves

  2. The period of machine cycle of an 8051 system with crystal frequency 16 MHz is

  3. Which of the following instructions will move the contents of register 3 to the accumulator ?

  4. In 8086, which instruction at the end of a sub-routine takes the execution back to the main program?

  5. Which one of the following is not the feature of 8051?

Need Expert Advice?
Upcoming Exams
RRB NTPC
September 27, 2026
Test Series
RRB ALP img
Railways
RRB ALP 2026 Mock Test series
1035 Tests 1 Tests Free
893 Attempts
4.3(235)
English, Hindi

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App