DSSSB TGT Computer Science – Device Management | Service Management Approaches, Buffering, Device Drivers & Performance Tuning

1. Introduction to Device Management

Device management is an important function of an operating system. It controls and coordinates input/output (I/O) devices connected to a computer.

Examples of I/O devices include:

  • Keyboard and mouse
  • Monitor and printer
  • Hard disk and USB drive
  • Network adapter
  • Microphone and speakers
Simple example: When you print a document, the operating system manages the print request, communicates with the printer through its driver and coordinates the transfer of data.

2. Main Objectives of Device Management

  • Manage communication between the OS and hardware devices.
  • Allocate devices to processes when required.
  • Coordinate input and output operations.
  • Handle device errors and status information.
  • Improve device utilization and overall system performance.
  • Provide a consistent interface for applications to access devices.

3. Service Management Approaches

Operating systems use different approaches to manage I/O devices and their requests. The approach depends on the device, the type of operation and the system's requirements.

3.1 Dedicated Device

A dedicated device is assigned to one process or user for a period of time. Other processes generally cannot use it simultaneously.

Example: A process may receive exclusive use of a device while performing an operation.

Advantage: Simple control and fewer conflicts between users.

Limitation: The device may remain idle while reserved.

3.2 Shared Device

A shared device can be used by multiple processes. The operating system coordinates access to avoid conflicts.

Example: Multiple users may send print jobs to the same printer.

Advantage: Better resource utilization.

Limitation: Requires coordination and scheduling.

3.3 Virtual Device

A virtual device is a logical representation of a physical device. The OS makes a physical device appear as if it can serve multiple processes independently.

Example: A printer spooler accepts print requests from different applications and manages them through a print queue.

ApproachMeaningExample
DedicatedAssigned to one process at a timeExclusive device access
SharedUsed by multiple processes with coordinationShared printer
VirtualLogical representation of a physical deviceVirtual printer queue
Exam point: Dedicated means exclusive allocation; shared means coordinated access; virtual means a logical representation of a device.

4. Buffering

Buffering is a technique in which data is temporarily stored in a memory area called a buffer while it is transferred between two devices or between a device and a program.

Devices often operate at different speeds. A buffer helps manage this speed difference.

Example: A keyboard produces input at a relatively slow rate. The OS can temporarily store the typed characters in a buffer until the application reads them.

Why is Buffering Required?

  • To handle differences in device and CPU speeds.
  • To reduce waiting time during data transfers.
  • To manage temporary variations in data flow.
  • To improve I/O efficiency.
  • To allow computation and I/O operations to overlap where possible.

Types of Buffering

4.1 Single Buffering

One buffer is used to temporarily hold data during an I/O operation.

Input Device
     |
     v
 [One Buffer]
     |
     v
Application

Limitation: The application or device may need to wait while the same buffer is being used.

4.2 Double Buffering

Two buffers are used. While one buffer is being processed, the other can be filled with new data.

             +----------+
Device ----> | Buffer A | ----> Application
             +----------+
             +----------+
Device ----> | Buffer B | ----> Application
             +----------+

This arrangement can reduce waiting by allowing overlapping operations.

4.3 Circular Buffering

Multiple buffer locations are arranged in a circular structure. After the last buffer location, the process returns to the first location.

 [Buffer 1] → [Buffer 2]
      ↑             ↓
 [Buffer 4] ← [Buffer 3]

Example: Audio and video streaming systems commonly use circular or ring buffers to manage continuous data.

Buffering vs Spooling

BufferingSpooling
Temporarily stores data in memory.Queues jobs, commonly using secondary storage.
Often used during data transfer.Often used to manage jobs for a shared device.
Helps handle speed differences.Allows multiple jobs to wait for device service.
Example: Audio data buffer.Example: Printer spool queue.
Important: Buffering and spooling are not identical. Buffering temporarily stores data during transfer; spooling queues jobs for a device.

5. Device Drivers

A device driver is system software that allows the operating system to communicate with and control a hardware device.

Functions of Device Drivers

  • Translate OS requests into device-specific commands.
  • Control device operations.
  • Transfer data between the OS and hardware.
  • Report device status and errors.
  • Provide an interface between the OS and the device.

Working of a Device Driver

Application Program
        |
        v
Operating System
        |
        v
   Device Driver
        |
        v
   Hardware Device

Examples

DriverPurpose
Printer driverCommunicates with printer hardware.
Graphics driverSupports graphics hardware operations.
Audio driverManages audio hardware interaction.
Network driverSupports network adapter communication.
Storage driverSupports communication with storage devices.
Remember: A device driver is software, not hardware. It helps the OS communicate with a particular device or device class.

6. Performance Tuning

Performance tuning means improving the efficiency and performance of a computer system by adjusting how its resources and I/O operations are managed.

In device management, performance tuning aims to improve device utilization, reduce unnecessary waiting and increase data-transfer efficiency.

Important Techniques

6.1 Buffer Optimization

Choosing suitable buffer sizes and buffer arrangements can reduce waiting and improve data flow.

6.2 Caching

Frequently accessed data is kept in faster storage so that future requests can be served more quickly.

Example: Disk caching can reduce repeated access to slower storage.

6.3 I/O Scheduling

The OS decides the order in which pending I/O requests are handled. Effective scheduling can reduce unnecessary delays and improve throughput.

6.4 DMA (Direct Memory Access)

DMA allows a device to transfer data directly to or from main memory with limited CPU involvement in the transfer itself.

This can free the CPU to perform other work while the transfer is in progress.

6.5 Interrupt Handling

Interrupts allow devices to notify the CPU when attention is required, rather than requiring the CPU to continuously check device status.

Performance Terms

TermMeaning
ThroughputAmount of work or data processed in a given time.
LatencyTime taken for an operation or response.
UtilizationHow effectively a device or resource is being used.
Waiting timeTime a request spends waiting before service.
Exam point: Performance tuning tries to improve throughput and utilization while reducing latency and unnecessary waiting.

7. Important Differences for Exams

ConceptKey Difference
Buffering vs CachingBuffering handles temporary data transfer; caching keeps copies of data for faster reuse.
Buffering vs SpoolingBuffering temporarily stores data; spooling queues jobs for a device.
Driver vs DeviceDriver is software; device is hardware.
Dedicated vs SharedDedicated is exclusive allocation; shared is coordinated multi-process access.
Latency vs ThroughputLatency measures delay; throughput measures work completed per unit time.

8. Quick Revision

  • Device management coordinates I/O devices.
  • Dedicated devices are assigned exclusively for a period.
  • Shared devices are accessed by multiple processes with coordination.
  • Virtual devices provide a logical representation of physical devices.
  • Buffering temporarily stores data during transfer.
  • Single, double and circular buffering are common buffer arrangements.
  • Spooling queues jobs, for example print jobs.
  • Device drivers provide communication between the OS and hardware.
  • Performance tuning improves device and system efficiency.
  • DMA reduces the CPU's involvement in data transfer.

9. Interactive MCQ Test – 15 Questions

Choose one correct option for each question. Click Submit Quiz to check your answers and explanations.

10. Self-Assessment Checklist

  • Can I explain dedicated, shared and virtual device approaches?
  • Can I define buffering and explain why it is required?
  • Can I distinguish single, double and circular buffering?
  • Can I differentiate buffering and spooling?
  • Can I explain the role of device drivers?
  • Can I define performance tuning?
  • Can I explain throughput, latency and utilization?
  • Can I explain how DMA and interrupts support I/O operations?
Next lesson: Day 2 – Lesson 4: Process Management — System View of Processes and Resources, Initiating the OS, Process Address Space, Process Abstraction, Resource Abstraction and Process Hierarchy.

Study tip: Pay special attention to buffering vs spooling, device drivers, and the difference between latency and throughput. These are useful comparison topics for objective questions.

DSSSB TGT Computer Science – Operating System Organization | Kernels, System Calls, Process Models & Device Drivers

1. Introduction to Operating System Organization

An Operating System (OS) is system software that manages computer hardware and software resources and provides services to application programs.

Operating System Organization explains how the internal components of an OS are arranged and how they work together to manage processes, memory, devices and system services.

Simple example: When you open a music player, the OS allocates memory, schedules CPU time, accesses the audio device and manages the application. These activities are coordinated by OS components.

2. Factors in Operating System Design

Operating system design involves deciding how the OS should manage resources and provide services. Important considerations include:

  • Performance: The OS should use CPU, memory and devices efficiently.
  • Reliability: It should operate correctly and recover from errors where possible.
  • Security: It should protect data, processes and system resources from unauthorized access.
  • Resource management: CPU, memory, files and I/O devices must be allocated properly.
  • Scalability: The OS should support changing workloads and hardware capabilities.
  • Portability: The OS should be adaptable to different hardware platforms where designed to do so.
  • Usability: It should provide convenient ways for users and programs to interact with the system.
Exam point: OS design balances performance, reliability, security and efficient resource utilization.

3. Primary OS Functions

The operating system performs several major functions:

3.1 Process Management

A process is a program in execution. The OS creates, schedules, suspends and terminates processes. It also coordinates processes that need to share resources.

Example: Running a browser and a media player at the same time.

3.2 Memory Management

The OS keeps track of memory usage, allocates memory to processes and releases it when no longer needed.

Example: Allocating RAM to a newly opened application.

3.3 File Management

The OS manages files and directories. It supports operations such as creating, opening, reading, writing, renaming and deleting files.

3.4 Device and I/O Management

The OS coordinates input/output devices such as keyboards, printers, storage devices and monitors. Device drivers help the OS communicate with hardware.

3.5 Security and Protection

The OS controls access to system resources. Authentication checks identity, while authorization determines what an authenticated user or process is allowed to do.

3.6 Storage and Resource Management

The OS manages secondary storage and allocates available resources among competing processes.

3.7 User Interface and Networking

The OS may provide a command-line interface (CLI), graphical user interface (GUI), and networking facilities for communication between systems.

4. Implementation Consideration: Process Models

A process model describes how the operating system represents and manages executing programs.

4.1 Process

A process is an active instance of a program. A program stored on disk is passive; when it executes, it becomes a process.

4.2 Process Control Block (PCB)

The OS maintains information about each process in a data structure called the Process Control Block.

A PCB commonly contains:

  • Process ID (PID)
  • Process state
  • Program counter
  • CPU register information
  • Scheduling information
  • Memory-management information
  • I/O and file-related information
Remember: PCB stores the information required by the OS to manage and resume a process.

4.3 Process States

A common process-state model includes the following states:

StateMeaning
NewProcess is being created.
ReadyProcess is waiting for CPU allocation.
RunningProcess is currently executing on the CPU.
Waiting / BlockedProcess is waiting for an event or I/O operation.
TerminatedProcess has finished execution.

Typical flow:

New → Ready → Running → Terminated
                 ↓
              Waiting
                 ↓
               Ready

4.4 Context Switching

Context switching occurs when the CPU changes from executing one process to another. The OS saves the current process context and restores the context of the next process.

Example: The CPU stops executing Process A, saves its state, and starts executing Process B.

Exam point: Context switching enables multitasking but introduces overhead because saving and restoring process state takes time.

5. Kernels

The kernel is the central component of an operating system. It manages communication between software and hardware and performs essential system-level operations.

Major responsibilities of a kernel

  • Process and CPU management
  • Memory management
  • Device and I/O management
  • Handling system calls
  • Managing access to protected resources

Types of Kernel Architecture

TypeExplanation
Monolithic KernelMany OS services run in kernel space as part of a large kernel.
MicrokernelOnly essential services run in kernel space; other services run outside it.
Hybrid KernelCombines design ideas from monolithic and microkernel approaches.
Conceptual distinction: Kernel is the core of the OS. The operating system as a whole also includes other components and utilities.

User Mode and Kernel Mode

User ModeKernel Mode
Applications normally execute here.Core OS operations execute here.
Restricted access to hardware and protected resources.Privileged access to system resources.
Uses system calls to request OS services.Handles authorized system-service requests.

6. Methods of Requesting System Services

Application programs often need services that they cannot safely perform directly. They request these services from the OS through system calls.

A system call is a controlled interface between a user program and the operating system kernel.

How a system call works

  1. An application requests an OS service.
  2. The request is made through a system-call interface.
  3. Control transfers to the kernel through a controlled mechanism.
  4. The kernel performs the requested operation after checking the request.
  5. The result is returned to the application.
Application Program
       |
       | System Call
       v
System Call Interface
       |
       v
     Kernel
       |
       v
Hardware / OS Service
       |
       v
   Result Returned

Common Categories of System Calls

CategoryPurposeExample
Process controlCreate, execute or terminate processes.Process creation
File managementCreate, read, write and delete files.File read
Device managementRequest or release device resources.Device access
Information maintenanceObtain or update system information.Get process information
CommunicationExchange data between processes.Inter-process communication
ProtectionControl permissions and access.Permission checking
Important: A system call is not the same as an ordinary function call. A system call requests a service from the OS kernel.

7. Device Drivers

A device driver is software that allows the operating system to communicate with and control a particular hardware device or class of devices.

Different hardware devices may have different control commands and communication requirements. Drivers provide the software interface needed by the OS.

Examples

  • Printer driver – helps the OS communicate with a printer.
  • Graphics driver – supports communication with graphics hardware.
  • Audio driver – manages audio hardware interaction.
  • Network driver – enables communication with a network adapter.

How a device driver works

Application
    |
    v
Operating System
    |
    v
Device Driver
    |
    v
Hardware Device

Why are device drivers needed?

  • They translate OS requests into device-specific operations.
  • They help the OS control hardware.
  • They provide a consistent interface for device access.
  • They help manage device operations and errors.
Exam point: A device driver is software, not hardware. It acts as an interface between the operating system and a hardware device.

8. Quick Revision Table

TermRemember
KernelCore component of OS
PCBStores process information
Context switchingSwitching CPU execution between processes
System callRequest for an OS service
Device driverSoftware interface for hardware
User modeRestricted execution mode
Kernel modePrivileged execution mode
MicrokernelMinimal services in kernel space
Monolithic kernelMany services in kernel space

9. Interactive MCQ Test – 15 Questions

Select one answer for each question and click Submit Quiz to view your score and explanations.

10. Self-Assessment Checklist

  • Can I explain the factors involved in OS design?
  • Can I list the primary functions of an operating system?
  • Can I explain PCB and process states?
  • Can I define context switching?
  • Can I distinguish kernel mode and user mode?
  • Can I explain monolithic and microkernel architectures?
  • Can I describe how system calls work?
  • Can I explain the role of device drivers?
Next lesson: Day 2 – Lesson 3: Device Management — Service Management Approaches, Buffering, Device Drivers and Performance Tuning.

Study tip: First understand the kernel, system calls and device drivers. Then attempt the quiz without looking at the notes.

DSSSB TGT Computer Science – Computer Systems Architecture Complete Revision + 25 MCQ Mock Test


PART 1: COMPLETE REVISION NOTES

1. Computer Organization and Architecture

Computer Architecture describes the features visible to a programmer, such as instruction sets, addressing modes and data types.

Computer Organization describes how hardware components are connected and implemented.

ComponentFunction
CPUExecutes instructions
ALUArithmetic and logical operations
CUControls instruction execution
RegistersHigh-speed temporary storage
MemoryStores data and instructions
I/O DevicesCommunicate with external devices

Important CPU Registers

RegisterFunction
PCAddress of next instruction
IRCurrent instruction
MARMemory address
MDRData transferred to/from memory
ACCIntermediate arithmetic results
SPTop of stack

2. System Bus

A bus is a communication pathway connecting computer components.

BusFunction
Data BusTransfers data
Address BusCarries addresses
Control BusCarries control signals
Number of addressable locations = 2n

Example: A system has a 16-bit address bus.

216 = 65,536 distinct locations in a byte-addressable system.

PCI: Peripheral Component Interconnect is a standard for connecting peripheral devices to a computer system.

3. Computer Memory Organization

MemoryKey Property
SRAMFast; commonly used in cache
DRAMRequires refreshing; commonly used as main memory
ROMNon-volatile
PROMProgrammable once
EPROMErased using ultraviolet light
EEPROMElectrically erasable
FlashElectrically erasable in blocks

Memory Hierarchy:

Registers
    ↓
Cache Memory
    ↓
Main Memory (RAM)
    ↓
Secondary Storage
Cache Hit Ratio = Cache Hits / Total Accesses
Cache Miss Ratio = 1 − Hit Ratio

Example: 80 cache hits out of 100 accesses.

Hit Ratio = 80/100 = 80%

Miss Ratio = 20%

4. Advanced DRAM Organization

  • DRAM: Stores bits using capacitors and requires periodic refreshing.
  • SDRAM: Synchronous DRAM, operates in synchronization with a clock.
  • DDR SDRAM: Transfers data on both rising and falling clock edges.
  • Memory Banks: Divide memory into independently accessible sections.
  • Memory Interleaving: Organizes memory access across multiple banks to improve throughput.

5. Input/Output Organization

MethodWorking
Programmed I/OCPU repeatedly checks device status
Interrupt-driven I/ODevice interrupts CPU when attention is required
DMATransfers data between I/O and memory with reduced CPU involvement
I/O ChannelSpecialized processor/control mechanism for I/O operations
Exam Point: DMA stands for Direct Memory Access.

6. Computer Arithmetic

Unsigned 8-bit range:

0 to 28 − 1 = 0 to 255

Two's Complement 8-bit range:

−128 to +127

Example: Represent −12 in 8-bit two's complement.

Binary of 12:      00001100
Invert bits:       11110011
Add 1:             11110100

Answer:            11110100

IEEE 754 Floating-Point Representation

FormatSignExponentFraction
Single (32-bit)1 bit8 bits23 bits
Double (64-bit)1 bit11 bits52 bits

Exponent Bias:

  • Single precision = 127
  • Double precision = 1023
Actual Exponent = Stored Exponent − Bias

7. Instruction Sets

An instruction set is the collection of machine instructions supported by a processor.

ConceptMeaning
OpcodeSpecifies operation
OperandData or its location
Instruction FormatArrangement of instruction bits
Addressing ModeMethod of locating an operand
ISAInstruction Set Architecture

Addressing Modes

ModeKey Concept
ImmediateValue is inside instruction
DirectAddress is specified directly
IndirectAddress is obtained indirectly
RegisterOperand is in register
Register IndirectRegister contains memory address
IndexedBase address + index
RelativePC + displacement

Instruction Cycle

1. FETCH
     ↓
2. DECODE
     ↓
3. EXECUTE
     ↓
4. STORE / WRITE BACK

Instruction Pipelining

StageMeaning
IFInstruction Fetch
IDInstruction Decode
EXExecute
MEMMemory Access
WBWrite Back

Pipeline Hazards:

  1. Structural Hazard – Hardware resource conflict.
  2. Data Hazard – Dependency between instructions.
  3. Control Hazard – Branch or jump changes instruction flow.

PART 2: IMPORTANT FORMULA SHEET

TopicFormula
Addressable locations2n
Unsigned n-bit maximum2n − 1
Two's complement minimum−2n−1
Two's complement maximum2n−1 − 1
Cache hit ratioHits / Total Accesses
Cache miss ratio1 − Hit Ratio
Indexed addressBase + Index
Relative addressPC + Displacement
Actual exponentStored Exponent − Bias

PART 3: MOCK TEST – 25 MCQs

Instructions:
  • Total Questions: 25
  • Total Marks: 25
  • Each question carries 1 mark.
  • Select one correct answer.
  • Click Submit Test to see your score and explanations.
Attempted: 0/25
Your Result

PART 4: NUMERICAL PRACTICE

Try solving these five questions yourself. Click the button to reveal the answer and explanation.

1. A computer has a 12-bit address bus. How many locations can it address?
Answer: 4096 locations

212 = 4096.

2. Find the unsigned maximum value of a 10-bit number.
Answer: 1023

210 − 1 = 1023.

3. Calculate the cache miss ratio if the hit ratio is 95%.
Answer: 5%

Miss Ratio = 100% − 95% = 5%.

4. Find the effective address if base = 1500 and index = 75.
Answer: 1575

EA = Base + Index = 1500 + 75 = 1575.

5. In IEEE 754 single precision, find the actual exponent if the stored exponent is 135.
Answer: 8

Actual Exponent = 135 − 127 = 8.

PART 5: SELF-ASSESSMENT

Tick the topics you can explain without looking at your notes.

Completed: 0/10

LESSON COMPLETED

Day 1 – Computer Systems Architecture Revision Completed!

You have revised:

  • Computer Organization and Architecture
  • System Buses and PCI
  • Internal Memory and Cache
  • Advanced DRAM Organization
  • Input/Output Organization
  • Computer Arithmetic
  • Instruction Sets and Pipelining

Next Lesson: Day 2 – Operating System Overview.

DSSSB TGT Computer Science: Computer Systems Architecture – Complete Revision + 25 MCQ Mock Test

 

Part 1: Complete Revision Notes

1. Computer Organization and Architecture

Computer Architecture describes the features visible to a programmer, such as instruction sets, addressing modes and data types.

Computer Organization describes how hardware components are connected and implemented.

Component

Function

CPU

Executes instructions

ALU

Arithmetic and logical operations

CU

Controls instruction execution

Registers

High-speed temporary storage

Memory

Stores data and instructions

I/O devices

Communicate with external devices

Important registers

Register

Function

PC

Address of next instruction

IR

Current instruction

MAR

Memory address

MDR

Data transferred to/from memory

ACC

Intermediate arithmetic results

SP

Top of stack

2. System Bus

A bus is a communication pathway connecting computer components.

Bus

Function

Data Bus

Transfers data

Address Bus

Carries addresses

Control Bus

Carries control signals

Numerical example:

A system has a 16-bit address bus.

\[ 2^{16}=65,536 \]

Therefore, it can address 65,536 distinct byte locations in a byte-addressable system.

PCI: Peripheral Component Interconnect is a standard for connecting peripheral devices to a computer system.

3. Computer Memory Organization

Memory

Key property

SRAM

Fast; commonly used in cache

DRAM

Requires refreshing; commonly used as main memory

ROM

Non-volatile

PROM

Programmable once

EPROM

Erased using ultraviolet light

EEPROM

Electrically erasable

Flash

Electrically erasable in blocks

Memory hierarchy:

Registers → Cache → Main Memory → Secondary Storage.

As we move down the hierarchy, capacity generally increases and access speed generally decreases.

Cache formulas:

\[ Hit\ Ratio=\frac{Cache\ Hits}{Total\ Accesses} \]
\[ Miss\ Ratio=1-Hit\ Ratio \]

Example: 80 cache hits out of 100 accesses.

\[ Hit\ Ratio=80/100=0.8=80\% \]
\[ Miss\ Ratio=20\% \]

4. Advanced DRAM Organization

  • DRAM: Stores bits using capacitors and requires periodic refreshing.

  • SDRAM: Synchronous DRAM, operates in synchronization with a clock.

  • DDR SDRAM: Transfers data on both rising and falling clock edges.

  • Memory banks: Divide memory into independently accessible sections.

  • Memory interleaving: Organizes memory access across multiple banks to improve throughput.

5. Input/Output Organization

Method

Working

Programmed I/O

CPU repeatedly checks device status

Interrupt-driven I/O

Device interrupts CPU when attention is required

DMA

Transfers data between I/O and memory with reduced CPU involvement

I/O Channel

Specialized processor/control mechanism for I/O operations

Remember: DMA stands for Direct Memory Access.

6. Computer Arithmetic

Unsigned 8-bit range:

\[ 0 \text{ to } 2^8-1=255 \]

Two's complement 8-bit range:

\[ -128 \text{ to } +127 \]

Example: Represent -12 in 8-bit two's complement

  1. Binary of 12 = 00001100

  2. Invert bits = 11110011

  3. Add 1 = 11110100

Therefore:

\[ -12=11110100 \]

IEEE 754 floating-point representation

Format

Sign

Exponent

Fraction

Single precision (32-bit)

1 bit

8 bits

23 bits

Double precision (64-bit)

1 bit

11 bits

52 bits

Exponent bias:

  • Single precision = 127

  • Double precision = 1023

\[ Actual\ Exponent=Stored\ Exponent-Bias \]

7. Instruction Sets

An instruction set is the collection of machine instructions supported by a processor.

Concept

Meaning

Opcode

Specifies operation

Operand

Data or its location

Instruction format

Arrangement of instruction bits

Addressing mode

Method of locating an operand

ISA

Instruction Set Architecture

Addressing modes:

Mode

Key concept

Immediate

Value is inside instruction

Direct

Address is specified directly

Indirect

Address is obtained indirectly

Register

Operand is in register

Register Indirect

Register contains memory address

Indexed

Base address + index

Relative

PC + displacement

Instruction cycle: Fetch → Decode → Execute → Store/Write Back (where required).

Instruction pipeline stages:

  • IF – Instruction Fetch

  • ID – Instruction Decode

  • EX – Execute

  • MEM – Memory Access

  • WB – Write Back

Pipeline hazards:

  1. Structural hazard – resource conflict.

  2. Data hazard – dependency between instructions.

  3. Control hazard – branch or jump changes instruction flow.

Part 2: Important Formula Sheet

Topic

Formula

Addressable locations

\(2^n\)

Unsigned n-bit maximum

\(2^n-1\)

Two's complement minimum

\(-2^{n-1}\)

Two's complement maximum

\(2^{n-1}-1\)

Cache hit ratio

Hits / Total accesses

Cache miss ratio

1 − Hit ratio

Effective address (indexed)

Base + Index

Effective address (relative)

PC + Displacement

Actual exponent

Stored exponent − Bias


DSSSB TGT Computer Science

Day 1 – Lesson 7: Computer Systems Architecture

Complete Revision + Mock Test

Revise Computer Organization, Memory, DRAM, Input/Output, Computer Arithmetic and Instruction Sets.

Mock Test: 25 Questions | 25 Marks

PART 1: COMPLETE REVISION NOTES

1. Computer Organization and Architecture

Computer Architecture describes the features visible to a programmer, such as instruction sets, addressing modes and data types.

Computer Organization describes how hardware components are connected and implemented.

ComponentFunction
CPUExecutes instructions
ALUArithmetic and logical operations
CUControls instruction execution
RegistersHigh-speed temporary storage
MemoryStores data and instructions
I/O DevicesCommunicate with external devices

Important CPU Registers

RegisterFunction
PCAddress of next instruction
IRCurrent instruction
MARMemory address
MDRData transferred to/from memory
ACCIntermediate arithmetic results
SPTop of stack

2. System Bus

A bus is a communication pathway connecting computer components.

BusFunction
Data BusTransfers data
Address BusCarries addresses
Control BusCarries control signals
Number of addressable locations = 2n

Example: A system has a 16-bit address bus.

216 = 65,536 distinct locations in a byte-addressable system.

PCI: Peripheral Component Interconnect is a standard for connecting peripheral devices to a computer system.

3. Computer Memory Organization

MemoryKey Property
SRAMFast; commonly used in cache
DRAMRequires refreshing; commonly used as main memory
ROMNon-volatile
PROMProgrammable once
EPROMErased using ultraviolet light
EEPROMElectrically erasable
FlashElectrically erasable in blocks

Memory Hierarchy:

Registers
    ↓
Cache Memory
    ↓
Main Memory (RAM)
    ↓
Secondary Storage
Cache Hit Ratio = Cache Hits / Total Accesses
Cache Miss Ratio = 1 − Hit Ratio

Example: 80 cache hits out of 100 accesses.

Hit Ratio = 80/100 = 80%

Miss Ratio = 20%

4. Advanced DRAM Organization

  • DRAM: Stores bits using capacitors and requires periodic refreshing.
  • SDRAM: Synchronous DRAM, operates in synchronization with a clock.
  • DDR SDRAM: Transfers data on both rising and falling clock edges.
  • Memory Banks: Divide memory into independently accessible sections.
  • Memory Interleaving: Organizes memory access across multiple banks to improve throughput.

5. Input/Output Organization

MethodWorking
Programmed I/OCPU repeatedly checks device status
Interrupt-driven I/ODevice interrupts CPU when attention is required
DMATransfers data between I/O and memory with reduced CPU involvement
I/O ChannelSpecialized processor/control mechanism for I/O operations
Exam Point: DMA stands for Direct Memory Access.

6. Computer Arithmetic

Unsigned 8-bit range:

0 to 28 − 1 = 0 to 255

Two's Complement 8-bit range:

−128 to +127

Example: Represent −12 in 8-bit two's complement.

Binary of 12:      00001100
Invert bits:       11110011
Add 1:             11110100

Answer:            11110100

IEEE 754 Floating-Point Representation

FormatSignExponentFraction
Single (32-bit)1 bit8 bits23 bits
Double (64-bit)1 bit11 bits52 bits

Exponent Bias:

  • Single precision = 127
  • Double precision = 1023
Actual Exponent = Stored Exponent − Bias

7. Instruction Sets

An instruction set is the collection of machine instructions supported by a processor.

ConceptMeaning
OpcodeSpecifies operation
OperandData or its location
Instruction FormatArrangement of instruction bits
Addressing ModeMethod of locating an operand
ISAInstruction Set Architecture

Addressing Modes

ModeKey Concept
ImmediateValue is inside instruction
DirectAddress is specified directly
IndirectAddress is obtained indirectly
RegisterOperand is in register
Register IndirectRegister contains memory address
IndexedBase address + index
RelativePC + displacement

Instruction Cycle

1. FETCH
     ↓
2. DECODE
     ↓
3. EXECUTE
     ↓
4. STORE / WRITE BACK

Instruction Pipelining

StageMeaning
IFInstruction Fetch
IDInstruction Decode
EXExecute
MEMMemory Access
WBWrite Back

Pipeline Hazards:

  1. Structural Hazard – Hardware resource conflict.
  2. Data Hazard – Dependency between instructions.
  3. Control Hazard – Branch or jump changes instruction flow.

PART 2: IMPORTANT FORMULA SHEET

TopicFormula
Addressable locations2n
Unsigned n-bit maximum2n − 1
Two's complement minimum−2n−1
Two's complement maximum2n−1 − 1
Cache hit ratioHits / Total Accesses
Cache miss ratio1 − Hit Ratio
Indexed addressBase + Index
Relative addressPC + Displacement
Actual exponentStored Exponent − Bias

PART 3: MOCK TEST – 25 MCQs

Instructions:
  • Total Questions: 25
  • Total Marks: 25
  • Each question carries 1 mark.
  • Select one correct answer.
  • Click Submit Test to see your score and explanations.
Attempted: 0/25
Your Result

PART 4: NUMERICAL PRACTICE

Try solving these five questions yourself. Click the button to reveal the answer and explanation.

1. A computer has a 12-bit address bus. How many locations can it address?
Answer: 4096 locations

212 = 4096.

2. Find the unsigned maximum value of a 10-bit number.
Answer: 1023

210 − 1 = 1023.

3. Calculate the cache miss ratio if the hit ratio is 95%.
Answer: 5%

Miss Ratio = 100% − 95% = 5%.

4. Find the effective address if base = 1500 and index = 75.
Answer: 1575

EA = Base + Index = 1500 + 75 = 1575.

5. In IEEE 754 single precision, find the actual exponent if the stored exponent is 135.
Answer: 8

Actual Exponent = 135 − 127 = 8.

PART 5: SELF-ASSESSMENT

Tick the topics you can explain without looking at your notes.

Completed: 0/10

LESSON COMPLETED

Day 1 – Computer Systems Architecture Revision Completed!

You have revised:

  • Computer Organization and Architecture
  • System Buses and PCI
  • Internal Memory and Cache
  • Advanced DRAM Organization
  • Input/Output Organization
  • Computer Arithmetic
  • Instruction Sets and Pipelining

Next Lesson: Day 2 – Operating System Overview.