• No results found

Components of a Computer


Academic year: 2022

Share "Components of a Computer"


Loading.... (view fulltext now)

Full text


DCP- 01



• A computer is an automatic, electronic and programmable device that can instruct hardware to carry out arbitrary sequences of arithmetic, logical and other operations in order to convert given input into desired output. It has ability to store, retrieve and process data. It usually consists of input, output, storage, CPU (arithmetic logic unit (ALU) and control unit (CU).


Basic Functions of Computer


Components of a Computer


Computer Hardware

• Physical components of a computer, such as CPU, Memory, Input and Output devices, Auxiliary storage devices.

• The hardware components include devices that perform the functions of accepting input, processing, data storage and generating output.

• Hardware is directed by the software to execute any instruction.


Central Processing Unit (CPU)

Control Unit

• This unit controls the operations of all parts of the computer but does not carry out any actual data processing operations.

• It is responsible for controlling the transfer of data and instructions among other units of a computer.

• It obtains the instructions from the memory, interprets them, and directs the operation of the computer.

• It communicates with Input / Output devices for transfer of data or results from storage.


Arithmetic/logic unit (ALU):

Arithmetic operations: It performs arithmetic operations like addition, subtraction, multiplication, and division. All complex operations are done by making repetitive use of the above operations.

Logic Operations: It also performs logical functions like comparing, selecting, and merging of data.


Input Device

• In computing, an input device is hardware equipment used to accept data and control signals from a user/device.

This unit contains devices with the help of which we enter data into the computer.

This unit creates a link between the user and the computer.

The input devices translate the information into a form understandable by the computer


Input Devices



Joy Stick

Light pen

Digitizer or Graphic Tablet

Track Ball



Magnetic Ink Card Reader (MICR)

Optical Character Reader (OCR)

Bar Code Reader

Optical Mark Reader (OMR)


Input Devices


Output Devices

An output device consists of devices with the help of which we get the information from the computer.

This unit is a link between the computer and the users.

Output devices translate the computer's output into a form understandable by the users.




Output Devices


Memory Unit

Computer memory is any physical device capable of storing information temporarily or permanently.

Primary memory

Secondary memory


Primary memory

Every computer has a temporary storage built into the computer hardware

It stores instructions and data of a program mainly when the program is being executed by the CPU.

This temporary storage is known as main memory, primary storage, or simply memory


Random Access Memory (RAM)

Primary storage of a computer is often referred to as RAM because of its random access


RAM chips are volatile memory

A computer‟s motherboard is designed in a manner that the memory capacity can be enhanced by adding more memory chips


Read Only Memory (ROM)

ROM a non-volatile memory chip

Data stored in a ROM can only be read and used – they cannot be changed

ROMs are mainly used to store programs and data, which do not change and are frequently used. For example, system boot program


Types of ROMs

Manufacturer-programmed- Data is burnt by the manufacturer of the electronic equipment in which it is used.

User-programmed/programmable (PROM)- The user can load and store “read-only” programs and data in it.

Erasable PROM (EPROM)- The user can erase information stored in it and the chip can be reprogrammed to store new information

Ultra Violet EPROM (UVEPROM)- A type of EPROM chip in which the stored information is erased by exposing the chip for some time to ultra-violet light

Electrically EPROM (EEPROM) or Flash memory- A type of EPROM chip in which the stored information is erased by using high voltage electric pulses


Cache Memory

It is commonly used for minimizing the memory-processor speed mismatch.

It is an extremely fast, small memory between CPU and main memory whose access time is closer to the processing speed of the CPU.

It is used to temporarily store very active data and instructions during processing


Secondary Memory

Used in a computer system to overcome the limitations of primary storage

Has virtually unlimited capacity because the cost of storage is very low

Has an operating speed far slower than that of the primary storage

Used to store large volumes of data on a permanent basis

Also known as auxiliary memory


Secondary Memory



• Software is a set of programs, designed to perform a well-defined function.

• A program is a sequence of instructions written to solve a particular problem.

• There are two types of software -

• System Software

• Application Software


System Software

• The system software is a collection of programs designed to operate, control, and extend the processing capabilities of the computer itself.

• System software is generally prepared by the computer manufacturers.

• These software products comprise of programs written in low-level languages, which interact with the hardware at a very basic level.


System Software

• System software serves as the interface between the hardware and the end users.

• Some examples of system software are Operating Systems, Compilers etc.


Features of a system software

• Close to the system

• Fast in speed

• Difficult to design

• Difficult to understand

• Less interactive

• Difficult to manipulate

• Generally written in low-level language


Application software

• Application software products are designed to satisfy a particular need of a particular environment.

• All software applications prepared in the computer lab can come under the category of Application software.

• Application software may consist of a single program, or may also consist of a collection of programs, often called a software package, which work

together to accomplish a task.


Application software

• Application software may consist of a single program, or may also consist of a collection of programs, often called a software package, which work together to accomplish a task.


Features of an application software

• Close to the user

• Easy to design

• More interactive

• Slow in speed

• Generally written in high-level language

• Easy to understand

• Easy to manipulate and use

• Bigger in size and requires large storage space


Utility Programs

• A system software designed to help analyse, configure, optimize

or maintain a computer. It is used to support the computer

infrastructure in contrast to application software, which is

aimed at directly performing tasks that benefit ordinary users.


Utility Programs

1. Hardware Utilities: Hardware utilities can check the status of all parts of the PC, including hard disks, memory, modems, speakers and printers.

2. Security utilities: These software can constantly monitor and protect the computer. Anti virus and anti spyware software comes in this category.

3. File-Compression Utilities: These utilities can reduce the amount of disk space required to store a file or reduce the time it takes to transfer a file over the internet. Zip file, MP3 files comes in this category.


Applications of Computer/IT


Applications of Computer/IT


Applications of Computer/IT


Applications of Computer/IT


Applications of Computer/IT


History and Evolution of computers

• Charles Babbage, originated the concept of a programmable computer.

• he invented the first mechanical computer in the early 19th century called difference engine.

• in 1833, he designed more general design called Analytical Engine, was possible. The input of programs and data was to be provided to the

machine via punched cards.

• By 1938 the United States Navy developed an electromechanical analog computer.

• Early digital computers were electromechanical which used vacuum tubes.


History and Evolution of computers

• Compared to vacuum tubes, transistors have many advantages: they are smaller, and require less power than vacuum tubes, so give off less heat.

• The next great advance in computing power came with the advent of the integrated circuit.

• With the continued miniaturization of computing resources, and advancements in portable battery life, portable computers grew in popularity in the 2000s, leading to the development

of smartphones and tablets.


Generation of computers

First Generation

• The period of first generation: 1940-1959. Vacuum tube based.

• used vacuum tubes for circuitry and magnetic drums for memory.

• relied on machine language.

• Input was based on punched cards and paper tape, and output was displayed on printouts.


Generation of computers

Second Generation

• The period of second generation: 1959-1965. Transistor based.

• moved from cryptic binary machine language to symbolic, or assembly, languages.

• High-level programming languages were also being developed at this time, such as early versions of COBOL and FORTRAN.

• still relied on punched cards for input and printouts for output.


Generation of computers

Third Generation

• The period of third generation: 1965-1971. Integrated Circuit based.

• Instead of punched cards and printouts, users interacted with third

generation computers through keyboards and monitors and interfaced with an operating system.


Generation of computers

Fourth Generation

• The period of fourth generation: 1971-1980. VLSI(Very-large-scale integration) microprocessor based.

• The microprocessor brought the fourth generation of computers, as thousands of integrated circuits were built onto a single silicon chip

• Computers could be linked together to form networks, which eventually led to the development of the Internet.

• Fourth generation computers also saw the development of GUIs, the mouse.


Generation of computers

Fifth Generation

• The period of fifth generation: 1980-onwards. ULSI microprocessor based.

• used ULSI (Ultra Large Scale Integration) technology, resulting in the production of microprocessor chips having ten million electronic


• Artificial intelligence and parallel processing are the primary characteristics of this generation.


Types of Computer

Computers can be generally classified by size and power as follows, though there is considerable overlap:

Personal computer: A small, single-user computer based on a microprocessor.

Workstation: A powerful, single-user computer. A workstation is like a personal

computer, but it has a more powerful microprocessor and, in general, a higher-quality monitor.

Minicomputer: A multi-user computer capable of supporting up to hundreds of users simultaneously.

Mainframe: A powerful multi-user computer capable of supporting many hundreds or thousands of users simultaneously.

Supercomputer: An extremely fast computer that can perform hundreds of millions of instructions per second.


Number System

• A number system is a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner.

• The number system can be seen as the context that allows the symbols "11" to be interpreted as the binary symbol for three, the decimal symbol

for eleven,....

• The number system consists of


Set of digits (From 0 to Base-1)

Representation for a set of numbers (e.g. all integers)

Unique representation to every number in the set



Types of Number System

• Non-Positional number system

• Positional number system



Non-Positional Number System

• Symbol represents the value regardless of its position.

• Difficult to perform arithmetic operation.

• For example:-





Positional Number System

• Symbols (Digits) represent different values depending upon the position.

• The values of each digit is determined by:-

• Digit itself

• Position of the digit

• Base of the number system


48 6

Continuing with our example…

642 in base 10 positional notation is:

6 x 10


= 6 x 100 = 600 + 4 x 10


= 4 x 10 = 40

+ 2 x 10º = 2 x 1 = 2 = 642 in base 10

This number is in base 10

The power indicates the position of

the number

Positional Number System



Decimal Number System

The base is equal to 10

Uses 10 different symbols.

For example:

(2*1000) + (5*100) + (8*10) + (6*1)

=2000 + 500 + 80 + 6




Binary Number System

• Binary digit 0 or 1

• The base is 2.

• Each position represents a power of the base 2.

Example:-Conversion from 00111101 to decimal is-



Conversion of decimal representation to binary

Divide decimal number to base 2 and Take remainders in reverse order. Example : Convert 3610 to binary number

(36)10 = (100100)2

2 36 2 18

2 9

2 4

2 2

2 1


Remainder 0

0 1 0 0 1

Least Significant Bit (LSB)

Most significant Bit (MSB)



24 23 22 21 20

16 8 4 2 1

1 1 0 1 0






= 16 + 8 + 0 + 2 + 0

= 26

Conversion of binary representation to decimal

• Covert (11010)


to decimal



Octal Number System

The base is 8

The digits are 0-7

Each position represents a power of the base 8.

For example:- decimal equivalent to the octal number 421 is 273



Converting Decimal to Octal



= (?)




= (3 7 0 4)


8 1988 Remainder

8 248 4

8 31 0

8 3 7

0 3





= (?)


6 x 8


= 6 x 64 = 384 + 4 x 8


= 4 x 8 = 32 + 2 x 8º = 2 x 1 = 2

Sum = (418)



Converting Octal to Decimal



Hexadecimal Number System

The base is 16

digit symbols in base 16 are 0,1,2,3,4,5,6,7,8,9,


Each position represents a

power of the base 2.


57 21

Converting Decimal to Hexadecimal





= (?)


D x 16


= 13 x 256 = 3328 + E x 16


= 14 x 16 = 224 + F x 16º = 15 x 1 = 15

Sum = (3567)


Converting Hexadecimal to Decimal


Shortcut Method for Converting a Binary

Number to its Equivalent Octal Number


Shortcut Method for Converting an Octal

Number to Its Equivalent Binary Number


Shortcut Method for Converting a Binary

Number to its Equivalent Hexadecimal Number


Shortcut Method for Converting a Hexadecimal

Number to its Equivalent Binary Number



Q.1- (EF)


+ (27)


= (?)




= E x 16


+ F x 16º

= 14 x 16 + 15 x 1

= 224 + 15 = (239)




= 2 x 8


+ 7x8º = 16 + 7 = 23 (EF)


+ (27)


= (239)


+ (23)


= (262)


= (523)


Q.2- (C2D51)


+ (27655)


= (?)


Some Problems


Data Representation

Computer Codes:

• Computer codes are used for internal representation of data in computers.

• As computers use binary numbers for internal data representation, computer codes use binary coding schemes.

• In binary coding, every symbol that appears in the data is represented by a group of bits (usually called byte).

• Commonly used computer codes are BCD, EBCDIC, and ASCII



• BCD stands for Binary Coded Decimal.

• It is one of the early computer codes.

• It uses 6 bits to represent a symbol.

• It can represent 64 different characters.


Coding of Alphabetic Characters in BCD


Coding of Numeric Characters in BCD


BCD Coding Scheme



• EBCDIC stands for Extended Binary Coded Decimal Interchange Code.

• It uses 8 bits to represent a symbol.

• It can represent 256 different characters.


Coding of Alphabetic Characters in



Coding of Numeric Characters in



EBCDIC Coding Scheme



• ASCII stands for American Standard Code for Information Interchange.

• ASCII is of two types – ASCII-7 and ASCII-8.

• ASCII-7 uses 7 bits to represent a symbol and can represent 128 different characters.

• ASCII-8 uses 8 bits to represent a symbol and can represent 256 different characters.

• First 128 characters in ASCII-7 and ASCII-8 are same.


Coding of Alphabetic Characters in ASCII


Coding of Alphabetic Characters in ASCII


Coding of Numeric Characters in ASCII


ASCII-7 Coding Scheme


ASCII-8 Coding Scheme


What is a Programming Language

 a language

 to communicate with the machine

 to perform some specific task

 have keywords

 follow certain rules


Why needed

• Is there any other better method to give instructions to computers ?

• Would you prefer to give instructions to machines in binary commands ?

• Machine language is difficult to understand.

• PL is an interface between humans and computers.


Why so many programming languages

• Available resources

• Different tools for different jobs

• Ruby and JavaScript are great for building web sites

• Java and C++ are often used for financial trading

• Python and R are good for data analytics.

• They evolve (New programming languages often learn from existing languages and add, remove and combine features in a new way.)

Developers have tastes (A programming language is a tool for humans to express ideas to computers. While we developers have many things in common, there is natural variety in the way our minds work. Ex- some like fliexibity of pointers & most of us don‟t like




The only language a computer can understand is machine language (strings of 0 and 1).

Binary opcodes are difficult to remember and it is hard to tell the difference between data and instructions.


Assembly language

each instruction is presented in more human-readable form.

If e9 represents addition instruction; „add‟ can be used in place of e9, called mnemonics.

But before executing, you have to convert assembly language into m/c language.

Assembly language is machine dependent & OS dependent.


High level PLs

This problem of machine dependency should be removed

Need for more expressivity and portability.

High-level programming languages came into picture to solve above-mentioned issues.


Classification of PLs

• Imperative

• Declarative

• functional

• object oriented

oStructured (Modular) oObject-oriented


Structured (Modular) Programming

• Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program.

• makes extensive use of the structured control flow constructs such as:

• selection (if/then/else)

• repetition (while and for)

• block structures

• subroutines (functions)


Subroutines (Functions)

• A subroutine is a sequence of program instructions that perform a specific task, packaged as a unit.


• Decomposing a complex programming task into simpler steps.

• Reducing duplicate code within a program.

• Enabling reuse of code across multiple programs.

• Hiding implementation details from users of the subroutine.


Advantages of Structured Programming

• Structured programs are easier to read and understand.

• Structured programs are easier to maintain.

• They require less effort and time for development.

• They are amenable to easier debugging and usually fewer errors are made in the course of writing such programs.


Disadvantages of Structured Programming

• Structured programming is not very suitable for the development of large programs.

• and does not allow much reusability code.

• does not support object-oriented concepts.


Object Oriented Programming (OOP)

• Object Oriented Programming (OOP) uses object oriented constructs or programming in an environment where some object oriented principles are followed.

• Object-oriented programming (OOP) is based on the concept of "objects", which may contain data, in the form of variables, often known as data

members; and code, in the form of methods, often known as member functions.


Concepts in OOP

Object : Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and


Class: blueprint/Collection of objects is called class.

Inheritance: When one object acquires all the properties and behaviours of parent object i.e. known as inheritance. It provides code reusability.


Concepts in OOP

Polymorphism: When one task is performed by different ways i.e. known as polymorphism. Function overloading and function overriding are the examples of polymorphism.

Abstraction: Hiding internal details and showing functionality is known as abstraction. In java, abstract class and interface provide abstraction.

Encapsulation: Binding (or wrapping) code and data together into a single unit is known as encapsulation. Class is the example of encapsulation.


Advantages of OOP

• OOPs makes development and maintenance easier where as in structured programming language, it is not easy to manage if code grows as project size grows.

• OOPs provides data hiding whereas in structured programming language a global data can be accessed from anywhere.

• OOPs provides ability to simulate real-world event much more effectively.


Language translators

• Computer understands only machine language.

• A programming language translator is the piece of software that translate a computer program written in some specific programming language into another programming language (Machine language).

• Example-

• Assembler

• Compiler

• Interpreter



• The assembler converts a program written in assembly language into machine code.

• An assembler works by assembling and converting the source code of assembly language into object code.

• An object file constitutes a stream of zeros and ones of machine code, which are directly executable by the processor.



• The compiler is a program that converts a program written into a high- level programming language into machine code.

• The process of converting high-level programming into machine language is known as compilation.

• Generates a file usually called object file which is read by machine.

• Scans the entire program and translates it as a whole into machine code.



• An interpreter is a program that converts program written in high-level language into machine code understood by the computer.

• Translates program one statement at a time.

• No intermediate object code is generated.


Related documents

Every Turing machine can be encoded as a string in {0, 1} ∗ Just encode the description of the machine (in binary).. Every string in {0, 1} ∗ is

Multiplication, Division, Binary Coded Decimal (BCD), 8421 Code, Digital Codes: Gray Code, Excess-3 Code & their conversion to Binary & vice versa, Alpha-Numeric Codes -

• In the process of converting data to information, a computer uses hardware and software.. At the simplest level, all computers consist of these two basic components; the hardware

Sources of Data, Scales of Measurement (Nominal, Ordinal, Interval, Ratio).. Tabulation and Descriptive Statistics: Frequencies - Deciles, Quartiles, Percentile,

Replace each octal digit by a 3-bit binary equivalent representation. OR Convert to

 Convert each octal digit to a 3-bit equivalent binary representation. Number

➢ Binary coded decimal means that each decimal digit, 0 through 9, is represented by a binary code of four bits.. ➢ The 8421 code is the predominant BCD code, and when we refer to

In this context it appears feasible to use the computer processing to indicate the effective- ness of a scientist's use of indexing terms and to produce retrieval aids such