... since using 7-bit in 8-bit address bus wastes one wire.
In 8051 there is a 8-bit address bus for internal RAM out of which we just use 7 wires making it addressable to just 128 byte locations, why not use all 8 wires to make it accessible to 256 bytes?
-
\$\begingroup\$ Well, perhaps 7 wires for address, 1 wire for control (read/write, for example, similar to I2C which has 7 bits for device addresses, 1 bit for read/write). Another use of the single bit is for enable/disable "banks" of 128 bytes. \$\endgroup\$tlfong01– tlfong012022年01月09日 10:36:23 +00:00Commented Jan 9, 2022 at 10:36
-
\$\begingroup\$ The 8051 was also a pretty early microcontroller; minimal RAM may have been a cost-cutting measure (though I have no actual evidence of this, merely a guess). \$\endgroup\$Hearth– Hearth2022年01月09日 14:49:49 +00:00Commented Jan 9, 2022 at 14:49
2 Answers 2
There are 8051 compatibles with 256 bytes of RAM.
Original 8051 had 128 bytes because it was enough and the other 128 bytes are reserved for special function registers, so one address bit defines if you want to use RAM or SFS.
The chips with 256 bytes of RAM can only directly access 128 bytes because the other half is reserved for SFRs. The second half of RAM can only be accessed indirectly.
-
\$\begingroup\$ Most often, the second half of RAM is used for the stack. \$\endgroup\$Dave Tweed– Dave Tweed2022年01月09日 12:09:57 +00:00Commented Jan 9, 2022 at 12:09
When processing MOVX instruction, or a MOVC instruction with an address over 0FFFh, the 8051 outputs an address which an outside memory chip can process as it sees fit, allowing direct access of up to 64K of data and 60K of externally-stored code if a sufficient amount of external memory is connected. When processing any instruction other than MOVC or MOVX that uses memory, however, the part needs to be able to satisfy the request with memory that can be accessed without using the external bus, which in turn means that it needs to use memory on the same silicon chip as the rest of the CPU and I/O circuitry. Making the RAM only use 128 of the 256 possible addresses also means that it only occupies half as much space on the chip as it would if it were larger.