Chapter 2
Memory, Software and Operating Systems
Every time you press a key, open a file or switch on a computer, a quiet chain of events begins: instructions travel from storage to memory, the operating system hands out the processor's time, and a program written in a human-friendly language is translated into the 0s and 1s the machine understands.
Every time you press a key, open a file or switch on a computer, a quiet chain of events begins: instructions travel from storage to memory, the operating system hands out the processor's time, and a program written in a human-friendly language is translated into the 0s and 1s the machine understands. This chapter follows that chain. We start with memory, from the tiny registers inside the CPU to the large disk, then count it in bits and bytes. Next come the software that runs on it, the languages and translators that create it, and the operating system that manages it all. We end with the Windows desktop you use every day, the shortcuts that save your time and the file extensions that tell a computer what a file is. Each of these has been asked again and again in the papers.
Type 1
Memory Hierarchy: Registers, Cache, RAM and ROM
A computer is not one big store of data. It has several kinds of memory, arranged like a staircase, and the CPU talks to the top step first. The closer a memory is to the CPU, the faster, smaller and costlier per bit it is. The farther it is, the slower, bigger and cheaper. This staircase is called the memory hierarchy, and nearly every question in this chapter is a question about where something sits on it.
Going down the hierarchy from registers to secondary storage: access speed falls, cost per bit falls and capacity rises. Going up: speed rises, cost per bit rises and capacity falls. Primary memory (registers, cache, RAM, ROM) is directly reachable by the CPU. Secondary memory is not.
RAM (Random Access Memory) is the computer's working desk. The operating system, the open programs and the files you are editing are all loaded into it. It is volatile: when the power goes off, everything in it disappears. 'Random access' means any location can be reached in the same time, whichever it is. RAM comes in two kinds, SRAM and DRAM.
SDRAM is synchronised with the system clock. DDR SDRAM (Double Data Rate) transfers data on both the rising and the falling edge of the clock, so it moves twice as much data per clock cycle; the generations are DDR, DDR2, DDR3, DDR4 and DDR5. Virtual memory is a trick of the operating system: it uses a part of the hard disk or SSD as if it were extra RAM, so that programs larger than the physical RAM can still run, though more slowly.
ROM (Read Only Memory) is non-volatile: it keeps its contents without power. It stores the firmware needed to start the computer, such as the BIOS or boot program. The first ROMs were fixed at the factory; the later types can be written or erased in different ways.
- What is the main function of RAM in a computer?
- Which of the following memories is volatile, i.e. its contents are lost when the computer is turned off?
- Which of the following describes the correct difference between RAM and ROM?
- What is the primary purpose of virtual memory in a computer system?
- What is the main purpose of cache memory in a computer?
Type 2
Secondary Storage and Units of Memory
RAM forgets everything when the power goes off, so a computer needs a place to keep files for good. That place is secondary storage (also called auxiliary or backing storage). It is non-volatile, much larger and cheaper per bit than RAM, but slower, and the CPU cannot use it directly: data must first be copied into RAM. Secondary storage is of three families, according to how the data is stored.
A hard disk drive (HDD) has spinning metal platters and a moving read/write head, and is the usual bulk store in older desktops. An SSD (solid-state drive) keeps data in flash chips: it has no moving parts, so it is faster, silent and more shock-proof, but costlier per gigabyte. A pen drive (USB flash drive) and a memory card also use flash. Magnetic tape is read in order from start to end (sequential access) and is used for cheap, long-term backup; disks and flash allow direct (random) access to any spot.
On optical discs, the shorter the laser wavelength, the smaller the pits it can read, so the more data fits: infrared CD (780 nm) < red DVD (650 nm) < blue-violet Blu-ray (405 nm). Suffixes: ROM = read only, R = recordable once, RW = rewritable.
Computers store everything as binary digits. The smallest unit is the bit (0 or 1). Four bits make a nibble, and eight bits make a byte, which is enough for one character. Larger units go up in steps of 1024 (that is, 2 to the power 10).
A memory cell stores one bit. A register of n bits can hold 2 to the power n different values, so a 1-bit register holds 2 values, an 8-bit register holds 256, and a 32-bit register holds 4,294,967,296 (2 to the power 32). The word size of a computer (for example 32 or 64 bits) is the number of bits the CPU handles in one step.
Type 3
Software: System, Application and Utility
Hardware is the part of a computer you can touch. Software is the set of instructions that tells the hardware what to do. A single set of instructions written to do one job is a program; a collection of programs and related data is software. Without software even the best hardware does nothing. Software is divided into two big classes: system software and application software.
A quick test: if the program is needed to run or look after the computer, it is system software (operating system, driver, utility, translator). If a user opens it to get a task done, it is application software. So Windows Vista is system software, but Photoshop, Chrome and WhatsApp are applications. And Microsoft Office is application software, not system software.
Parts of system software. The operating system controls all the resources (covered in a later topic). Device drivers are small programs that let the operating system talk to a particular device such as a printer or graphics card. Firmware is software stored permanently in ROM or flash on a device, like the BIOS of a computer or the program inside a router. Utility software helps maintain the computer. Language translators (compiler, interpreter, assembler) turn programs written by people into machine code.
Application software is of two kinds. General-purpose (packaged) software is made for many users and sold off the shelf: Microsoft Word, Excel, PowerPoint, Chrome, Photoshop, Tally. Specific-purpose (custom or bespoke) software is made for one organisation or job: a railway reservation system, a bank's core system, a payroll package. A web designer uses tools such as Dreamweaver to build websites; Notepad is a plain text editor that saves .txt files.
Software is also classed by licence. Proprietary software is owned by a company and can be used only on its terms. Open-source software publishes its source code, which anyone may study, change and share (Linux, Android, Mozilla Firefox, LibreOffice). Freeware is free to use but the source code is not open. Shareware is given free for a trial period, then payment is expected. Public-domain software has no owner and can be used by anyone.
Type 4
Programming Languages and Translators
A computer's CPU understands only one language, machine language: long strings of 0s and 1s. People find that unbearable to write, so over the years programmers invented languages that look more and more like human speech, and programs called translators that convert them back into 0s and 1s. The ladder runs from low-level languages (close to the machine) to high-level languages (close to the person).
A translator converts a program (source code) into machine code (object code). There are three kinds. An assembler translates assembly language into machine code. A compiler translates the whole high-level program at once, lists all the errors afterwards, and produces a separate executable file that then runs fast. An interpreter translates and runs the program one line at a time, stopping at the first error, and produces no separate file.
Java is a bit of both: the Java compiler turns source code into bytecode, and the Java Virtual Machine (JVM) then runs that bytecode on any computer. That is the idea behind 'write once, run anywhere'.
Errors in programs are of three kinds. A syntax error breaks the grammar rules of the language and is caught when translating. A runtime error appears while the program is running, like dividing by zero. A logical error lets the program run but gives wrong results. Finding and fixing errors is called debugging. Before coding, a programmer plans the steps with an algorithm or a flowchart.
Type 5
Operating System: Functions, Types and Examples
The operating system (OS) is the first program to load when a computer starts and the last to stop when it shuts down. It sits between the user and programs on one side and the hardware on the other. Without it, every program would have to know how to drive the screen, disk and keyboard by itself. In short, the operating system manages the hardware and software resources and gives the user a way to use the computer.
The kernel is the core of the operating system. It runs all the time in memory and acts as the main interface between applications and the hardware: it schedules the CPU, manages memory and controls devices. The shell is the outer layer the user touches. It can be a command-line interface (CLI), where commands are typed, or a graphical user interface (GUI), where windows, icons and menus are used with a mouse.
Where several processes use the same files, the operating system uses file-locking mechanisms so that two programs cannot corrupt a file by changing it at the same instant. Related ideas: a deadlock is when processes wait for each other for ever; paging cuts memory into fixed pages; scheduling decides who gets the CPU next.
Windows is a family of GUI operating systems from Microsoft (founded 1975 by Bill Gates and Paul Allen). It is proprietary. Landmark versions: Windows 95 (1995), XP (2001), Vista (2007), 7 (2009), 8 (2012), 10 (2015) and 11 (2021). Before Windows, Microsoft's command-line system was MS-DOS (1981). macOS is Apple's desktop system and iOS is Apple's phone system.
Linux is an open-source operating system built on the Linux kernel, first released in 1991 by Linus Torvalds; its mascot is the penguin Tux. Because it is free and open, many versions called distributions exist: Ubuntu, Fedora, Debian, Red Hat, and Kali Linux, which comes with ready-made penetration-testing tools and is used for ethical hacking. India's own BOSS is a Linux-based system from C-DAC. Android is built on the Linux kernel and developed by Google.
Type 6
Windows Basics: Desktop, Files and Folders
When Windows has finished starting, the first thing you see is the desktop. Its picture is the wallpaper (desktop background). On it sit icons: small pictures that stand for programs, files and folders. Along the bottom runs the taskbar, with the Start button at one end and the notification area (system tray, with clock, volume and network icons) at the other.
The Start menu, Control Panel or Settings app, File Explorer and Task Manager are four different tools. Start opens things, Settings or Control Panel changes how the computer is set up (for example, the date and time, or Settings, Personalization for the wallpaper), File Explorer manages files and Task Manager manages running programs.
A file is a named collection of data stored on a disk. A folder (directory) is a container that holds files and other folders. To make a new folder, right-click an empty spot, choose New, then Folder; Windows names it New folder, and you can type a new name at once. To rename an existing file or folder, select it and press F2, or right-click and choose Rename.
Selecting. Ctrl + click selects several separate items; Shift + click selects a continuous range; Ctrl + A selects everything. A file name cannot contain any of these characters: \ / : * ? " < > |. Files are shown in File Explorer and can be sorted by clicking a column heading (such as Name) or grouped by Type with Group by. Hidden files appear when you open the View tab and tick Hidden items.
Deleting. Pressing Delete on a file in the hard disk sends it to the Recycle Bin, from where it can be restored. Shift + Delete removes it permanently without the Recycle Bin. Files deleted from a pen drive or other removable drive (and network drives) usually do not go to the Recycle Bin either; they are gone at once. For example, Radhika deletes a photo from her pen drive and then finds the Recycle Bin empty: that is expected behaviour.
Type 7
Keyboard Shortcuts and File Extensions
A keyboard shortcut is a key combination that does in one stroke what a menu would do in three clicks. Most use the Ctrl key, the Alt key, the Shift key or the Windows key together with a letter. The same few shortcuts work in nearly every program, and exams ask them again and again. Learn them as families, not as a long list.
A file extension is the short suffix after the dot in a file name. It tells Windows which program should open the file. Changing the extension by renaming does not convert the file; it only confuses the system, which is why Windows warns you first. Learn extensions by category.
An image is not a video. JPEG (.jpg or .jpeg), PNG, GIF and BMP are all picture formats, so if the question asks for the extension that is not a video file, the answer is the picture format .jpeg. PNG is an image file, not a video, audio or batch file.