0
\$\begingroup\$

In 8051, there are 128 bytes of RAM. Of which, 32 are set aside for registers in the form of banks, 8 registers to each bank. Each bank is addressed from say 00 to 07, 08 to 0F, etc, that is, occupying 8 bits each, with each but corresponding to a register, thus 8 registers in each bank.

How can this be possible, when the registers themselves occupy 8 bits? Won't each bank occupy 8*8 = 64 bits instead of 8?

\$\endgroup\$
4
\$\begingroup\$

Each address holds 8 bits. 32 addresses are set aside as registers, 8 bits each. Each register bank has 8 registers in it. Each register bank is 64 bits/8 bytes. 96 addresses are as RAM. 96+32 = 128 Bytes total. It's just that the first 32 bytes are registers rather than RAM. I think you may be getting bits mixed up with bytes.

\$\endgroup\$
  • \$\begingroup\$ Oh ho, each register occupies 1 byte, so 8 registers mean 8 bytes, or 1 bank. That's dumb of me..Thanks! \$\endgroup\$ – SexyBeast Sep 11 '13 at 23:08
  • \$\begingroup\$ Out of curiosity, do you know if any 8051-architecture chips actually implement the first 32 bytes as registers different from the remaining 96/224, or does "ADD Rn" simply do a normal RAM read from address "000bbnnn"? \$\endgroup\$ – supercat Sep 12 '13 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.