Docsity

Computer Systems Introduction, Study notes of Computer Science

Toggle sidebar
bg1
1.1 IntroductIon to computer SyStem
A computer is an electronic device that can be
programmed to accept data (input), process it and
generate result (output). A computer along with
additional hardware and software together is called a
computer system.
A computer system primarily comprises a central
processing unit (CPU), memory, input/output devices
and storage devices. All these components function
together as a single unit to deliver the desired output.
A computer system comes in various forms and sizes.
It can vary from a high-end server to personal desktop,
laptop, tablet computer, or a smartphone.
Figure 1.1 shows the block diagram of a computer
system. The directed lines represent the flow of data
and signal between the components.
1.1.1 Central Processing Unit (CPU)
It is the electronic circuitry of a computer that carries
out the actual processing and usually referred as the
brain of the computer. It is commonly called processor
also. Physically, a CPU can be placed on one or more
microchips called integrated circuits (IC). The ICs
comprise semiconductor materials.
“A computer would deserve
to be called intelligent if it
could deceive a human into
believing that it was human.”
–Alan Turing
Chapter 1
Computer System
In this chapter
»Introduction to
Computer System
»Evolution of
Computer
»Computer Memory
»Data Transfer
between Memory
and CPU
»Data and
Information
»Microprocessors
»Software
»Operating System
Figure 1.1: Components of a computer system
Secondary
Storage Devices
Input
Device Control Unit
(CU)
Arithmetic Logic
Unit (ALU)
Primary
Memory
Output
Device
Central Processing
Unit (CPU)
Ch 1.indd 1 08-Apr-19 11:36:15 AM
2024-25
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Computer Systems Introduction and more Study notes Computer Science in PDF only on Docsity!

1.1 IntroductIon to computer SyStem

A computer is an electronic device that can be programmed to accept data (input), process it and generate result (output). A computer along with additional hardware and software together is called a computer system. A computer system primarily comprises a central processing unit (CPU), memory, input/output devices and storage devices. All these components function together as a single unit to deliver the desired output. A computer system comes in various forms and sizes. It can vary from a high-end server to personal desktop, laptop, tablet computer, or a smartphone. Figure 1.1 shows the block diagram of a computer system. The directed lines represent the flow of data and signal between the components.

1.1.1 Central Processing Unit (CPU)

It is the electronic circuitry of a computer that carries out the actual processing and usually referred as the brain of the computer. It is commonly called processor also. Physically, a CPU can be placed on one or more microchips called integrated circuits (IC). The ICs comprise semiconductor materials.

“A computer would deserve

to be called intelligent if it

could deceive a human into

believing that it was human.”

–Alan Turing

Chapter 1

Computer System

In this chapter » Introduction to Computer System » Evolution of Computer » Computer Memory » Data Transfer between Memory and CPU » Data and Information » Microprocessors » Software » Operating System

Figure 1.1: Components of a computer system

Secondary Storage Devices

Input Device Control Unit(CU)

Arithmetic Logic Unit (ALU)

Primary Memory

Output Device

Central Processing Unit (CPU)

(^2) Computer SCienCe – ClaSS xi

The CPU is given instructions and data through programs. The CPU then fetches the program and data from the memory and performs arithmetic and logic operations as per the given instructions and stores the result back to memory. While processing, the CPU stores the data as well as instructions in its local memory called registers. Registers are part of the CPU chip and they are limited in size and number. Different registers are used for storing data, instructions or intermediate results. Other than the registers, the CPU has two main components — Arithmetic Logic Unit (ALU) and Control Unit (CU). ALU performs all the arithmetic and logic operations that need to be done as per the instruction in a program. CU controls sequential instruction execution, interprets instructions and guides data flow through the computer’s memory, ALU and input or output devices. CPU is also popularly known as microprocessor. We will study more about it in section 1.5.

1.1.2 Input Devices The devices through which control signals are sent to a computer are termed as input devices. These devices convert the input data into a digital form that is acceptable by the computer system. Some examples of input devices include keyboard, mouse, scanner, touch screen, etc., as shown in Figure 1.2. Specially designed braille keyboards are also available to help the visually impaired for entering data into a computer. Besides, we can now enter data through voice, for example, we can use Google voice search to search the web where we can input the search string through our voice. Data entered through input device is temporarily stored in the main memory (also called RAM) of the computer system. For permanent storage and future use, the data as well as instructions are stored permanently in additional storage locations called secondary memory. 1.1.3 Output Devices The device that receives data from a computer system for display, physical production, etc., is called output device. It converts digital information into human- understandable form. For example, monitor, projector, headphone, speaker, printer, etc. Some output devices

Figure 1.2: Input devices

Scanner

Touch Screen

Keyboard

Mouse

Figure 1.3: Output devices

Speaker

Printer

3D printer

Display monitor

(^4) Computer SCienCe – ClaSS xi

The Von Neumann architecture is shown in Figure 1.5. It consists of a Central Processing Unit (CPU) for processing arithmetic and logical instructions, a memory to store data and programs, input and output devices and communication channels to send or receive the output data. Electronic Numerical Integrator and Computer (ENIAC) is the first binary programmable computer based on Von Neumann architecture. During the 1970s, Large Scale Integration (LSI) of electronic circuits allowed integration of complete CPU on a single chip, called microprocessor. Moore’s Law predicted exponential growth in the number of transistors that could be assembled in a single microchip. In 1980s, the processing power of computers increased exponentially by integrating around 3 million components on a small-sized chip termed as Very Large Scale Integration (VLSI). Further advancement in technology has made it feasible to fabricate high density of transistors and other components (approx 106 components) on a single IC called Super Large Scale Integration (SLSI) as shown in Figure 1.6. IBM introduced its first personal computer (PC) for the home user in 1981 and Apple introduced Macintosh

Figure 1.5: Von Neumann architecture for the computer

10,000,000, 1,000,000, 100,000, 10,000, 1,000, 100, 10, 1, 100 10 1

Intel Microprocessors

Doubles every 2 years

Invention of the Transistor 4004

8086

286

386

486486

Pentium II (^) Pentium IIIPentium IV

Core 2 DUO Core i

Pentium

Number of Transistorsper Integrated Circuit

Figure 1.6: Exponential increase in number of transistors used in ICs over time

In 1965, Intel co- founder Gordon Moore introduced Moore’s Law which predicted that the number of transistors on a chip would double every two years while the costs would be halved.

Computer SyStem 5

machines in 1984. The popularity of the PC surged by the introduction of Graphical User Interface (GUI) based operating systems by Microsoft and others in place of computers with only command line interface, like UNIX or DOS. Around 1990s, the growth of World Wide Web (WWW) further accelerated mass usage of computers and thereafter computers have become an indispensable part of everyday life. Further, with the introduction of laptops, personal computing was made portable to a great extent. This was followed by smartphones, tablets and other personal digital assistants. These devices have leveraged the technological advancements in processor miniaturisation, faster memory, high speed data and connectivity mechanisms. The next wave of computing devices includes the wearable gadgets, such as smart watch, lenses, headbands, headphones, etc. Further, smart appliances are becoming a part of the Internet of Things (IoT), by leveraging the power of Artificial Intelligence (AI).

1.3 computer memory

A computer system needs memory to store the data and instructions for processing. Whenever we talk about the ‘memory’ of a computer system, we usually talk about the main or primary memory. The secondary memory (also called storage device) is used to store data, instructions and results permanently for future use.

1.3.1 Units of Memory A computer system uses binary numbers to store and process data. The binary digits 0 and 1, which are the basic units of memory, are called bits. Further, these bits are grouped together to form words. A 4-bit word is called a Nibble. Examples of nibble are 1001, 1010, 0010, etc. A two nibble word, i.e., 8-bit word is called a byte, for example, 01000110, 01111100, 10000001, etc. Like any other standard unit, bytes are grouped together to make bigger chunks or units of memory. Table 1.1 shows different measurement units for digital data stored in storage devices.

Computer SyStem 7

may have to slow down. To speed up the operations of the CPU, a very high speed memory is placed between the CPU and the primary memory known as cache. It stores the copies of the data from frequently accessed primary memory locations, thus, reducing the average time required to access data from primary memory. When the CPU needs some data, it first examines the cache. In case the requirement is met, it is read from the cache, otherwise the primary memory is accessed.

(C) Secondary Memory Primary memory has limited storage capacity and is either volatile (RAM) or read-only (ROM). Thus, a computer system needs auxiliary or secondary memory to permanently store the data or instructions for future use. The secondary memory is non-volatile and has larger storage capacity than primary memory. It is slower and cheaper than the main memory. But, it cannot be accessed directly by the CPU. Contents of secondary storage need to be first brought into the main memory for the CPU to access. Examples of secondary memory devices include Hard Disk Drive (HDD), CD/ DVD, Memory Card, etc., as shown in Figure 1.7. However, these days, there are secondary storage devices like SSD which support very fast data transfer speed as compared to earlier HDDs. Also, data transfer between computers have become easier and simple due to the availability of small-sized and portable flash or pen drives.

1.4 data tranSfer between memory and cpu

Data need to be transferred between the CPU and primary memory as well as between the primary and secondary memory. Data are transferred between different components of a computer system using physical wires called bus. For example, bus is used for data transfer between a USB port and hard disk or between a hard disk and main memory. Bus is of three types — (i) Data bus to transfer data between different components, (ii) Address bus to transfer addresses between CPU and main memory. The address of the memory location that the CPU wants to read or write from is specified in the address bus,

Figure 1.7: Storage devices

Pen Drive

CD/DVD

(^8) Computer SCienCe – ClaSS xi

and (iii) Control bus to communicate control signals between different components of a computer. All these three buses collectively make the system bus, as shown in Figure 1.8. As the CPU interacts directly with main memory, any data entered from input device or the data to be accessed from hard disk needs to be placed in the main memory for further processing. The data is then transferred between CPU and main memory using bus. The CPU places on the address bus, the address of the main memory location from which it wants to read data or to write data. While executing the instructions, the CPU specifies the read or write control signal through the control bus. As the CPU may require to read data from main memory or write data to main memory, a data bus is bidirectional. But the control bus and address bus are unidirectional. To write data into memory, the CPU places the data on the data bus, which is then written to the specific address provided through the address bus. In case of read operation, the CPU specifies the address, and the data is placed on the data bus by a dedicated hardware, called memory controller. The memory controller manages the flow of data into and out of the computer's main memory.

1.5 mIcroproceSSorS

In earlier days, a computer's CPU used to occupy a large room or multiple cabinets. However, with advancement in technology, the physical size of CPU has reduced and it is now possible to place a CPU on a single microchip only. A processor (CPU) which is implemented on a single microchip is called microprocessor. Nowadays, almost all the CPUs are microprocessors. Hence, the terms are used synonymously for practical purpose. Microprocessor is a small-sized electronic component inside a computer that carries out various tasks involved in data processing as well as arithmetic and logical operations. These days, a microprocessor is built over an integrated circuit comprising millions of small components like resistors, transistors and diodes.

Figure 1.8: Data transfer between components through system bus

(^10) Computer SCienCe – ClaSS xi

clock inside a computer. The clock speed indicates the speed at which the computer can execute instructions. Earlier, it was measured in Hertz (Hz) and Kilohertz (kHz). But with advancement in technology and chip density, it is now measured in Gigahertz (GHz), i.e., billions of pulses per second. (D) Cores Core is a basic computation unit of the CPU. Earlier processors had only one computation unit, thereby capable of performing only one task at a time. With the advent of multicore processor, it has become possible for the computer to execute multiple tasks, thereby increasing the system’s performance. CPU with two, four, and eight cores is called dual-core, quad-core and octa-core processor, respectively. 1.5.2 Microcontrollers The microcontroller is a small computing device which has a CPU, a fixed amount of RAM, ROM and other peripherals all embedded on a single chip as compared to microprocessor that has only a CPU on the chip. The structure of a microcontroller is shown in Figure 1.9. Keyboard, mouse, washing machine, digital camera, pendrive, remote controller, microwave are few examples of microcontrollers. As these are designed for specific tasks only, hence their size as well as cost is reduced. Because of the very small size of the microcontroller, it is embedded in another device or system to perform a specific functionality. For example, the microcontroller in a fully automatic washing machine is used to control the washing cycle without any human intervention. The cycle starts with the filling of water, after which the clothes are soaked and washed; thereafter the water is drained and the clothes are spin dry. The simple use of microcontroller has permitted repetitive execution of tedious tasks automatically without any human intervention, thereby saving precious time.

1.6 data and InformatIon

A computer is primarily for processing data. A computer system considers everything as data, be it instructions, pictures, songs, videos, documents, etc. Data can also be

Figure 1.9: Structure of microcontroller

Clock CPU (^) Memory

Bus System

Input Output I/O-ports

Activity 1.

Find out the clock speed of the microprocessor of your computer and compare with that of your peers?

Computer SyStem 11

raw and unorganised facts that are processed to get meaningful information. So understanding the concept of data along with its different types is crucial to understand the overall functioning of a computer. Sometimes people use the terms data, information and knowledge interchangeably, which is incorrect.

1.6.1 Data and Its Types

A computer system has many input devices, which provide it with raw data in the form of facts, concepts, instructions, etc., Internally everything is stored in binary form (0 and 1), but externally, data can be input to a computer in the text form consisting of English alphabets A–Z, a–z, numerals 0 – 9, and special symbols like @, #, etc. Data can be input in other languages too or it can be read from the files. The input data may be from different sources, hence it may be in different formats. For example, an image is a collection of Red, Green, Blue (RGB) pixels, a video is made up of frames, and a fee receipt is made of numeric and non-numeric characters. Primarily, there are three types of data.

(A) Structured Data Data which follows a strict record structure and is easy to comprehend is called structured data. Such data with pre-specified tabular format may be stored in a data file to access in the future. Table 1.3 shows structured data related to monthly attendance of students maintained by the school.

Table 1.3 Structured data: Monthly attendance records of students Roll No Name Month Attendance (in %) R1 Mohan May 95 R2 Sohan May 75 R3 Sheen May 92 R4 Geet May 82 R5 Anita May 97 R1 Mohan July 98 R2 Sohan July 65 R3 Sheen July 85 R4 Geet July 94 R5 Anita July 85

Computer SyStem 13

1.6.2 Data Capturing, Storage and Retrieval

To process data, we need to first input or capture the data. This is followed by its storage in a file or a database so that it can be used in the future. Whenever data is to be processed, it is first retrieved from the file or database so that we can perform further actions on it.

(A) Data Capturing It involves the process of gathering data from different sources in the digital form. This capturing may vary from simple instruments like keyboard, barcode readers used at shopping outlets (Figure 1.12), comments or posts over social media, remote sensors on an earth orbiting satellite, etc. Sometimes, heterogeneity among data sources makes data capturing a complex task.

(B) Data Storage It is the process of storing the captured data for processing later. Now-a-days data is being produced at a very high rate, and therefore data storage has become a challenging task. However, the decrease in the cost of digital storage devices has helped in simplifying this task. There are numerous digital storage devices available in the market like as shown in Figure 1.7. Data keeps on increasing with time. Hence, the storage devices also require to be upgraded periodically. In large organisations, computers with larger and faster storage called data servers are deployed to store vast amount of data. Such dedicated computers help in processing data efficiently. However, the cost (both hardware and software) of setting up a data server as well as its maintenance is high, especially for small organisations and startups.

(C) Data Retrieval It involves fetching data from the storage devices, for its processing as per the user requirement. As databases grow, the challenges involved in search and retrieval of the data in acceptable time, also increase. Minimising data access time is crucial for faster data processing.

1.6.3 Data Deletion and Recovery

One of the biggest threats associated with digital data is its deletion. The storage devices can malfunction or crash down resulting in the deletion of data stored. Users can

Figure 1.12: Capturing data using barcode reader

Activity 1. Visit some of the places like bank, automobile showroom, shopping mall, tehsil office, etc., and find out 2 – 3 names of tools or instruments used to capture data in digital format.

(^14) Computer SCienCe – ClaSS xi

accidentally erase data from storage devices, or a hacker or malware can delete the digital data intentionally. Deleting digitally stored data means changing the details of data at bit level, which can be very time- consuming. Therefore, when any data is simply deleted, its address entry is marked as free, and that much space is shown as empty to the user, without actually deleting the data. In case data gets deleted accidentally or corrupted, there arises a need to recover the data. Recovery of the data is possible only if the contents or memory space marked as deleted have not been overwritten by some other data. Data recovery is a process of retrieving deleted, corrupted and lost data from secondary storage devices. There are usually two security concerns associated with data. One is its deletion by some unauthorised person or software. These concerns can be avoided by limiting access to the computer system and using passwords for user accounts and files, wherever possible. There is also an option of encrypting files to protect them from unwanted modification. The other concern is related to unwanted recovery of data by unauthorised user or software. Many a times, we discard our old, broken or malfunctioning storage devices without taking care to delete data. We assume that the contents of deleted files are permanently removed. However, if these storage devices fall into the hands of mischief-mongers, they can easily recover data from such devices; this poses a threat to data confidentiality. This concern can be mitigated by using proper tools to delete or shred data before disposing off any old or faulty storage device.

1.7 S oftware

Till now, we have studied about the physical components or the hardware of the computer system. But the hardware is of no use on its own. Hardware needs to be operated by a set of instructions. These sets of instructions are referred to as software. It is that component of a computer system, which we cannot

Activity 1. Explore possible ways of recovering deleted data or data from a corrupted device.

Activity 1.

Create a test file and then delete it using Shift+Delete from the keyboard. Now recover the file using the methods you have explored in Activity 1.4.

(^16) Computer SCienCe – ClaSS xi

access and security to the users of the system. Some of the popular operating systems are Windows, Linux, Macintosh, Ubuntu, Fedora, Android, iOS, etc. (B) System Utilities Software used for maintenance and configuration of the computer system is called system utility. Some system utilities are shipped with the operating system for example disk defragmentation tool, formatting utility, system restore utility, etc. Another set of utilities are those which are not shipped with the operating system but are required to improve the performance of the system, for example, anti-virus software, disk cleaner tool, disk compression software, etc. (C) Device Drivers As the name signifies, the purpose of a device driver is to ensure proper functioning of a particular device. When it comes to the overall working of a computer system, the operating system does the work. But everyday new devices and components are being added to a computer system. It is not possible for the operating system alone to operate all of the existing and new devices, where each device has diverse characteristics. The responsibility for overall control, operation and management of a particular device at the hardware level is delegated to its device driver. The device driver acts as an interface between the device and the operating system. It provides required services by hiding the details of operations performed at the hardware level of the device. Just like a language translator, a device driver acts as a mediator between the operating system and the attached device. The categorisation of software is shown in Figure 1.13.

1.7.3 Programming Tools In order to get some work done by the computer, we need to give instructions which are applied on the input data to get the desired outcome. Computer languages are developed Figure 1.13: Categorisation of software for writing these instructions.

Activity 1.

Ask your teacher to help you locate any two device drivers installed on your computer.

Computer SyStem 17

It is important to understand here that computers and humans understand completely different languages. While humans are able to write programs in high-level language, computers understand machine language. There is a continuous need for conversion from high level to machine level language, for which translators are needed. Also, to write the instruction, code editors (e.g., IDLE in Python) are needed. We will briefly describe here the programming languages, language translators and program development tools.

(A) Classification of Programming Languages It is very difficult for a human being to write instructions in the form of 1s and 0s. So different types of computer programming languages are developed to simplify the coding. Two major categories of computer programming languages are low-level languages and high-level languages. Low-level languages are machine dependent languages and include machine language and assembly language. Machine language uses 1s and 0s to write instructions which are directly understood and executed by the computer. But writing a code in machine language is difficult as one has to remember all operation codes and machine addresses. Also finding errors in the code written in machine language is difficult. To simplify the writing of code, assembly language was developed that allowed usage of English-like words and symbols instead of 1s and 0s. But one major drawback of writing a code in this language is that the code is computer specific, i.e., the code written for one type of CPU cannot be used for another type of CPU. High level languages are machine independent and are simpler to write code into. Instructions are using English like sentences and each high level language follows a set of rules, similar to natural languages. However, these languages are not directly understood by the computer. Hence, translators are needed to translate high-level language codes into machine language. Examples of high level language include C++, Java, Python, etc.

(B) Language Translators As the computer can understand only machine language, a translator is needed to convert program written in assembly or high level language to machine

noteS

Computer SyStem 19

1.7.4 Application Software

The system software provides the core functionality of the computer system. However, different users need the computer system for different purposes depending upon their requirements. Hence, a new category of software is needed to cater to different requirements of the end- users. This specific software that works on top of the system software is termed as application software. There are again two broad categories of application software — general purpose and customised application software.

(A) General Purpose Software The application software developed for generic applications, to cater to a bigger audience in general are called general purpose software. Such ready-made application software can be used by end users as per their requirements. For example, spreadsheet tool Calc of LibreOffice can be used by any computer user to do calculation or to create account sheet. Adobe Photoshop, GIMP, Mozilla web browser, iTunes, etc., fall in the category of general purpose software.

(B) Customised Software These are custom or tailor-made application software, that are developed to meet the requirements of a specific organisation or an individual. They are better suited to the needs of an individual or an organisation, considering that they are designed as per special requirements. Some examples of user-defined software include websites, school management software, accounting software, etc. It is similar to buying a piece of cloth and getting a tailor-made garment with the fitting, colour, and fabric of our choice.

1.7.5 Proprietary or Free and Open Source Software

The developers of some application software provide their source code as well as the software freely to the public, with an aim to develop and improve further with each other’s help. Such software is known as Free and Open Source Software (FOSS). For example, the source code of operating system Ubuntu is freely accessible for anyone with the required knowledge to improve or add new functionality. More examples of FOSS include Python, Libreoffice, Openoffice, Mozilla Firefox, etc. Sometimes, software are freely available for use but

A computer system can work without application software, but it cannot work without system software. For example, we can use a computer even if no word processing software is installed, but if no operating system is installed, we cannot work on the computer. In other words, the use of computer is possible in the absence of application software.

Activity 1. With the help of your teacher, install one free and open source application software on your computer.

Activity 1. With the help of your teacher, install one application software in your computer.

(^20) Computer SCienCe – ClaSS xi

source code may not be available. Such software are called freeware. Examples of freeware are Skype, Adobe Reader, etc. When the software to be used has to be purchased from the vendor who has the copyright of the software, then it is a proprietary software. Examples of proprietary software include Microsoft Windows, Tally, Quickheal, etc. A software can be freeware or open source or proprietary software depending upon the terms and conditions of the person or group who has developed and released that software.

1.8 operatIng SyStem

An operating system (OS) can be considered to be a resource manager which manages all the resources of a computer, i.e., its hardware including CPU, RAM, Disk, Network and other input-output devices. It also controls various application software and device drivers, manages system security and handles access by different users. It is the most important system software. Examples of popular OS are Windows, Linux, Android, Macintosh and so on. The primary objectives of an operating system are two-fold. The first is to provide services for building and running application programs. When an application program needs to be run, it is the operating system which loads that program into memory and allocates it to the CPU for execution. When multiple application programs need to be run, the operating system decides the order of the execution. The second objective of an operating system is to provide an interface to the user through which the user can interact with the computer. A user interface is a software component which is a part of the operating system and whose job is to take commands or inputs from a user for the operating system to process. 1.8.1 OS User Interface There are different types of user interfaces each of which provides a different functionality. Some commonly used interfaces are shown in Figure 1.15. (A) Command-based Interface Command-based interface requires a user to enter the commands to perform different tasks like creating,

Figure 1.15: Types of user interface of OS

When a computer is turned on, who brings the OS into RAM from the secondary storage?

Think and Reflect

Command-based Interface

Graphical User Interface

Types of User Interface of Operating System

Touch-based Interface

Voice-based Interface

Gesture-based Interface