Basic Computer Engineerinng Unit 1
Basic Computer Engineerinng Unit 1
(BT-205)
By
Prof.Radha Rashmi Tiwari
Introduction
Basic Computer Engineering s a subject for all who want to know the complete
information about the basics of computers. It covers the essentials of
computers from computer basics such as Computer Definition, Operating
System, Programming Languages, OOPS, C+ +, Data Structures, Database
Management System, Computer Networking to advanced topics such as
Internetworking Concepts, Devices, TCP / IP Model, Internet, World Wide
Web, Network Security & E-Commerce, Neural Networks and Computing
Ethics
Units
• Unit I: talks about the basic of computers and operating systems and also covers
the basics of MS Word, MS PowerPoint and MS Excel.
• Unit II: lays the foundation of programming by talking bout algorithms, OOP
basics, Introduction to C+, Complexity etc.
• Unit III: is dedicated to the discussion of core C++ concepts like classes, objects,
constructors, destructors, friend functions, inheritance, polymorphism and Virtual
functions. This unit also gives introduction to data structures.
• Unit IV: talks about computer networking and computer security basics.
• Unit V: talks about database management system and cloud computing.
Syllabus According to RGPV
UNIT I
Computer: Definition, Classification, Organization i.e. CPU, register, Bus
architecture, Instruction set, Memory & Storage Systems, I/O Devices, and
System & Application Software. Computer Application in eBusiness,
Bio-Informatics, health Care, Remote Sensing & GIS, Meteorology and
Climatology, Computer Gaming, Multimedia and Animation etc. Operating
System: Definition, Function, Types, Management of File, Process & Memory.
Introdcution to MS word, MS powerpoint, MS Excel
UNIT II
Introduction to Algorithms, Complexities and Flowchart, Introduction to
Programming, Categories of Programming Languages, Program Design,
Programming Paradigms, Characteristics or Concepts of OOP, Procedure
Oriented Programming VS object oriented Programming. Introduction to
C++: Character Set, Tokens, Precedence and Associativity, Program Structure,
Data Types, Variables, Operators, Expressions, Statements and control
structures, I/O operations, Array and Functions.
UNIT III
Object & Classes, Scope Resolution Operator, Constructors & Destructors,
Friend Functions, Inheritance, Polymorphism, Overloading Functions &
Operators, Types of Inheritance, Virtual functions. Introduction to Data
Structures.
UNIT IV
Computer Networking: Introduction, Goals, ISO-OSI Model, Functions of Different
Layers. Internetworking Concepts, Devices, TCP/IP Model. Introduction to Internet,
World Wide Web, E-commerce.
Computer Security Basics: Introduction to viruses, worms, malware, Trojans, Spyware
and Anti-Spyware Software, Different types of attacks like Money Laundering,
Information Theft, Cyber Pornography, Email spoofing, Denial of Service (DoS),
Cyber Stalking, ,Logic bombs, Hacking Spamming, Cyber Defamation , pharming
Security measures Firewall, Computer Ethics & Good Practices, Introduction of
Cyber Laws about Internet Fraud and Good Computer Security Habits.
UNIT V
Data base Management System: Introduction, File oriented approach and Database
approach, Data Models, Architecture of Database System, Data independence, Data
dictionary, DBA, Primary Key, Data definition language and Manipulation Languages.
Cloud computing: Definition, cloud infrastructure, cloud segments or service delivery
models (IaaS, PaaS and SaaS), cloud deployment models/ types of cloud (public,
private, community and hybrid clouds), Pros and Cons of cloud computing.
Recommended Text Books
1. Fundamentals of Computers : E Balagurusamy, TMH
2. Basic Computer Engineering: Silakari and Shukla, Wiley India
3. Fundamentals of Computers : V Rajaraman, PHI
4. Information Technology Principles and Application: Ajoy Kumar Ray &
Tinku Acharya PHI.
What is a Computer?
The term computer has taken from the computing. A computer can be defined
as an electronic device that takes data and instruction from the user as input
perform computing and give information as output to the user.
The electronic device is known as hardware & the set of instruction is known as
software.
Basic Computer Operation
1. INPUT: It accepts data and instruction through the input device.
2. PROCESS AND CONTROL: it performs the action as per the instruction
issued and process the given data.
3. STORAGE: it stores the data and instruction for future execution.
4. OUTPUT: it generates the desired output after executing the instruction
and processing the input data.
Advantages of Computer
ACCURACY: Computer performs complex and repetitive calculation with
accurate results.
MEMORY: Store large amount of data and information
USER-FRIENDLY: Provide information to the user in many different forms.
FAST: Perform fast execution or processing.
LESS MAN POWER: Manual requirement is less.
BEST RESULTS: Artificial intelligence, Decision-making best results.
Functional Components of a Computer
Input Unit
Computers need to receive data and instructions to solve any problem. The
input unit basically links the external world or environment to the computer
system. It consists of one or more input devices. The keyboard and mouse are
the most commonly used input devices.
Central Processing Unit (CPU)
Once the data and instructions are received from the input device, they are to
be processed in this unit. So it can be considered as the heart or brain of the
computer system
Memory Unit
The data and instructions required for processing have to be stored in the
memory unit before actual processing starts. Similarly, the results generated has
to be preserved before it is displayed. The memory unit thus provides space to
store input data, intermediate results and final output generated. eg: hard disks,
pen drives, floppy disks.
Output Unit
It is used to print or display the result obtained by the execution of a program.
Whenever the user wants output from the computer, the control unit sends a
signal to this unit to be ready to accept processed data from the memory and to
display it. Eg. Monitor, Printer, Speakers, etc.
CLASSIFICATION OF COMPUTER
Analog Computers
An analog computer is a form of computer that uses the continuously
changeable aspects of physical phenomena such as electrical, mechanical, or
hydraulic quantities to model the problem being solved.
Digital Computers
The digital computer works on discontinuous data. They convert the data into
digits (binary digits 0 and 1) and all operations are carried out on these digits at
extremely fast rates. A digital computer basically knows how to count the digits
and add the digits. Digital computers are much faster than an analog computer
and far more accurate.
Supercomputer
A supercomputer contains many CPUs which operate in parallel to make it
faster. They are used for massive data processing and solving very sophisticated
problems. They are used for weather forecasting, weapons research and
development, rocketing, aerodynamics, seismology, atomic, nuclear etc.
Mainframe Computers
Mainframe computers are very powerful, large general-purpose computers.
They are used where a large amount of data is to be processed or very complex
calculations are to be made and these tasks are beyond the computing capacity
of minicomputers. They are used in research organizations, large industries,
large business, and government organizations, bank, and airline reservations
where a large database is required
Microcomputers
A Microcomputer is a low-cost, small, digital computer. It contains the
microprocessor as its CPU, a memory unit, an input device, and an output
device. Microcomputers have a wide range of applications like general purpose
calculations, industrial control, home application; Microcomputers are also
called personal computers
Minicomputers
Minicomputers are general purpose computers, smaller than mainframe and
give computing power without adding the prohibitive expenses associated with
large systems. They are used in accounting, word processing, database
management, statistical packages for social sciences, CAD, and numerical
analysis etc
Hybrid Computers
A hybrid computer is a combined complex of several electronic computer units built using
the different characterization of quantities (i.e., analog and digital features) and united by a
single control system.
The purpose of designing hybrid computers is to provide functions and features that can be
found on both analog and digital devices.
This combined model (hybrid system) aims to create a work unit that offers the best of both
types of computers. Hybrid computers are extremely fast when driving equations, even when
those calculations are incredibly complex.
Generations of Computer
The development of computer systems is normally discussed as the
development over different generations.
First Generation
•The period 1940 to 1956, roughly considered as the First Generation of Computer.
•The first generation computers were developed by using vacuum tube or thermionic
valve machine.
•The input of this system was based on punched cards and paper tape; however, the
output was displayed on printouts.
•The first generation computers worked on binary-coded concept (i.e., language of
0-1).
•Examples: ENIAC, EDVAC, etc.
Second Generation
•The period 1956 to 1963 is roughly considered as the period of Second
Generation of Computers.
•The second generation computers were developed by using transistor
technology.
•In comparison to the first generation, the size of second generation was
smaller.
•In comparison to computers of the first generation, the computing time taken
by the computers of the second generation was lesser.
Third Generation
•The period 1963 to 1971 is roughly considered as the period of Third
Generation of computers.
•The third generation computers were developed by using the Integrated Circuit
(IC) technology.
•In comparison to the computers of the second generation, the size of the
computers of the third generation was smaller.
•In comparison to the computers of the second generation, the computing time
taken by the computers of the third generation was lesser.
•The third generation computer consumed less power and also generated less
heat.
•The maintenance cost of the computers in the third generation was also low.
•The computer system of the computers of the third generation was easier for
commercial use.
Fourth Generation
•The period 1972 to 2010 is roughly considered as the fourth generation of computers.
•The fourth generation computers were developed by using microprocessor technology.
•By coming to fourth generation, computer became very small in size, it became portable.
•The machine of fourth generation started generating very low amount of heat.
•It is much faster and accuracy became more reliable.
•The production cost reduced to very low in comparison to the previous generation.
•It became available for the common people as well.
Fifth Generation
•The period 2010 to till date and beyond, roughly considered as the period of fifth
generation of computers.
•By the time, the computer generation was being categorized on the basis of hardware
only, but the fifth generation technology also included software.
•The computers of the fifth generation had high capability and large memory capacity.
•Working with computers of this generation was fast and multiple tasks could be
performed simultaneously.
•Some of the popular advanced technologies of the fifth generation include Artificial
intelligence, Quantum computation, Nanotechnology, Parallel processing, etc.
Basic Units of Measurement
BIT is a unit of information equivalent to the result of a choice between only 2
possible alternatives in the binary number system.
BYTE is a sequence of 8 bits (enough to represent one character of
alphanumeric data) processed as a single unit for information.
• A byte can be used to represent a single character, which can be:
• A letter
• A number
• A special character or symbol, or
• A space
• 1024 bytes = 1 kilobyte (K or KB)
• 1024 KB = 1 megabyte (MB)
• 1024 MB = 1 gigabyte (GB)
• 1024 GB = 1 Terabyte (TB)
Central Processing Unit
The CPU which is referred to as the brain of a computer is responsible for
processing the data inside the computer system. It is also responsible for
controlling all other components of computer system.
Central processing unit (CPU) is the central component of the PC. Sometimes
it is called as a processor. It is the brain that runs the show inside the Pc. All
work that is done on a computer is performed directly or indirectly by the
processor. Obviously, it is one of the most important components of the Pc. It
is also, scientifically, not only one of the most amazing parts of the PC but one
of the most amazing devices in the world of technology. The processor plays a
significant role in the following important aspects of your computer system;
Performance
The processor is probably the most important single determinant of system
performance on the Pc. While other components also play a key role in
determining performance, the processor's capabilities dictate the maximum
performance of a system. The other devices only allow the processor to reach
its full potential.
Software Support
Newer, faster processors enable the use of the latest software. In addition, new
processors such as the i3/i5/i7 with MMX Technology, enable the use of
specialized software not usable on earlier machines.
Reliability and Stability
The quality of the processor is one factor that determines how reliably your
system will run. While most processors are very dependable, some are not. This
also depends to some extent on the age of the processor and how much energy
it consumes. The CPU consists of Control Unit, Arithmetic and Logic Unit
(ALU) and register set.
Main Operation of the CPU Includes
1. FETCH: Fetching instruction from the memory issued by the user.
2. DECODE: Decoding the instruction to decide what operation to be
performed.
3. EXECUTE: Execute the instruction.
4. STORE: Store the result in the memory.
The structure of CPU:
Arithmetic Logical Unit (ALU)
ALU is the combination of arithmetic unit and logical unit is used to perform
an arithmetic operation on the input data (+, -, *, /). Logical unit is used to
perform logical operation on input data (, <=, >=, =, OR, NOT, AND)
Control Unit (CU)
CU is an important component that controls the flow of data and information.
It is important for the proper execution of the instruction.
Register (Memory Unit)
The register is used to quickly accept, store, and transfer data and instructions
that are being used immediately by the CPU, there are various types of
Registers those are used for various purposes. Register are special purpose
high-speed temporary storage area for holding data, address, and instruction
during processing of the instruction. The register is always on the CPU.
Program Counter
PC: - The program counter (PC) just part of the instruction sequencer in some
computers is a processor register. It keeps track of the next memory address of
the instruction that is to be executed once the execution of the current
instruction is completed. In other words, it holds the address of the memory
location of the next instruction when the current instruction is executed.
Accumulator
AC: -Accumulator: This Register is used for storing the Results those are
produced by the System. When the CPU will generate Some Results after the
Processing then all the Results will be Stored into the AC Register.
Instruction Register
IR: - Instruction Register: store the instruction currently being executed.
Memory Address Register
MAR: - (Memory address register) this register holds the memory addresses of
data and instructions. This register is used to access data and instructions from
memory during the execution phase of an instruction. Suppose CPU wants to
store some data in the memory or to read the data from the memory. It places
the address of the required memory location in the MAR
Memory Buffer Register
MBR: - Memory buffer register: -MBR stands for Memory Buffer Register. This
register holds the contents of data or instruction read from, or written in the
memory. It means that this register is used to store data/instruction coming
from the memory or going to the memory.
Memory Data Register
MDR: - (Memory Data register) MDR is the register of a computer's control
unit that contains the data to be stored in the computer storage (e.g. RAM), or
the data after a fetch from the computer storage. It acts as a buffer and holds
anything that is copied from the memory ready for the processor to use it.
Computer Memory
The computer memory holds the data and instructions needed to process raw
data and produce output. The computer memory is divided into large number
of small parts known as cells. Each cell has a unique address which varies from
0 to memory size minus one.
1. Register memory
2. Cache memory
3. Primary memory
4. Secondary memory
Register Memory
Register memory is the smallest and fastest memory in a computer. It is not a part of
the main memory and is located in the CPU in the form of registers, which are the
smallest data holding elements. A register temporarily holds frequently used data,
instructions, and memory address that are to be used by CPU. They hold instructions
that are currently processed by the CPU. All data is required to pass through registers
before it can be processed. So, they are used by CPU to process the data entered by
the users.
Registers hold a small amount of data around 32 bits to 64 bits. The speed of a CPU
depends on the number and size (no. of bits) of registers that are built into the CPU.
Registers can be of different types based on their uses. Some of the widely used
Registers include Accumulator or AC, Data Register or DR, the Address Register or
AR, Program Counter (PC), I/O Address Register, and more.
Cache Memory
Cache memory is a high-speed memory, which is small in size but faster than
the main memory (RAM). The CPU can access it more quickly than the primary
memory. So, it is used to synchronize with high-speed CPU and to improve its
performance.
Cache memory can only be accessed by CPU. It can be a reserved part of the
main memory or a storage device outside the CPU. It holds the data and
programs which are frequently used by the CPU. So, it makes sure that the data
is instantly available for CPU whenever the CPU needs this data. In other
words, if the CPU finds the required data or instructions in the cache memory,
it doesn't need to access the primary memory (RAM). Thus, by acting as a
buffer between RAM and CPU, it speeds up the system performance.
Types of Cache Memory
1. Primary Cache: - It is also known as L1 cache or internal cache it is located
inside the CPU and provides quick access to the frequently provided data to
the microprocessor.
2. Secondary Cache: - - It is also known as L2 cache or External cache it is
located outside the CPU and positioned on the motherboard. It is slower as
compared to L1.
Primary Memory
The primary memory is available on the computer as a built-in unit of the
computer. The primary memory is represented as a set of location occupying 8
bits. Each bit in the memory is identified by a unique address. The data is
stored in the machine understandable binary form in these memory locations.
Primary Memory is of two types: RAM and ROM.
Random Access Memory
This is the primary memory from where data & instructions can be received in
a random manner (RAM). It is a volatile memory in which the contents are lost
once the power is turned off. The kind of memory is used to store the data
temporarily during the computer operations.
Types of RAM
1. Static random-access memory (SRAM): It is a volatile memory based on
traditional transistors using flip-flop gates to hold data if the power is on. The
contents are lost once the power is turned off. It is very fast and that’s used in the
cache memory. The SRAM takes more space and is expensive too, but it is easy to
use. It does not need to be refreshed periodically and synchronizes itself with the
timing of CPU.
2. Dynamic random-access memory (DRAM): It is a volatile memory based on the
capacitors that hold data if the power is on. Due to discharging capacitors, the
DRAM is refreshed periodically. This refreshing is done automatically, and due to
the time consumed in refreshing. The DRAM is slow. It is inexpensive and takes
less space; therefore, DRAM is used as the main memory.
Read Only Memory
ROM is a special type of memory which can only be read and contents of
which are
not lost even when the computer is switched off. ROM chips are used not only
in computers but in most
other electronic items such as washing machines, microwave ovens, calculators,
laser printers, media
players etc. It is not limited to electronic chips, CDROM and DVD ROM.
Types of ROMs
1. Programmable read-only memory (PROM): This is a kind of ROM has not been
pre-recorded by the manufacturer but is supplied empty. The user of this ROM
can store programs on it using a special tool. Once the empty ROM is
programmed, it behaves like any other ROM, that is, it cannot be rewritten.
2. Erasable programmable read-only memory (EPROM): This is a ROM which has
not been prerecorded by the manufacturer, but it is supplied empty. The user of
this ROM can store programs on it using a special tool. Once the empty ROM is
programmed, it can be rewritten repeatedly after erasing the previously written
entire contents using the ultraviolet light of specific frequency. EPROM is more
expensive than PROM.
Electrically erasable programmable read-only memory (EEPROM): This is a ROM
which has not been pre-recorded by the manufacturer, but it supplied empty. The user
of this ROM can store programs on it using a special tool. Once the empty ROM is
programmed, it can be rewritten repeatedly after erasing the previously written
contents using electric charge. This kind or ROM requires erasing the entire
previously written content, but it allows erasing one byte at a time before writing the
new content onto it. The EEPROM is more expensive than PROM, but it need not
be removed from the computer for rewriting. This is the most flexible type of ROM,
which is now commonly used for storing BIOS programs.
Secondary Memory
The secondary storage devices which are built into the computer or connected to the
computer are known as a secondary memory of the computer. It is also known as
external memory or auxiliary storage.
• Improves scalability.
• Security is managed via the servers.
Disadvantages of Networking Operating System
• Needed regular updates and maintenance.
• It is expensive.
• Many operations depend on a central location.
Real Time Operating System
Real-time operating systems are the operating systems that are used in real-time
applications where the data processing must be done in a fixed interval of time. The
Real-time operating system gives the response very fast and quick. The Real-time
operating system is used when a large number of events are processed in a short
interval of time.
It is based on clock interrupts. In the real-time system, the process is executed on the
basis of priority. The high priority process always executes first. When a high priority
process enters into the system, the low priority process preempts to serve a high
priority process. The task of synchronizing the process is done by the real-time
operating system so that the process can interact with each other efficiently. In this
way, resources are used effectively without time-wasting.
There are three types of Real-time operating system:
Hard-Real time: - In Hard-Real time system, there is some deadline for executing the task, which
means that the task must start its execution on the particular scheduled time, and should complete
within the assigned duration of time. Example: - Aircraft systems, Medical critical care System, etc.
Soft-Real time: - In the Soft-Real time system also, we assign a time to each process, but some
delaying in time is acceptable. So, in Soft-real time, deadlines are handled softly. That’s why it is called
Soft-Real time. Example: - Live stock price and Online Transaction System.
Firm-Real time: - In the Firm-Real time system, there is also a deadline for every task to execute. But
in this, due to missing deadlines, there may be no big impact, but there can be chances of undesired
effects such as problems in the quality of a product. Example: - Multimedia Applications.
Advantages of Real-Time Operating System
• Real-time operating systems are error-free.
• Real-time operating systems offer the facility of memory allocation management.
• It offers better utilization of devices and systems and produces more output from all the resources.
• The real-time operating system more focuses on running the applications and give less importance to those
applications which are present in the queue.
Disadvantages of a Real-Time Operating System
• In Real-Time Operating System, the task of writing the algorithm is very challenging and complex.
• Real-Time Operating System is expensive because it is using heavy system resources.
Mobile Operating System
Mobile Operating System is the type of operating system which is mainly
designed to power smartphones, wearables devices, and tablets.
Example: - Android, BlackBerry, etc.
Process Management
A Program will not do anything unless a CPU executes its instructions. An
executing program is called a process. The Process requires computer resources
to complete its task. More than one process can exist in the system, which
needs the same resources at the same time. So, the operating system handles all
the resources and processes effectively.
There may be situations where many resources may need to be executed at the
same time by one process so that consistency is maintained; otherwise, the
system may become inconsistent, and there may be chances of deadlock.
The operating system performs the following tasks for process management:
• Suspending and restarting the process.
• Offering mechanisms for process communication.
• Offering mechanisms for process synchronization.
• Process scheduling and threads on the CPU.
• Create and delete system and user processes.
Process: - A process is defined as a program in execution.
Types of Process
There are two types of Processes:
• I/O-Bound Process: - It is a type of process in which the process execution
time is calculated with the help of the amount of time a process spends to
complete the input/output operations.
• CPU-Bound Process: - CPU-Bound Process is another type of process in
which the process execution time is calculated with the help of the CPU
speed. If we use a faster processor, then the CPU-Bound Process may
execute faster.
Components of Process
There are four components of the process:
• Text: - Text consists of the value of the program counter
and the processor’s registers content that is represented by
the current activity.
• Data: - Data contains both static as well as global variables.
• Stack: - Stack contains temporary data like local variables,
return addresses, and method/function.
• Heap: - Heap is a dynamic memory which is allocated during
the run time of a process.
Attributes of Process
The attributes of a process are also called the
context of the process. These attributes design
the Process Control Block (PCB).
Process ID: - Process ID is a unique ID that is assigned to the process at that
time when the process was created.
Program counter: - The Program counter holds the address of the last
instruction of the process.
Process State: - The process state may be one of the following states, i.e.,
running, ready, waiting, terminate, etc.
Priority: - Some priority is assigned to every process in the memory. The
process that has the highest priority between the processes gets the CPU first.
General Purpose Registers: - These registers are used to store the data which is
generated at the time of process execution.
List of Open Files: - A list of open files contains some files that require to be
present in the main memory when the process is executing
List of Open Devices: - List of open devices contains the list of devices that are
used when the process is executing.
Process State
• New: Newly Created Process (or) being-created process.
• Ready: After creation process moves to Ready state, i.e. the process is ready for execution.
• Run: Currently running process in CPU (only one process at a time can be under execution
in a single processor).
• Wait (or Block): When a process requests I/O access.
• Complete (or Terminated): The process completed its execution.
• Suspended Ready: When the ready queue becomes full, some processes are moved to
suspended ready state
• Suspended Block: When waiting queue becomes full.
Diagram:
File System in OS
A file is a collection of related information that is recorded on secondary
storage. Or file is a collection of logically related entities. From user’s
perspective a file is the smallest allotment of logical secondary storage.
The name of the file is divided into two parts as shown below:
• name
• extension, separated by a period.
Files attributes and its operations:
Attributes Types Operations
Name Doc Create
Type Exe Open
Size Jpg Read
Creation Data Xis Write
Author C Append
Last Modified Java Truncate
Protection Class Delete
Close
File type Usual extension Function
Word Processor wp, tex, rrf, doc Various word processor formats