Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
11 views39 pages

Chapter 1 Slide 2

The document outlines the fundamental concepts of hardware and software, detailing their definitions, categories, and interdependence. It further explains the roles of operating systems in managing resources such as files, processors, memory, and devices, along with security and error detection. Additionally, it covers number systems, the execution process of C programs, and the basics of algorithms and flowcharts in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views39 pages

Chapter 1 Slide 2

The document outlines the fundamental concepts of hardware and software, detailing their definitions, categories, and interdependence. It further explains the roles of operating systems in managing resources such as files, processors, memory, and devices, along with security and error detection. Additionally, it covers number systems, the execution process of C programs, and the basics of algorithms and flowcharts in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Hardware and Software

• Computer system is divided into two categories:


1. Hardware and 2. Software
• Hardware refers to the physical and visible components of the system such
as a monitor, CPU, Keyboard, mouse etc.
• Hardware is further divided into four main categories:
1. Input devices 2. Output devices 3. Secondary storages 4. Internal
Components
• Hardware is physical in nature and hence one can touch and see hardware.
• Hardware physically will wear out over time.
• Software refers to the set of instructions which enables the hardware to
perform a specific set of tasks.
• The software must be installed in the hardware to function properly and
similarly, the hardware must be present for the tasks to be performed.
• Both are interdependent, yet they are also different from each other.
• The software cannot be touched physically.
• There are two types of software
• Application software and System software.
• Software does not wear out but it can be affected by bugs.
• Example of software: Windows 10, Microsoft office etc.
• APPLICATION SOFTWARE:
• Application software is a computer program designed to carry out a
specific task other than one relating to the operation of the computer
itself, typically to be used by end-users.
• Example: Microsoft Office, Acrobat etc
• SYSTEM SOFTWARE:
• System software is a type of computer program that is designed to
run a computer’s hardware and application programs.
• Example: Windows, Linux etc
• OPERATING SYSTEM:
• An Operating System (OS) is an interface between a computer user
and computer hardware.
• An operating system is software that enables applications to interact
with a computer's hardware.
• The primary purposes of an Operating System are to enable
applications (spftwares) to interact with a computer's hardware and
to manage a system's hardware and software resources.
• Generic architecture diagram of an Operating System which is as
follows:
• Important tasks performed by operating system:
1. File management:
A file system is normally organized into directories for easy navigation
and usage. These directories may contain files and other directions.
An Operating System does the following activities for file management −
Keeps track of information, location, uses, status etc. The collective facilities
are often known as file system.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources.
2. Processor Management
In multiprogramming environment, the OS decides which process gets
the processor when and for how much time. This function is called
process scheduling. An Operating System does the following activities
for processor management −
Keeps tracks of processor and status of process. The program
responsible for this task is known as traffic controller.
Allocates the processor (CPU) to a process.
De-allocates processor when a process is no longer required.
3. Memory Management
Memory management refers to management of Primary Memory or Main
Memory. Main memory is a large array of words or bytes where each word
or byte has its own address.
Main memory provides a fast storage that can be accessed directly by the
CPU. For a program to be executed, it must in the main memory. An
Operating System does the following activities for memory management −
Keeps tracks of primary memory, i.e., what part of it are in use by whom,
what part are not in use.
In multiprogramming, the OS decides which process will get memory when
and how much.
Allocates the memory when a process requests it to do so.
De-allocates the memory when a process no longer needs it or has been
terminated.
4. Device Management
An Operating System manages device communication via their
respective drivers. It does the following activities for device
management −
Keeps tracks of all devices. Program responsible for this task is known
as the I/O controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.
5. Security:
By means of password and similar other techniques, it prevents
unauthorized access to programs and data.
6. Error detecting aids:
Production of dumps, traces, error messages, and other debugging and
error detecting aids.
NUMBER SYSTEM
• All digital computers store numbers, letters, and other characters in coded form.
• The code used to represent characters is the Binary Code – i.e. a code made up of
bits called Binary Digits.
• Every character is represented by a string of “0s” and “1s” – the only digits found
in the binary numbering system.
“0” or “1” = bit (Binary Digit)
8 bits = 1 Byte (1 Character)
1024 Bytes = 1 KB (Kilo Bytes)
1024 KB = 1 MB (Mega Byte)
1024 MB = 1 GB (Giga Byte)
1024 GB= 1 TB (Terra Byte)
• When data is typed into a computer, the key board converts each key
stroke into a binary character code. This code is then transmitted to
the computer.
• When the computer transmits the data to the any device, each
individual character is communicated in binary code. It is then
converted back to the specific character while displaying or printing
the data.
1. Decimal Number System (Base 10):
• In the decimal system the successive positions to the left of the
decimal point represent units, tens, hundreds, thousands etc.
• For example if we consider the number 7762, the digit 2 represents
the number of units, 6 represents the number of tens, 7 the number
of hundreds and 7 the number of thousands.
• (7 x 1000) + (7 x 100) + (6 x 10) + (2 x 1) = 7762
• Thus as we move one position to the left, the value of the digit
increases by ten times. We can see that the position of the number
affects its value.
2. Binary number system (Base 2):
• We now come to a different number system – the Binary number
system.
• This binary number system has a base of two, and the symbols used
are “0” And “1”.
• Converting Decimal to Binary:
In conversion from decimal to any other number system, the steps to
be followed are:
o Divide the decimal number by the base of 2.
o Note the remainder in one column and divide the quotient again with
the base. Repeat this process until the quotient is reduced to a zero.
• Converting binary to decimal
The decimal number of 100001 is
= (1*26)+(0*25)+(0*24)+(0*23)+(0*22)+(0*21)+(1*20)
= (1*64) + (0*32) + (0*16) + (0*8) + (0*4) + (0*2) + (1 * 1)
= 64 + 0 + 0 + 0 + 0 + 0 + 1
= 65
The decimal number of 1000001 is 65
3. Octal number system (base 8):
• A number system which has its base as 'eight' is called an Octal
number system.
• It uses numbers from 0 to 7.
• Converting binary to octal
Binary------Octal
000 --------- 0
001 --------- 1
010 --------- 2
011 --------- 3
100 --------- 4
101 --------- 5
110 --------- 6
111 --------- 7
• The binary number must be divided into groups of three from the
octal point– to the right in case of the fractional portion and to the
left in case of the integer portion. Each group can then be replaced
with their octal equivalent.
Example
Binary 101010101010100
101 010 101 010 100
5 2 5 2 4
• So, 52524 is the Octal equivalent of binary 101010101010100
• Converting octal to binary
• Each octal digit is replaced with the appropriate ‘triple’ of binary
digits.
e.g. 65
6 5
110 101
• The binary equivalent of the Octal number 65 is 110101
4. Hexadecimal number system(base16):
• The hexadecimal number system is a type of number system, that has
a base value equal to 16.
• It uses number from 0 to 9 followed by A to F
• Converting binary to hexadecimal
• Each hexadecimal digit is represented by 4 binary digits.
Binary Hexadecimal
0000 --------- 0
0001 --------- 1 1010 --------- A
0010 --------- 2 1011 --------- B
0011 --------- 3 1100 --------- C
1101 --------- D
0100 --------- 4
1110 --------- E
0101 --------- 5 1111 --------- F
0110 --------- 6
0111 --------- 7
1000 --------- 8
1001 --------- 9
• To convert a binary number to its hexadecimal equivalent we split the
quantity into groups of four onwards, as before.
• Each of this group of four is directly converted into their hexadecimal
equivalent.
• We may add zeros to the left of the number if necessary.
Example
Binary 10101011000010
0010 1010 1100 0010
2 A C 2
• So, the hexadecimal equivalent of binary 10101011000010 will be 2AC2
• Converting hexadecimal to binary
• The conversion from hexadecimal to binary consists of writing off the
binary Equivalent of each hexadecimal digit in groups of four.
e.g.
• Hexadecimal 1901A0412C
1 9 0 1 A 0 4 1 2 C
0001 1001 0000 0001 1010 0000 0100 0001 0010 1100
• Thus the required binary number can be written as:
• 1100100000001101000000100000100101100
How does C program execute?
• Here we will see how the C programs are executed in a system.
• This is basically the compilation process of a C program.
• The following diagram in the next slide will show how a C Source
Code can be executed.
In the diagram in the previous slide, there are different steps −
• C Code − This is the code that you have written. This code is sent to the Preprocessors
section.
• Preprocessing − In this section the preprocessor files are attached with our code. We
have use different header files like stdio.h, math.h etc. These files are attached with the
C Source code and the final C Source generates. (‘#include’, ‘#define’ These are
Preprocessor Directives.)
• Compiler − After generating the preprocessed source code, it moves to the compiler and
the compiler generates the assembly level code after compiling the whole program.
• Assembler − This part takes the assembly level language from compiler and generates
the Object code, this code is quite similar to the machine code (set of binary digits).
• Linker − Linker is another important part of the compilation process. It takes the object
code and link it with other library files, these library files are not the part of our code, but
it helps to execute the total program. After linking the Linker generates the final Machine
code which is ready to execute.
• Loader − A program, will not be executed until it is not loaded in to Primary memory.
Loader helps to load the machine code to RAM and helps to execute it. While executing
the program is named as Process. So process is (Program in execution).
What is an algorithm and flowchart in C
language?
• Algorithm:
• Algorithm is a step – by – step procedure which is helpful in solving a problem
Properties of an Algorithm
• An algorithm must possess the following five properties −
• Input
• Output
• Finiteness
• Definiteness
• Effectiveness
• Example
Algorithm for finding the average of three numbers is as follows −
Step1: Start
Step2: Read 3 numbers a,b,c
Step3: Compute sum = a+b+c
Step4: Compute average = sum/3
Step5: Print average value
Step6: Stop
• Flowchart:
• Flowchart is a graphical representation of an algorithm.
• Programmers often use it as a program-planning tool to solve a
problem.
• It makes use of symbols which are connected among them to
indicate the flow of information and processing.
• The process of drawing a flowchart for an algorithm is known as
“flowcharting”.
Basic Symbols used in Flowchart Designs
• Terminal: The oval symbol indicates Start, Stop and Halt in a
program’s logic flow. A pause/halt is generally used in a program logic
under some error conditions. Terminal is the first and last symbols in
the flowchart.

• Input/Output: A parallelogram denotes any function of input/output


type. Program instructions that take input from input devices and
display output on output devices are indicated with parallelogram in a
flowchart.
• Processing: A box represents arithmetic instructions. All arithmetic
processes such as adding, subtracting, multiplication and division are
indicated by action or process symbol.

• Decision: Diamond symbol represents a decision point. Decision


based operations such as yes/no question or true/false are indicated
by diamond in flowchart.
• Connectors: Whenever flowchart becomes complex or it spreads over
more than one page, it is useful to use connectors to avoid any
confusions. It is represented by a circle.

• Flow lines: Flow lines indicate the exact sequence in which


instructions are executed. Arrows represent the direction of flow of
control and relationship among different symbols of flowchart.
• Looping: Hexagon represents looping, it shows initialization, condition
and incrementation of loop variable.
• Rules For Creating Flowchart :
• A flowchart is a graphical representation of an algorithm, it should
follow some rules while creating a flowchart
• Rule 1: Flowchart opening statement must be ‘start’ keyword.
• Rule 2: Flowchart ending statement must be ‘end’ keyword.
• Rule 3: All symbols in the flowchart must be connected with an arrow line.
• Rule 4: The decision symbol in the flowchart cannot be associated with the
arrow line.
• Draw a flowchart to input two numbers from the user and display the
largest of two numbers
• Draw a flowchart to find the sum of two numbers:

You might also like