Class 11Computer Science · Computer SystemsFull chapter

Computer System

The whole chapter in one place — read it, then test yourself. Clear notes, a reference sheet, a practice quiz, and worked NCERT solutions & PYQs.

What a Computer System Is

Quick answer A computer system is hardware plus software running the Input-Process-Output cycle through five functional units — input, memory, control unit, ALU and output — where the control unit and ALU together form the CPU.

A computer system is an electronic machine that accepts raw data, processes it using a stored set of instructions, and gives out information. Keep those two words apart in the exam. Data is raw and by itself meaningless — 245. Information is processed data that answers something — "your electricity bill is Rs 1465".

Every job a computer does, from adding two numbers to booking a Tatkal ticket on IRCTC, follows the same three-stage IPO cycle: Input, then Process, then Output. A fourth stage, Storage, sits alongside so results survive after the machine is switched off. When you pay by UPI, the touchscreen takes the input (amount and PIN), the processor and the bank's servers do the processing, the "Payment Successful" screen is the output, and the entry in your passbook is the storage.

Hardware is every part you can touch — the keyboard, the motherboard, the RAM stick, the printer. Software is the set of instructions that tells the hardware what to do; you cannot touch it, you can only copy it. Neither is useful alone. Hardware without software is a dead box of metal; software without hardware is a file that nobody can run.

PointHardwareSoftware
NaturePhysical, tangibleLogical, a set of instructions
Made byManufacturingProgramming
FailureWears out, can break physicallyDoes not wear out, but can have bugs or get corrupted
RepairReplace or repair the partReinstall or update
ExamplesMonitor, mouse, hard disk, CPU chipWindows, Python, Chrome, a printer driver

The five functional units. Whatever the size of the machine — a supercomputer at C-DAC or the chip inside a washing machine — the same five blocks are present.

   +-------------+       +--------------------------+       +--------------+
   | INPUT UNIT  | ----- |   CPU                    | ----- | OUTPUT UNIT  |
   | keyboard,   |       |  +--------+  +--------+  |       | monitor,     |
   | mouse,      |       |  |   CU   |  |  ALU   |  |       | printer,     |
   | scanner     |       |  +--------+  +--------+  |       | speaker      |
   +-------------+       |  +------------------+    |       +--------------+
                         |  |    REGISTERS     |    |
                         |  +------------------+    |
                         +--------------------------+
                                     |
                         +---------------------------+
                         |  MEMORY UNIT              |
                         |  primary (cache/RAM/ROM)  |
                         |  secondary (HDD/SSD/pen)  |
                         +---------------------------+
  1. Input unit — accepts data from outside and converts it into the binary form the machine understands.
  2. Memory unit — holds the data and the instructions while work is going on.
  3. Control Unit (CU) — the manager. It fetches each instruction, decodes it, and sends control signals telling the other units what to do. It does no calculation itself.
  4. Arithmetic Logic Unit (ALU) — does the actual work: arithmetic (+ - * / // %) and logic (comparisons, and, or, not).
  5. Output unit — converts the binary result back into a form a human can use.

The CPU (Central Processing Unit), also called the processor or the microprocessor, is the CU and the ALU together, plus a small set of registers. Registers are the CPU's own tiny, extremely fast storage — the accumulator, the program counter (which holds the address of the next instruction), the instruction register and the memory address register. They hold one value at a time, and they are the fastest storage in the whole machine because they sit inside the processor itself.

The CPU repeats one loop, the machine cycle: Fetch the next instruction from memory, Decode it, Execute it, Store the result. Everything inside the CPU is kept in step by a clock, and clock speed is simply how many clock pulses, or cycles, that clock produces per second. A 3.2 GHz processor produces 3.2 billion clock cycles a second. Be careful not to read that as 3.2 billion instructions a second — one machine cycle normally takes several clock cycles, so the two numbers are not the same. Note the other trap too: for clock speed, giga means 1,000,000,000 exactly, but for memory, giga means 1024 x 1024 x 1024. The two "giga"s are not the same number.

All these units are mounted on or plugged into the motherboard and talk to each other over the system bus, which has three parts: the address bus (which memory location), the data bus (what value) and the control bus (read or write).

The single idea that makes a computer general-purpose is the stored program concept: instructions and data both live in the same main memory. That is why one laptop can be a music player at 9 pm and a Python IDE at 10 pm — you change the instructions in memory, not the hardware.

Worked example 1 — the IPO cycle in code. This program is nothing but Input, Process, Output.

# INPUT: the keyboard (an input device) sends the digits to the CPU
units = int(input("Units consumed: "))
print("Value now in main memory:", units)

# PROCESS: the ALU inside the CPU does the arithmetic
if units <= 100:
    bill = units * 4.5
else:
    bill = 100 * 4.5 + (units - 100) * 7.0

# OUTPUT: the monitor (an output device) shows the answer
print("Electricity bill = Rs", bill)

Output when the value 245 is supplied to the program:

Units consumed: Value now in main memory: 245
Electricity bill = Rs 1465.0

The first line looks squashed for a good reason. The prompt "Units consumed: " is printed without moving to a new line, and here the 245 was fed straight in rather than typed, so nothing was echoed after the prompt and the next print() continued on the very same line. When you run it and type 245 yourself, the digits you type appear after the prompt and the rest follows below. Notice also that input() handed over the characters 2, 4, 5 as a string — int() had to convert them into a number before the ALU could multiply anything.

Worked example 2 — what the ALU actually does. The "A" and the "L" of ALU, in one program.

a = 17
b = 5
# Arithmetic work - the "A" of ALU
print(a + b, a - b, a * b, a // b, a % b)
# Logic work - the "L" of ALU
print(a > b, a == b, a > b and b > 0, not (a < b))

Output:

22 12 85 3 2
True False True True

Every high-level thing your computer does — playing a video, checking an Aadhaar OTP, rendering this page — is finally broken down into millions of these two kinds of operation.

IPO cycle Input -> Process -> Output (+ Storage) The one model that fits every computer task, from a calculator to an IRCTC booking.
CPU CPU = Control Unit + ALU + Registers Most-asked one-liner. CU decodes and directs, ALU calculates and compares, registers are the CPU's own scratchpad.
Machine cycle Fetch -> Decode -> Execute -> Store One instruction per pass. Also written as the fetch-decode-execute cycle.
Clock speed 1 GHz = 1,000,000,000 clock cycles per second GHz · Here giga means 10^9, NOT 2^30. Memory units use 1024; clock speed does not. Clock cycles are not the same as instructions.
System bus Address bus + Data bus + Control bus Address = where, data = what, control = read or write.
Stored program concept instructions + data both held in main memory The reason a single machine can run VLC now and Python next.
Remember
  • Data is raw; information is processed data. Every computer task is the IPO cycle: Input, Process, Output, with Storage alongside.
  • Hardware is the tangible parts, software is the instructions. Each is useless without the other.
  • The five functional units are input, memory, control unit, ALU and output; CPU = Control Unit + ALU + registers.
  • The CU directs and decodes but never calculates; the ALU calculates and compares but never decides what comes next.
  • Clock speed counts clock cycles per second, not instructions per second — one machine cycle takes several clock cycles.
  • The stored program concept — instructions and data sharing main memory — is what makes one machine general-purpose.

Input and Output Devices

Quick answer Input devices convert human data into binary for the CPU and output devices convert binary results back into a human-readable form, with soft copy on screen and hard copy on paper.

The CPU understands only numbers in binary. So the real job of an input device is translation: it takes something from the human world — a key press, a fingerprint, a spoken word, a printed barcode — and converts it into a pattern of 0s and 1s. An output device does the reverse translation, turning a binary result back into something a person can read, see or hear.

Common input devices

DeviceWhat it sends to the CPUWhere you meet it
KeyboardA code number for each key pressedTyping a program, filling an online form
Mouse / trackpadMovement in x and y, plus click signalsA pointing device for a GUI
ScannerThe colour value of every pixel of a pageScanning marksheets for a college application
MicrophoneSound converted into numbers many thousands of times a secondVoice search, Google Assistant in Hindi
Webcam / digital cameraA grid of pixel values per frameOnline class, scanning a UPI QR code
Biometric scannerA digital pattern of the fingerprint or irisAadhaar enrolment and eKYC, school attendance
Barcode / QR readerThe number encoded in the bar patternBilling counter, ration shop, product packs
OMR readerWhich bubble is filled on each rowObjective-type answer sheets
MICR readerThe magnetic characters at the bottom of a chequeBank cheque clearing
Joystick, light pen, graphics tablet, sensorsPosition, pressure or physical readingsGames, design, embedded systems

Common output devices. Output comes in two forms. A soft copy is temporary and electronic — it lives on a screen or in a speaker and disappears when you close the window. A hard copy is permanent and physical — printed on paper.

DeviceOutput typeNote
Monitor (LCD/LED)Soft copyThe most common output device; also called VDU
Printer (inkjet, laser, dot matrix)Hard copyLaser for speed and quality, dot matrix for multi-copy bills and railway forms
PlotterHard copyLarge accurate line drawings — maps, building plans
Speaker / headphoneSoft copyConverts digital audio back into sound
ProjectorSoft copyScreen output thrown onto a wall in a smart classroom

Some devices do both jobs and are called I/O devices: a touchscreen (it displays and it accepts taps), a modem, a network interface card, and a headset with a microphone. In an exam, if a device both accepts and delivers data, say "input as well as output device" and give the reason.

Devices plug into the computer through ports — USB, HDMI, audio jack, Ethernet — and each device needs its matching device driver in software, which you will meet in the software section.

Worked example 1 — a keyboard does not send letters, it sends numbers. The built-in function ord() shows the code number stored for a character, chr() converts a number back into a character, and bin() shows that number in binary.

name = "Anjali"
for ch in name:
    print(ch, "->", ord(ch), "->", bin(ord(ch)))

print()
print("Rebuilt from numbers:", chr(65) + chr(110) + chr(106))
print("Rupee sign code:", ord("₹"))

Output:

A -> 65 -> 0b1000001
n -> 110 -> 0b1101110
j -> 106 -> 0b1101010
a -> 97 -> 0b1100001
l -> 108 -> 0b1101100
i -> 105 -> 0b1101001

Rebuilt from numbers: Anj
Rupee sign code: 8377

Read that carefully. The letter A is not stored as a shape; it is stored as the number 65, which in memory is the bit pattern 1000001. Capital A is 65 and small a is 97 — they are different numbers, which is exactly why the machine treats them as different characters. The rupee sign is 8377, a number far too big for the old 8-bit codes, which is why modern systems use Unicode.

Worked example 2 — controlling what goes to the output device. print() is how a Python program sends characters to the standard output device. Its sep argument decides what is placed between the values and end decides what is placed after the last one.

print("Ravi", "Meena", "Sunil")
print("Ravi", "Meena", "Sunil", sep=", ")
print("Loading", end="")
print(".", end="")
print(".", end="")
print(".")
print("Roll", "Marks", sep="\t")
print(11, 87, sep="\t")

Output:

Ravi Meena Sunil
Ravi, Meena, Sunil
Loading...
Roll	Marks
11	87

The default sep is a single space and the default end is a newline, which is why the first line has gaps and each ordinary print() moves to a fresh line. Setting end="" keeps the cursor on the same line — that is how the three dots of "Loading..." came from three separate statements.

input() variable = input(prompt) Always returns a str, even if you type 245. Wrap in int() or float() before doing arithmetic.
print() print(v1, v2, sep=" ", end="\n") sep is placed between values, end after the last one. end="" keeps the cursor on the same line.
ord() ord(single_character) -> int The code number the machine actually stores. ord('A') is 65, ord('a') is 97.
chr() chr(code_number) -> str The exact reverse of ord(). chr(65) is 'A'. Forgetting chr() is a classic output-prediction trap.
bin() bin(integer) -> str Binary form as a string beginning with '0b'. The '0b' is a marker, not part of the number.
Soft vs hard copy monitor, speaker, projector = soft copy; printer, plotter = hard copy Hard copy is on paper and permanent; soft copy vanishes when the screen is closed.
Remember
  • An input device's real job is converting human data into binary; an output device does the reverse conversion.
  • ord() gives the code number stored for a character and chr() converts a number back — proof that the machine stores numbers, not shapes.
  • Soft copy is temporary and on screen or through speakers; hard copy is permanent and on paper (printer, plotter).
  • Touchscreen, modem, NIC and headset are I/O devices because they both accept and deliver data.
  • In print(), sep goes between the values and end goes after the last value; the defaults are a space and a newline.

Memory and Units of Memory

Quick answer Memory is a hierarchy — registers, cache, primary (RAM and ROM) and secondary storage — trading speed against size and cost, measured in units where each step up multiplies by exactly 1024.

Memory is where the computer keeps data and instructions. It is not one thing but a hierarchy. As you move towards the CPU the memory gets faster, smaller and costlier per byte; as you move away it gets slower, bigger and cheaper. The design exists because fast memory is expensive, so you can only afford a little of it.

LevelWhere it sitsSpeedTypical sizeCost per byteVolatile?
RegistersInside the CPUFastestA few bytes eachHighestYes
Cache (L1, L2, L3)On or very near the CPU chipVery fastKB to a few MBVery highYes
Primary memory (RAM)Slots on the motherboardFastGBModerateYes
Secondary storageSeparate drive, connected by cable or portSlowGB to TBLowestNo

Primary memory is the memory the CPU can reach directly. It has two parts.

  • RAM (Random Access Memory) — the working memory. Every program you open is copied from the hard disk into RAM before it can run. RAM is volatile: cut the power and everything in it is gone, which is why unsaved work is lost when the light goes. "Random access" means any location can be reached in the same time, unlike a tape you must wind through. Two types: SRAM (static, faster, costlier, used for cache) and DRAM (dynamic, needs constant refreshing, cheaper, used as main memory).
  • ROM (Read Only Memory) — non-volatile memory written by the manufacturer, holding the start-up instructions the machine needs the moment it is switched on. Without ROM the computer could not even begin booting, because RAM is empty at power-on. Variants: PROM (programmable once), EPROM (erasable with ultraviolet light) and EEPROM (erasable electrically).

Cache memory is a small block of very fast memory placed between the CPU and RAM. It exists because of a speed gap: the CPU can work far faster than RAM can hand over data, so without cache the processor would spend most of its time waiting. The cache holds the instructions and data the CPU has used recently or is likely to use next — programs tend to reuse the same few things again and again, and cache exploits that. If the CPU finds what it wants in cache that is a cache hit; if not it is a cache miss and the slower trip to RAM happens. Do not confuse cache with RAM: cache is smaller, faster and costlier per byte, and you never buy it separately.

Secondary memory is permanent storage. The CPU cannot execute anything directly from here — the data must first be copied into RAM. It is non-volatile, cheap per byte and removable in many forms.

  • Hard disk drive (HDD) — magnetic platters that spin under a read/write head. Large and cheap, but has moving parts.
  • Solid state drive (SSD) — flash memory, no moving parts, much faster than an HDD, costlier per GB.
  • Pen drive and memory card — flash memory in a small removable package.
  • Optical discs — CD (nominally 700 MB), DVD (nominally 4.7 GB for a single layer), Blu-ray. Read by a laser.
  • Cloud storage — space on somebody else's server, reached over the internet. Convenient, but it is not on your machine and it needs a connection.

Units of memory. The smallest unit is the bit (binary digit), which is a single 0 or 1. Four bits make a nibble. Eight bits make a byte, and one byte is the space needed for one ordinary character. Above that, every step multiplies by 1024, not by 1000, because computers count in powers of two and 210 = 1024. Write it exactly like this in the exam.

UnitIn terms of the previous unitAs a power of 2In bytes
1 bita single 0 or 1——
1 nibble4 bits—half a byte
1 byte (B)8 bits201
1 kilobyte (KB)1024 bytes2101,024
1 megabyte (MB)1024 KB2201,048,576
1 gigabyte (GB)1024 MB2301,073,741,824
1 terabyte (TB)1024 GB2401,099,511,627,776
1 petabyte (PB)1024 TB2501,125,899,906,842,624

Worked example 1 — the conversions, done by the machine itself.

KB = 1024
MB = 1024 * KB
GB = 1024 * MB
TB = 1024 * GB

print("1 KB =", KB, "bytes")
print("1 MB =", MB, "bytes")
print("1 GB =", GB, "bytes")
print("1 TB =", TB, "bytes")
print("1 GB in bits =", GB * 8, "bits")
print()

# How many 5 MB songs fit on a 16 GB pen drive?
drive = 16 * GB
song = 5 * MB
print("Songs that fit:", drive // song)
print("Bytes left over:", drive % song)

Output:

1 KB = 1024 bytes
1 MB = 1048576 bytes
1 GB = 1073741824 bytes
1 TB = 1099511627776 bytes
1 GB in bits = 8589934592 bits

Songs that fit: 3276
Bytes left over: 4194304

Note the two operators doing the real work. // gives the whole number of songs that fit and % gives the unused bytes left over — exactly the pair you need for "how many files fit" numericals.

Worked example 2 — why a photo takes the space it does. An image is a grid of pixels, and a 24-bit colour pixel needs 3 bytes (8 bits each for red, green and blue).

width = 1920
height = 1080
bytes_per_pixel = 3          # 24-bit colour: 8 bits each for R, G and B

total_bytes = width * height * bytes_per_pixel
print("Raw size in bytes:", total_bytes)
print("Raw size in KB   :", total_bytes / 1024)
print("Raw size in MB   :", total_bytes / (1024 * 1024))
print("Rounded to 2 dp  :", round(total_bytes / (1024 * 1024), 2), "MB")

disk = 2 * 1024 * 1024 * 1024 * 1024   # a 2 TB hard disk
print("Such photos on a 2 TB disk:", disk // total_bytes)

Output:

Raw size in bytes: 6220800
Raw size in KB   : 6075.0
Raw size in MB   : 5.9326171875
Rounded to 2 dp  : 5.93 MB
Such photos on a 2 TB disk: 353495

Worked example 3 — why your 1 TB hard disk shows 931 GB. This is the 1024-versus-1000 rule biting in real life. Disk manufacturers count 1 KB as 1000 bytes; the operating system counts it as 1024.

# What a hard-disk box says vs what Windows shows
box_bytes = 1000 * 1000 * 1000 * 1000     # maker counts 1 KB = 1000 bytes
GB = 1024 * 1024 * 1024                   # the OS counts 1 KB = 1024 bytes
print("Box says      : 1 TB")
print("Actual bytes  :", box_bytes)
print("OS shows      :", round(box_bytes / GB, 2), "GB")

Output:

Box says      : 1 TB
Actual bytes  : 1000000000000
OS shows      : 931.32 GB

Nobody has cheated you of the missing 68.68 GB — the two sides are simply using two different meanings of "tera". For the CBSE exam, always use 1024.

bit and byte 1 byte = 8 bits ; 1 nibble = 4 bits bit, B · A bit is a single 0 or 1. One byte stores one ordinary character.
Kilobyte 1 KB = 1024 bytes = 2^10 bytes KB · 1024, never 1000. This is the step that every later unit is built on.
Megabyte 1 MB = 1024 KB = 2^20 bytes = 1,048,576 bytes MB · Multiply by 1024 to go down a unit, divide by 1024 to go up.
Gigabyte 1 GB = 1024 MB = 2^30 bytes = 1,073,741,824 bytes GB · Learn this figure by heart; it appears in almost every conversion numerical.
Terabyte and petabyte 1 TB = 1024 GB = 2^40 bytes ; 1 PB = 1024 TB = 2^50 bytes TB, PB · Order from small to large: bit, byte, KB, MB, GB, TB, PB.
Uncompressed image size size = width * height * bytes per pixel bytes · 24-bit colour means 3 bytes per pixel. Divide by 1024*1024 to get MB.
Remember
  • Memory hierarchy: registers, cache, RAM, secondary storage — speed and cost per byte fall together as size rises.
  • RAM is volatile working memory; ROM is non-volatile and holds the start-up instructions, which is why booting is possible at all.
  • Cache sits between CPU and RAM to close the speed gap, holding recently and frequently used data; it is smaller and costlier per byte than RAM.
  • The CPU cannot execute anything directly from secondary storage — data must be copied into RAM first.
  • 1 byte = 8 bits and every unit above it multiplies by 1024, so 1 GB = 2^30 = 1,073,741,824 bytes exactly.

Types of Software and Language Translators

Quick answer Software splits into system software (OS, utilities, device drivers), programming tools including the assembler, compiler and interpreter, and application software — with Python belonging firmly to the interpreted side.

Software is grouped into three categories. Getting an item into the right box is a standard one-mark question.

CategoryPurposeExamples
System softwareRuns and manages the computer itselfWindows, Linux, antivirus, printer driver
Programming tools and language translatorsHelps people write and translate programsAssembler, compiler, interpreter, editor, debugger, IDE
Application softwareDoes a job for the userMS Word, Chrome, Tally, a school ERP

1. System software. It has three kinds.

  • Operating system — the master control program, covered in the next section.
  • System utilities — small programs that keep the machine healthy: antivirus, disk defragmenter, disk cleanup, file compression tools (7-Zip, WinZip), backup and restore tools, disk checkers. They maintain the computer; they do not do the user's own work.
  • Device drivers — a small program that acts as a translator between the OS and one particular piece of hardware. Every printer model, graphics card and scanner speaks its own language, and the OS cannot be built knowing all of them. The driver bridges that gap, which is why a printer that worked yesterday can stop working after a fresh Windows install: the driver is missing. "Plug and play" simply means the OS already carries or automatically fetches the driver.

2. Programming tools and language translators. To understand why translators exist, look at the three levels of language.

LevelLooks likeNeeds
Machine languageOnly 0s and 1sNothing — this is the only language the CPU understands
Assembly languageShort mnemonics: MOV, ADD, SUBAn assembler
High-level languageNear-English: Python, C++, JavaA compiler or an interpreter

A tiny assembly-language fragment looks like this (this is not Python and will not run in Python):

MOV AL, 5      ; put 5 into register AL
ADD AL, 3      ; add 3 to it

The program you write is called source code; what the translator produces is object code or machine code.

  • Assembler — translates assembly language into machine code. The translation is essentially one statement to one machine instruction.
  • Compiler — reads the entire high-level source program, translates it in one go, and writes out a separate executable file. All errors found during translation are reported together. Once the executable exists, it runs on its own and the compiler is no longer needed. C and C++ use compilers.
  • Interpreter — translates and executes one statement at a time. No separate executable is produced, so the interpreter must be present every time the program runs. It stops at the first statement that fails. Python uses an interpreter.

Compiler versus interpreter — learn this table. It is asked almost every year.

BasisCompilerInterpreter
Unit of translationThe whole program at onceOne statement at a time
Output producedA separate object/executable fileNo separate file; it executes directly
Error reportingLists all errors found after scanning the whole programReports the first error reached and stops there
Speed of executionFaster — machine code is ready in advanceSlower — translation happens on every run
Memory requiredMore, because object code is storedLess, no object code is kept
Needed while running?No, the executable runs by itselfYes, it must be installed on the machine
Debugging for a beginnerHarder — errors come as a long listEasier — you are pointed at one line
ExamplesC, C++, Java (to bytecode)Python, BASIC

3. Application software. Software written to do a job for the user, not for the machine.

  • General purpose / packages — usable by anyone: word processor, spreadsheet, presentation tool, web browser, media player, image editor.
  • Customised or tailor-made — built for one organisation or one task: Tally for accounting, a school ERP, a railway reservation system, a hospital billing system, a bank's core banking software.

Worked example — proving that Python is interpreted. Run this file, which has a mistake on line 3.

print("Line 1 ran")
print("Line 2 ran")
print(10 / 0)          # run-time error is HERE
print("Line 4 never runs")

Output:

Line 1 ran
Line 2 ran
Traceback (most recent call last):
  File "C:\pytmp\demo1.py", line 3, in 
    print(10 / 0)          # run-time error is HERE
          ~~~^~~
ZeroDivisionError: division by zero

This is the interpreter's signature behaviour. Lines 1 and 2 were translated, executed and printed before Python ever looked at line 3. A compiled language would have refused to produce an executable at all, so nothing would have been printed. Line 4 is never reached.

The sharp detail most students miss. It is not true that Python checks nothing in advance. Before execution begins, CPython reads the whole file and checks its grammar. So a syntax error anywhere kills the program before a single line runs. Same file, but with a missing bracket on line 3:

print("Line 1 ran")
print("Line 2 ran")
print("oops"
print("Line 4")

Output:

  File "C:\pytmp\demo2.py", line 3
    print("oops"
         ^
SyntaxError: '(' was never closed

Notice that "Line 1 ran" did not appear this time. Hold both facts together: a syntax error stops the whole file before anything runs, while a run-time error stops the program only at the line where it happens, after the earlier lines have already done their work.

Assembler assembly language -> machine code Roughly one assembly statement per machine instruction. Not a compiler.
Compiler whole source program -> one object/executable file Translates once, then the executable runs without the compiler. All errors reported together.
Interpreter statement -> translate -> execute -> next statement No separate file produced; must be installed to run the program. Stops at the first error reached.
Source vs object code source code (.py, .c, .cpp) -> object code (.obj, .exe) Only a compiler or assembler produces a separate object-code file; an interpreter does not.
Python's model python program.py Whole file checked for syntax first, then executed statement by statement. Syntax error = nothing runs; run-time error = earlier lines already ran.
Software categories System software | Programming tools | Application software Antivirus and drivers are system software, not application software. Tally and a school ERP are customised application software.
Remember
  • Three categories: system software (OS, utilities, device drivers), programming tools and translators, and application software.
  • A device driver translates between the OS and one specific hardware device — no driver, no working printer.
  • Assembler: assembly to machine code. Compiler: whole program at once, produces a separate executable. Interpreter: one statement at a time, no executable.
  • A compiler lists all errors after scanning the whole program; an interpreter stops at the first error it reaches while running.
  • Python is interpreted — but a syntax error anywhere stops the file before line 1 runs, while a run-time error stops it only at that line.

The Operating System

Quick answer An operating system is the system software that manages processes, memory, files, devices and security, and gives the user an interface — command line, graphical, touch or voice — to reach the hardware.

An operating system (OS) is the system software that controls the whole computer. It has two jobs at once. It is a resource manager, deciding who gets the CPU, the RAM and the printer and for how long, and it is an interface between the user and the hardware, so you never have to know how a hard disk is wired in order to save a file.

The OS is the first major program loaded when you switch on. That process is booting: ROM runs the start-up instructions and a self-check, then the core of the OS, called the kernel, is loaded from the hard disk into RAM and stays there as long as the machine is on. Starting from a powered-off state is cold booting; restarting a machine that is already running is warm booting.

Functions of the operating system

  1. Process management — a process is a program in execution. The OS decides which process gets the CPU next and for how long (scheduling), keeps track of every running process, and removes it when it finishes. On a single CPU, only one process actually runs at any instant; the OS switches between them so fast that multitasking looks simultaneous.
  2. Memory management — the OS allocates RAM to each program, keeps one program from writing into another's space, and frees that RAM when the program closes. If RAM runs short it can use part of the disk as virtual memory, which is why a machine with too little RAM becomes very slow.
  3. File management — creating, naming, opening, reading, copying, moving and deleting files and folders, and remembering where each file physically sits on the disk. It also enforces who may open which file.
  4. Device management — controlling every input and output device through its device driver, and using buffering and spooling so a slow device does not hold up the CPU. When you send five documents to a printer, spooling is what queues them.
  5. Security and protection — user accounts, passwords, file permissions, and stopping one user or program from interfering with another.
  6. Command interpretation and user interface — accepting what the user asks for, whether typed or clicked, and carrying it out.

Types of OS user interface. The interface is how you tell the OS what you want.

InterfaceHow you use itStrengthWeaknessExample
Command Line Interface (CLI)Type a command and press EnterFast, precise, easy to automate, light on resourcesYou must remember exact commands and spellingCommand Prompt, PowerShell, Linux shell
Graphical User Interface (GUI)Point and click on windows, icons, menusEasy to learn, nothing to memoriseNeeds more RAM, CPU and screenWindows desktop, Ubuntu GNOME, macOS
Touch-based interfaceTap, swipe, pinch, long pressNatural, no separate pointing deviceImprecise for detailed workAndroid, iOS, tablets
Voice-based interfaceSpeak a commandHands-free, helps users who cannot typeStruggles with accents and noise, needs a microphoneVoice assistants on phones and smart speakers

Some operating systems you will be asked to name: Windows, Linux and its distributions such as Ubuntu and Fedora, macOS, and for mobile devices Android and iOS. India has its own Linux distribution, BOSS (Bharat Operating System Solutions), developed by C-DAC.

Worked example — what the OS is juggling. Three programs each need the CPU. The OS runs them one after another in the order they arrived, which is the simplest scheduling policy of all. The program below works out how long each one waits.

# Three programs each need the CPU. The OS runs them one after another,
# in the order they arrived - the simplest scheduling policy of all.
burst_chrome = 5          # CPU time each job needs, in milliseconds
burst_vlc    = 3
burst_python = 8

wait_chrome = 0                                 # arrived first, waits for nobody
wait_vlc    = burst_chrome                      # waits while Chrome runs
wait_python = burst_chrome + burst_vlc          # waits for both of them

print("Job", "Burst", "Waiting", sep="\t")
print("Chrome", burst_chrome, wait_chrome, sep="\t")
print("VLC", burst_vlc, wait_vlc, sep="\t")
print("Python", burst_python, wait_python, sep="\t")

total = burst_chrome + burst_vlc + burst_python
average = (wait_chrome + wait_vlc + wait_python) / 3
print("Total CPU time used :", total, "ms")
print("Average waiting time:", round(average, 2), "ms")

Output:

Job	Burst	Waiting
Chrome	5	0
VLC	3	5
Python	8	8
Total CPU time used : 16 ms
Average waiting time: 4.33 ms

Chrome waits nothing because it arrived first, VLC waits the 5 ms Chrome took, and Python waits for both, so the average wait is (0 + 5 + 8) / 3 = 4.33 ms. This is process management in miniature. Change the order and the average waiting time changes — which is exactly the kind of decision a real scheduler makes thousands of times a second, and the reason your machine still responds to the mouse while a large file is copying.

Functions of the OS Process + Memory + File + Device + Security management (+ user interface) The standard five-mark answer. Translating a program is NOT an OS function — that is a translator's job.
Kernel kernel = core of the OS, resident in RAM Loaded during booting and talks directly to the hardware.
Booting power on -> ROM start-up and self-check -> kernel loaded into RAM Cold booting = from power off. Warm booting = restart while already running.
Multitasking one CPU, many processes, switched very rapidly Only one process runs at any instant; the OS gives each a slice of CPU time.
CLI vs GUI CLI = type a command; GUI = point and click CLI is faster and needs fewer resources; GUI is easier for a beginner and needs more RAM.
Spooling jobs queued for a slow device while the CPU carries on Why five documents sent to one printer come out in order without freezing your computer.
Remember
  • The OS is both a resource manager and the interface between the user and the hardware; the kernel is its core and stays in RAM.
  • Its main functions are process, memory, file, device and security management, plus command interpretation.
  • Multitasking is an illusion on a single CPU — the OS switches between processes fast enough that they appear simultaneous.
  • The four interface types are CLI, GUI, touch-based and voice-based; CLI is fast and light but must be memorised, GUI is easy but resource-hungry.
  • Booting loads the OS from disk into RAM; cold booting starts from power off, warm booting restarts a running machine.

The formula sheet

Every formula in this chapter, in one place — screenshot it before your exam.

Input -> Process -> Output (+ Storage)
IPO cycle
CPU = Control Unit + ALU + Registers
CPU
Fetch -> Decode -> Execute -> Store
Machine cycle
1 GHz = 1,000,000,000 clock cycles per second
Clock speedGHz
Address bus + Data bus + Control bus
System bus
instructions + data both held in main memory
Stored program concept
variable = input(prompt)
input()
print(v1, v2, sep=" ", end="\n")
print()
ord(single_character) -> int
ord()
chr(code_number) -> str
chr()
bin(integer) -> str
bin()
monitor, speaker, projector = soft copy; printer, plotter = hard copy
Soft vs hard copy
1 byte = 8 bits ; 1 nibble = 4 bits
bit and bytebit, B
1 KB = 1024 bytes = 2^10 bytes
KilobyteKB
1 MB = 1024 KB = 2^20 bytes = 1,048,576 bytes
MegabyteMB
1 GB = 1024 MB = 2^30 bytes = 1,073,741,824 bytes
GigabyteGB
1 TB = 1024 GB = 2^40 bytes ; 1 PB = 1024 TB = 2^50 bytes
Terabyte and petabyteTB, PB
size = width * height * bytes per pixel
Uncompressed image sizebytes
assembly language -> machine code
Assembler
whole source program -> one object/executable file
Compiler
statement -> translate -> execute -> next statement
Interpreter
source code (.py, .c, .cpp) -> object code (.obj, .exe)
Source vs object code
python program.py
Python's model
System software | Programming tools | Application software
Software categories
Process + Memory + File + Device + Security management (+ user interface)
Functions of the OS
kernel = core of the OS, resident in RAM
Kernel
power on -> ROM start-up and self-check -> kernel loaded into RAM
Booting
one CPU, many processes, switched very rapidly
Multitasking
CLI = type a command; GUI = point and click
CLI vs GUI
jobs queued for a slow device while the CPU carries on
Spooling

Test yourself

Tap an answer to check it instantly — you'll see why it's right, and what to revise if it isn't.

0 correct · 0/12 answered
Q1

What is the output of the following code? print(2 ** 20 // 2 ** 10)

Q2

What is the output of the following code? print(chr(ord("A") + 5))

Q3

What is the output of the following code? print("A", end="") print("B", "C", sep="") print("D")

Q4

A file contains exactly these three lines. What appears on the screen when it is run? print("Start") print(int("12ab")) print("End")

Q5

What is the output of the following code? gb = 1024 * 1024 * 1024 print(round(3 * gb / (1000 * 1000 * 1000), 2))

Q6

Which memory loses all its contents the instant the power supply is cut?

Q7

Why is cache memory placed between the CPU and main memory?

Q8

Which statement about error reporting by language translators is correct?

Q9

An assembler is a program that translates:

Q10

After a fresh installation of Windows, Sameer's printer is not detected even though the cable and power are fine. The missing piece of software is most likely:

Q11

Which of the following is NOT a function of an operating system?

Q12

Which option lists the memory units correctly from smallest to largest?

NCERT solutions & previous-year questions

Step-by-step model answers — tap a question to reveal the full solution.

NCERT questions 6

1 What is a computer system? Draw the block diagram of a computer system and briefly explain the function of each of its units.Basic computer organisation

A computer system is an electronic machine made up of hardware and software working together, which accepts data as input, processes it according to a stored set of instructions, produces information as output, and can store the result for later use.

Block diagram

   +-------------+       +--------------------------+       +--------------+
   | INPUT UNIT  | ----- |   CPU                    | ----- | OUTPUT UNIT  |
   | keyboard,   |       |  +--------+  +--------+  |       | monitor,     |
   | mouse,      |       |  |   CU   |  |  ALU   |  |       | printer,     |
   | scanner     |       |  +--------+  +--------+  |       | speaker      |
   +-------------+       |  +------------------+    |       +--------------+
                         |  |    REGISTERS     |    |
                         |  +------------------+    |
                         +--------------------------+
                                     |
                         +---------------------------+
                         |  MEMORY UNIT              |
                         |  primary (cache/RAM/ROM)  |
                         |  secondary (HDD/SSD/pen)  |
                         +---------------------------+

Function of each unit

  1. Input unit — accepts data and instructions from the user and converts them into the binary form the machine can work with. Examples: keyboard, mouse, scanner, microphone.
  2. Memory unit — stores the data and the instructions during processing, and the results afterwards. Primary memory (RAM, ROM, cache) is directly reachable by the CPU; secondary memory (hard disk, SSD, pen drive) holds data permanently but must be copied into RAM before it can be used.
  3. Control Unit (CU) — fetches each instruction from memory, decodes it and issues control signals directing all the other units. It supervises but does not calculate.
  4. Arithmetic Logic Unit (ALU) — performs all arithmetic operations (addition, subtraction, multiplication, division) and all logical operations (comparisons, AND, OR, NOT).
  5. Output unit — converts the binary results back into a human-readable form. Examples: monitor, printer, speaker.

The CU and ALU together, along with the registers, form the CPU (Central Processing Unit), often called the brain of the computer.

2 Classify the following as input device, output device or both: keyboard, monitor, touch screen, printer, scanner, speaker, microphone, plotter, joystick, OMR reader, headset with microphone. Also state which of them produce a hard copy.Input and output devices
DeviceClassificationReason
KeyboardInputSends a code for each key pressed to the CPU
MonitorOutputDisplays results; soft copy
Touch screenBoth (I/O)Displays output and also accepts taps and swipes as input
PrinterOutputProduces printed results
ScannerInputConverts a printed page into pixel data
SpeakerOutputConverts digital audio into sound
MicrophoneInputConverts sound into numeric data
PlotterOutputDraws large accurate diagrams on paper
JoystickInputSends position and button signals
OMR readerInputReads which bubbles are marked on a sheet
Headset with microphoneBoth (I/O)The earphone part is output, the microphone part is input

Hard copy output: only the printer and the plotter, because their output is on paper and is permanent. The monitor and speaker give soft copy output, which is temporary and disappears once the screen is closed or the sound stops.

3 (i) Differentiate between primary memory and secondary memory. (ii) Differentiate between RAM and ROM. (iii) What is cache memory and why is it needed?Memory (primary, cache, secondary)

(i) Primary memory versus secondary memory

BasisPrimary memorySecondary memory
Access by CPUDirectly accessibleNot directly accessible; data must first be copied into primary memory
SpeedFastSlow
CapacitySmaller (in GB)Much larger (GB to TB)
Cost per byteHighLow
VolatilityRAM is volatile; ROM is notNon-volatile, permanent
ExamplesRAM, ROM, cacheHard disk, SSD, pen drive, memory card, CD/DVD

(ii) RAM versus ROM

BasisRAMROM
Full formRandom Access MemoryRead Only Memory
VolatilityVolatile — contents lost when power goes offNon-volatile — contents retained
OperationsBoth read and writeNormally read only
ContentsPrograms and data currently in useStart-up (booting) instructions written by the manufacturer
SizeLargerSmall
TypesSRAM, DRAMPROM, EPROM, EEPROM

(iii) Cache memory. Cache is a small block of very fast memory placed between the CPU and main memory (RAM). It stores the instructions and data that the CPU has used recently or is most likely to need next.

Why it is needed: the CPU can process data far faster than RAM can deliver it. Without cache, the processor would spend a large part of its time simply waiting for RAM. Because programs tend to use the same instructions and data repeatedly, keeping those items in cache means the CPU usually finds what it wants immediately (a cache hit) instead of making the slower trip to RAM (a cache miss). Cache is faster and costlier per byte than RAM, so only a small amount of it is provided.

4 Carry out the following conversions: (i) 1 GB into bytes (ii) 2 MB into KB and into bytes (iii) 5 TB into GB (iv) 1 MB into bits (v) 1 PB into TB.Units of memory

The rule for every step is multiply by 1024 when moving to a smaller unit, because 210 = 1024.

(i) 1 GB into bytes
1 GB = 1024 MB = 1024 x 1024 KB = 1024 x 1024 x 1024 bytes = 1,073,741,824 bytes (that is 230).

(ii) 2 MB into KB and bytes
2 MB = 2 x 1024 KB = 2048 KB
2048 KB = 2048 x 1024 = 2,097,152 bytes.

(iii) 5 TB into GB
5 TB = 5 x 1024 GB = 5120 GB.

(iv) 1 MB into bits
1 MB = 1,048,576 bytes, and 1 byte = 8 bits.
1,048,576 x 8 = 8,388,608 bits.

(v) 1 PB into TB
1 PB = 1024 TB (and 1 PB = 250 = 1,125,899,906,842,624 bytes).

Checking the answers with Python

KB = 1024
MB = 1024 * KB
GB = 1024 * MB
TB = 1024 * GB
PB = 1024 * TB

print("1 GB in bytes :", GB)
print("2 MB in KB    :", 2 * MB // KB)
print("2 MB in bytes :", 2 * MB)
print("5 TB in GB    :", 5 * TB // GB)
print("1 MB in bits  :", MB * 8)
print("1 PB in TB    :", PB // TB)

Output:

1 GB in bytes : 1073741824
2 MB in KB    : 2048
2 MB in bytes : 2097152
5 TB in GB    : 5120
1 MB in bits  : 8388608
1 PB in TB    : 1024
5 What is a language translator? Differentiate between an assembler, a compiler and an interpreter. Which type does Python use, and what evidence would you show for that?Language translators

A language translator is system software that converts a program written by a human into machine code, because the CPU understands nothing except binary machine instructions. The program written by the programmer is the source code; the machine-level result is the object code.

BasisAssemblerCompilerInterpreter
Input languageAssembly languageHigh-level languageHigh-level language
Unit of translationWhole programWhole program at onceOne statement at a time
Separate object file?YesYesNo
Error reportingAll togetherAll together, after scanning the full programFirst error reached, then it stops
Execution speedFastFastSlower — translation happens every run
Needed while running?NoNoYes
Example languagesAssemblyC, C++Python, BASIC

Python uses an interpreter. The evidence is that statements before an error have already produced their output before the program stops. Run this file:

print("Line 1 ran")
print("Line 2 ran")
print(10 / 0)          # run-time error is HERE
print("Line 4 never runs")

Output:

Line 1 ran
Line 2 ran
Traceback (most recent call last):
  File "C:\pytmp\demo1.py", line 3, in 
    print(10 / 0)          # run-time error is HERE
          ~~~^~~
ZeroDivisionError: division by zero

Lines 1 and 2 printed their output before Python even looked at line 3. A compiled language would have refused to build an executable, so nothing at all would have been printed. Note the one exception: if the mistake is a syntax error, Python detects it while checking the whole file's grammar before execution starts, and then no line runs at all.

6 What is an operating system? Explain any four of its functions. Also describe the different types of user interface an operating system may provide, and name two operating systems used in India.Operating system

An operating system is the system software that manages all the hardware and software resources of a computer and acts as an interface between the user and the hardware. It is the first major program loaded into RAM when the computer is switched on, and its core, the kernel, stays in memory for as long as the machine is running.

Four functions of an operating system

  1. Process management — a process is a program under execution. The OS decides which process gets the CPU and for how long, keeps track of all running processes, and removes them when they finish. On a single CPU only one process runs at any instant; rapid switching creates the appearance of multitasking.
  2. Memory management — the OS allocates RAM to each program, ensures one program cannot overwrite another's memory, and reclaims that memory when the program closes. If RAM is insufficient it can use part of the disk as virtual memory.
  3. File management — creating, naming, storing, retrieving, copying and deleting files and folders, keeping a record of where each file physically lies on the disk, and enforcing access permissions.
  4. Device management — controlling every input and output device through its device driver, and using buffering and spooling so that slow devices such as printers do not keep the CPU waiting.

(Other acceptable functions: security and protection through user accounts and passwords, and command interpretation.)

Types of user interface

  • Command Line Interface (CLI) — the user types a command and presses Enter. Fast, precise and light on resources, but the commands must be memorised. Examples: Command Prompt, Linux shell.
  • Graphical User Interface (GUI) — the user works with windows, icons, menus and a pointer. Easy for a beginner, but needs more RAM and processing power. Examples: Windows desktop, macOS, Ubuntu.
  • Touch-based interface — the user taps, swipes and pinches directly on the screen. Used on smartphones and tablets running Android or iOS.
  • Voice-based interface — the user speaks a command, which is useful hands-free and for users who cannot type, but it is affected by background noise and accent.

Operating systems used in India: Windows and Linux. India also has its own Linux distribution, BOSS (Bharat Operating System Solutions), developed by C-DAC. On mobile devices, Android is the most widely used.

Previous-year board questions 4

Q1 Define the terms bit and byte. A text file stored on a school computer is 3 MB in size. Calculate its size in (i) bytes and (ii) bits, showing your working. (3 marks) Class 11 Annual Exam pattern

Bit — short for binary digit, it is the smallest unit of memory and can hold only one of two values, 0 or 1.

Byte — a group of 8 bits, treated as one unit. One byte is the amount of memory needed to store one ordinary character.

(i) Size in bytes

1 MB = 1024 KB and 1 KB = 1024 bytes, so 1 MB = 1024 x 1024 = 1,048,576 bytes.

3 MB = 3 x 1,048,576 = 3,145,728 bytes

(ii) Size in bits

1 byte = 8 bits, so 3,145,728 x 8 = 25,165,824 bits

Verification

MB = 1024 * 1024
print("3 MB in bytes:", 3 * MB)
print("3 MB in bits :", 3 * MB * 8)

Output:

3 MB in bytes: 3145728
3 MB in bits : 25165824

Marking tip: you lose marks for using 1000 instead of 1024. Always write the 1024 step explicitly.

Q2 Distinguish between a compiler and an interpreter, giving any three points of difference. State which of the two Python uses and give one practical consequence of that choice for a student learning to program. (3 marks) CBSE sample-paper pattern

Three points of difference

BasisCompilerInterpreter
Unit of translationTranslates the entire source program in one goTranslates and executes one statement at a time
Object codeProduces a separate executable file, which then runs without the compilerProduces no separate file; the interpreter must be present every time the program is run
Error reportingReports all the errors it finds after scanning the whole programReports the first error it reaches and stops there

(Also acceptable: execution is faster with a compiler because the machine code is ready in advance; a compiler needs more memory because object code is stored.)

Python uses an interpreter.

Practical consequence for a learner: because the interpreter stops at the first statement that fails and names that line, a beginner is pointed at one mistake at a time instead of being handed a long list of errors, which makes debugging much easier. The trade-off is that a Python program runs more slowly than an equivalent compiled C++ program, since the translation is redone on every run, and Python must be installed on any machine where the program is to run.

Demonstration

print("Line 1 ran")
print("Line 2 ran")
print(10 / 0)          # run-time error is HERE
print("Line 4 never runs")

Output:

Line 1 ran
Line 2 ran
Traceback (most recent call last):
  File "C:\pytmp\demo1.py", line 3, in 
    print(10 / 0)          # run-time error is HERE
          ~~~^~~
ZeroDivisionError: division by zero

The first two lines executed before the error was reached — behaviour that would be impossible with a compiler, which would not have produced a runnable program at all.

Q3 A colour photograph taken on a mobile phone has a resolution of 1024 x 768 pixels and stores 3 bytes of colour information for every pixel. (i) Calculate the uncompressed size of the photograph in bytes and in MB. (ii) How many such photographs can be stored on a 4 GB memory card? (4 marks) Class 11 Annual Exam pattern

(i) Size of one photograph

Total number of pixels = 1024 x 768 = 786,432

Each pixel needs 3 bytes, so size = 786,432 x 3 = 2,359,296 bytes

To convert to MB, divide by 1024 twice:

2,359,296 / 1,048,576 = 2.25 MB

(ii) Number of photographs on a 4 GB card

4 GB = 4 x 1024 x 1024 x 1024 = 4,294,967,296 bytes

Number of photographs = 4,294,967,296 / 2,359,296 = 1820.44..., and since a part of a photograph cannot be stored, the answer is 1820 photographs.

Verification

MB = 1024 * 1024
GB = 1024 * MB
img = 1024 * 768 * 3
print("One photo in bytes:", img)
print("One photo in MB   :", img / MB)
print("Photos on 4 GB    :", (4 * GB) // img)

Output:

One photo in bytes: 2359296
One photo in MB   : 2.25
Photos on 4 GB    : 1820

Note: in practice a phone stores far more photographs than this, because image formats such as JPEG compress the data. The figure calculated here is the uncompressed size, which is what the question asks for.

Q4 Priya's laptop has become very slow, and a newly connected printer is not being detected at all. (i) Name the category of software that will help her remove unused files and check the disk, and give two examples. (ii) Name the software needed to make the printer work and explain its role. (iii) List any four functions the operating system performs every time she opens two applications at once. (5 marks) Class 11 Half-Yearly pattern

(i) Category of software

She needs system utilities (also called utility software), which are a kind of system software whose job is to maintain and tune the computer rather than do the user's own work.

Examples: disk cleanup (removes temporary and unused files), disk defragmenter (rearranges scattered file fragments so the disk reads faster), antivirus software, file compression tools, backup and restore tools.

(ii) Software needed for the printer

A device driver, specifically the printer driver for that model.

Role: a device driver is system software that acts as a translator between the operating system and one particular hardware device. Every printer model understands its own set of commands, and the operating system cannot be built with knowledge of every device ever made. The driver converts the OS's general instruction ("print this page") into the exact signals that model of printer understands. Without the correct driver installed, the OS cannot communicate with the printer at all, so the device appears not to be detected even though the cable and power are fine.

(iii) Four operating system functions performed when two applications run together

  1. Process management — the OS creates a process for each application and schedules them, deciding which one gets the CPU and for how long, so both appear to run at the same time on a single processor.
  2. Memory management — it allocates a separate area of RAM to each application, prevents one from writing into the other's memory, and releases that memory when an application is closed.
  3. File management — it opens, reads and saves the files each application needs, and keeps track of where those files are stored on the disk.
  4. Device management — it shares the keyboard, mouse, screen and printer between the two applications through their device drivers, queuing requests (for example, spooling print jobs) so neither program is blocked.

(A fifth acceptable point: security and protection, ensuring one application cannot access data belonging to another user or process.)

Part of Priodemy for School

Interactive CBSE lessons, Class 8–12 — free with every school on Priodemy EduSuite. Explore more chapters and labs on the Priodemy for School hub.

Ask AI