Skip to content
UoL CS Notes

Home

This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.

Virtual Memory & Working Sets

COMP124 Lectures

Virtual Memory The logical address space doesn’t have to match the address space of physical memory. This allows us to allocate more memory to processes than there is physical memory in the system. This is possible by using paging: Not all pages need to be in memory. Unneeded pages can...

Read More

Paging

COMP124 Lectures

Paging is the physical division of a program’s (or segment’s) address space into equal-sized blocks, called pages. Each page resides within a page frame in the real memory. Pages which are consecutive in the address space (virtual memory) need not occupy consecutive page frames in real memory. Very similar to...

Read More

Segmentation

COMP124 Lectures

Segmentation is splitting up chunks of a process into logical parts. The compiler will indicate which segment represents which logical part of the code. Each segment has its own partition. Segments need not be contiguous. These segments are able to be organised by the memory manager to fit where space...

Read More

Dynamic Loading

COMP124 Lectures

This makes memory usage more efficient by only loading what part of a program is needed at any time. The program image could consist of the following parts: Main program Different routines, classes Error routines Dynamic loading allows only parts of the image to be loaded, as necessary. When a...

Read More

Dynamic Programming Algorithms - 1 - Fibonacci Numbers

COMP108 Lectures

Dynamic programming allows for more efficient implantation of divide and conquer algorithms. Fibonacci Numbers This is the definition for the Fibonacci numbers: \[F(n)=\begin{cases} 1 & \text{if } n=0\text{ or } 1\\ F(n-1)+F(n-2) & \text{if } n> 1 \end{cases}\] and the code that we had before: Algorithm F(n) if n ==...

Read More

Memory Fragmentation

COMP124 Lectures

Simple Memory Management Memory is allocated to program in contiguous partitions from one end of the store to the other. Each process has a base, or datum (where it starts). Each process also has a limit (length). Filling Empty Memory With this method you are unable to move existing programs...

Read More

Memory Management

COMP124 Lectures

Memory Addressing The memory inside RAM can be viewed as a linear sequence of bytes, each with its own address. Addresses range from 0 up to the number of bytes available. Since addresses are stored in register and other variables, addressable space will depend on the bit-length of the CPU....

Read More

Version Control with git

COMP122 Labs

A full textbook on git as available called: ProGit. Local Setup The bare minimum of setup is to set the user.name and user.email: $ git config --global user.name "Ben Weston" $ git config --global user.email sgbweso@liverpool.ac.uk Creating a Repository To initialise a new repository you can do the following inside...

Read More

Input & Output (I/O) - 2

COMP122 Labs

There are many I/O classes, view the full Oracle I/O tutorial here. Scanner java.util.Scanner splits up an input into tokens that can be read one at a time. You can scan through these using the has.Next() and look for specific types using other methods: double sum = 0; try (Scanner...

Read More