Understanding of word-based addressing and byte-based addressing

Source: Internet
Author: User

Let's start with a simple question!

There is a 1 MB memory with 32 characters in length. Q: By byte addressing, addressing range of the word addressing and their respective addressing range size?

If the address is encoded by byte

1 MB = 2 ^ 20b

1 byte = 1B = 8bit

2 ^ 20b/1B = 2 ^ 20

The address range is 0 ~ 2 ^ 20-1, that is, 20 IP address lines are required to complete the encoding of 1 MB space. Therefore, the address register is 20 bits and the addressing range is 2 ^ 20 = 1 m.

If the address is edited by words

1 MB =2 ^ 20B

1 word = 32bit = 4B


2 ^ 20B/4B = 2 ^ 18

The address range is 0 ~ 2 ^ 18-1, that is, we must use at least 18 address lines to complete the encoding of 1 MB space. Therefore, the addressing range by word address is 2 ^ 18.

Notes for the above questions:


1. distinguish two different concepts: addressing space and addressing range. The addressing range is only a digital range, not a unit.

The size of the addressing range is obviously a number, which refers to the size of the addressing range.

Addressing Space refers to the maximum capacity that can be addressed. The unit is generally expressed in MB and B. The addressing range in this question is 0 ~ 2 ^ 20-1, addressing space is 1 MB.

2. byte addressing refers to the smallest unit of addressing a bucket in bytes and the word-based addressing refers to the smallest unit of addressing a bucket in words. For example, the total memory capacity is certain, and the number of encodings required by word addressing and byte addressing is different. Because the address unit is large (1 word = 32bit = 4B ), therefore, the number of encodings is relatively small, while the byte encoding unit is small (1 byte = 1B = 8 bit), resulting in a large number of encodings.


3. Differences between M and MB.

M is the unit of quantity. 1024 = 1 K, 1024 K = 1 M

MB refers to the capacity. 1024B = 1KB, 1024KB = 1 MB.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.