





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An in-depth look into various types of computer memory, including Random Access Memory (RAM), Read-Only Memory (ROM), cache memory, and virtual memory. It covers their functions, characteristics, and differences. Hexadecimal is used to represent memory addresses.
Typology: Study Guides, Projects, Research
1 / 9
This page cannot be seen from the preview
Don't miss anything!






In this lecture we explore computer memory. We begin by looking at the basics. All memory is numbered, with each byte having its own address. We take a look at the Random Access Memory (RAM) that composes most of main memory. We also consider some other items that may appear in the main memory address space, such as special access to Input/Output devices using Memory Mapped IO. Next, we explore the sections of memory that are used by a typical program. We take a closer look at the Call Stack used to store parameters and local variables when functions are called and we study the Heap which is used to store objects. As we will see, improper use of the heap may lead to Memory Leaks. Some languages avoid this by managing memory for a programmer and use Garbage Collectors to ensure no memory is leaked. Modern CPUs in addition to the registers we studied last lecture contain some additional memory – Cache memory. We take a quick look at CPUs’ L1, L2, and L3 Caches and also how some Solid State and Hard Drives use similar Memory Caches. We end by taking a look at how Read-Only Memory (ROM) can be used in the startup sequences of computers and how it provides Firmware instructions for various consumer devices. Hexadecimal Numbers Hexadecimal Numbers are often used in Computer Science to represent binary numbers.
o The first byte has the address 0x00000000, the second byte has the address 0x00000001, and so on. o The ellipsis in the middle of the block indicates that there are a lot of bytes, and after that sequence of many, many bytes, we reach a set of bytes somewhere in the middle of memory that we are interested in or where something is being stored. In this particular case, that memory location we are interested in is located at 0x030FA024. I’ve chosen to show that that memory location is followed by 0x030FA025 and 0x30FA026, although these may or may not be shown on a typical memory diagram, and they would likely not be given addresses, since the assumption would be that the viewer would understand that they followed sequentially after 0x030FA024. o Note that the addresses here consist of 8 hexadecimal digits, which correspond to 32- bits. So this computer is using an address size of 32-bits. Random Access Memory (RAM) Most of Main Memory consists of RAM, which is short for Random Access Memory.
Call Stack – When a function (or method) is called, the data associated with it is placed in the call stack. Heap – When new objects are created they go into the heap. Let’s take a closer look at these last two sections. Call Stack
o L3 is even larger, and for some chip designs, in contrast to L1 and L2, L3 may be shared between cores in a multi-core machine. o Just to give you an idea of the size of these Caches an Intel i7 Core processor (which is a high-end processor sometimes found in consumer machines) has: 64 kbytes of L1 Cache per Core 256 kbytes of L2 Cache per Core 2 Megabytes of L3 Cache per Core^2 As you can see the L1 and L2 Caches are extremely small and the L3 Cache, while larger, is still quite small compared to the total amount of main memory on the computer ( Gigabytes to 16 Gigabytes is common on a consumer laptop as of this writing). o Some computers even add an L4 Cache, which is slower than L3 and is not on the CPU chip itself, but rather on a separate chip. However, the L4 memory chip is much faster than RAM.