Memory Locations and Addresses
Memory Locations and Addresses
Addresses
• The memory consists of many millions of storage cells, each of which
can store a bit of information having the value 0 or 1
• groups of fixed size
• group of n bits can be stored or retrieved in a single, basic operation.
Each group of n bits is referred to as a word of information, and n is
called the word length
• 16 to 64 bits
• A unit of 8 bits is called a byte
• Accessing the memory to store or retrieve a single item of
information, either a word or a byte, requires distinct names or
addresses for each location.
• 0 to 2k − 1, for some suitable value of k, as the addresses of
successive locations in the memory.
• Thus, the memory can have up to 2k addressable locations. The 2k
addresses constitute the address space of the computer.
• For example, a 24-bit address generates an address space of
(16,777,216) locations.
Byte Addressability
• Bits
• Definition: A bit (short for “binary digit”) is the
smallest unit of data in a computer.
• Value: It can have a value of either 0 or 1.
• Usage: Bits are used to represent binary data and are
the building blocks for all types of data in a computer.
• Bytes
• Definition: A byte is a group of 8 bits.
• Value: Since a byte consists of 8 bits, it can represent
256 different values (from 0 to 255).
• Usage: Bytes are used to measure data storage and
memory. For example, file sizes and memory capacities
are often measured in bytes, kilobytes (KB), megabytes
(MB), gigabytes (GB), etc.
• Bit: 0 or 1
• Byte: 10101010 (an example of a byte with 8 bits)
• Example
• Let’s say you have the letter ‘A’. In binary, ‘A’ is represented as 01000001.
This is a byte because it consists of 8 bits.
• Key Differences
• Size: A bit is the smallest unit, while a byte is larger and consists of 8 bits.
• Representation: Bits are used for binary data, while bytes are used for larger
data units like characters, numbers, and more complex data structures.
Big-Endian and Little-Endian
Assignments
• What is Endianness?
• Endianness refers to the order in which bytes are
arranged in memory.
• It’s like how we read text in different languages: some
read left to right (like English), and some read right to
left (like Arabic). Similarly, computers can store data in
different byte orders.
• big-endian is used when lower byte addresses are used for the more
significant bytes (the leftmost bytes) of the word.
• The name little-endian is used for the opposite ordering, where the
lower byte addresses are used for the less significant bytes (the
rightmost bytes) of the word.