22
FCH 1: Fundamental of Computer Instructor: Saroj Maharjan Page| 1 of 22 1. Digital Logic Function and Boolean Algebra A Boolean expression is a string of symbols representing local variables and logical operations which is evaluated to give a logical value. E.g: A + A’B A Logic function is an expression expressed algebraically with binary variables, logical operation symbols, parenthesis and equal sign, is also known as Boolean function. Eg: If logic function is R = A + B, then there value must be in 0 and 1. Boolean algebra is the branch of mathematics that includes methods for manipulating logical variables and logical expressions. Eg: Logical values: True (T) or False (F) Representation: ON (1) or OFF (0) 1.1. Basic Logical//Boolean Operation An Operation is special symbol that indicates the operation to be carried out between two operands. 1.1.1. AND Operation AND Operation is logical multiplication which is denoted by (.) operator. It generate TRUE if all the inputs are TRUE, otherwise FALSE. Input Output A B R=A.B T T T T F F F T F F F F 1.1.2. OR Operation OR Operation is logical addition which is denoted by (+) operator. It generates TRUE if any one input is TRUE otherwise FALSE. Input Output A B R=A+B T T T T F T F T T F F F 1.1.3. NOT Operation NOT Operation is logical complement which is denoted by (`) operator or bar(). It generate TRUE if the input is FALSE, otherwise FALSE output. Input Output A B=A` T F F T

1. Digital Logic Function and Boolean Algebra

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 1 of 22

1. Digital Logic Function and Boolean Algebra

A Boolean expression is a string of symbols representing local variables and logical

operations which is evaluated to give a logical value.

E.g: A + A’B

A Logic function is an expression expressed algebraically with binary variables, logical

operation symbols, parenthesis and equal sign, is also known as Boolean function.

Eg: If logic function is R = A + B, then there value must be in 0 and 1.

Boolean algebra is the branch of mathematics that includes methods for manipulating

logical variables and logical expressions.

Eg: Logical values: True (T) or False (F)

Representation: ON (1) or OFF (0)

1.1. Basic Logical//Boolean Operation

An Operation is special symbol that indicates the operation to be carried out

between two operands.

1.1.1. AND Operation

AND Operation is logical multiplication which is denoted by (.) operator. It

generate TRUE if all the inputs are TRUE, otherwise FALSE.

Input Output

A B R=A.B

T T T

T F F F T F

F F F

1.1.2. OR Operation

OR Operation is logical addition which is denoted by (+) operator. It generates

TRUE if any one input is TRUE otherwise FALSE.

Input Output A B R=A+B

T T T T F T

F T T F F F

1.1.3. NOT Operation

NOT Operation is logical complement which is denoted by (`) operator or bar().

It generate TRUE if the input is FALSE, otherwise FALSE output.

Input Output

A B=A` T F

F T

Page 2: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 2 of 22

1.2. Truth Table

A Truth Table is the tabular representation of Boolean function used in logic to

compute the functional values of logical expression on each of their functional

arguments.

1.3. Logic Gates

A Logic Gate is an electronic circuit which generates only one output signal from one

or more input signals.

1.3.1. AND Gate

AND Gate is an electronic circuit which is used to perform logical multiplication.

It is denoted by (.). It generate 1 or TRUE or ON output if all the inputs are 1 or

TRUE or ON otherwise 0 or FALSE or OFF output.

Algebraic Expression: R=A.B

Graphical Symbols

A

R=A.B

B

1.3.2. OR Gate

OR Gate is an electronic circuit which is used to perform logical addition. It is

denoted by (+). It generate 1 or TRUE or ON output if at least one the input is 1

or TRUE or ON otherwise 0 or FALSE or OFF output.

Algebraic Expression: R=A+B

Graphical Symbols

A

R=A+B

B

1.3.3. NOT Gate

NOT Gate is an electronic circuit which is used to perform logical complement.

It is denoted by (` or ¯). It generate 1 or TRUE or ON output if the input 0 or

FALSE or OFF otherwise input 0 or FALSE or OFF output. So, it is also called

Inverter.

Algebraic Expression: R=A’

Graphical Symbols

A R=A’

Input Output A B R=A.B

1 1 1 1 0 0

0 1 0

0 0 0

Input Output A B R=A+B

1 1 1

1 0 1 0 1 1

0 0 0

Input Output

A R=A’ 1 0

0 1

Page 3: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 3 of 22

1.3.4. NAND Gate

NAND Gate is an electronic circuit which is used to perform complement of

logical multiplication. It is denoted by (. and ‘). It generate 1 or TRUE or ON

output if at least any one of the input is 0 or FALSE or OFF otherwise 0 or FALSE

or OFF output.

Algebraic Expression: R=(A.B)’

Graphical Symbols

A

R=(A.B)’

B

1.3.5. NOR Gate

NOR Gate is an electronic circuit which is used to perform complement of

logical addition. It is denoted by (+ and ‘). It generate 1 or TRUE or ON output if

all the inputs are 0 or FALSE or OFF otherwise 0 or FALSE or OFF output.

Algebraic Expression: R=(A+B)’

Graphical Symbols

A

R=(A+B)’

B

1.3.6. X-OR or EX-OR Gate

X-OR Gate is an electronic circuit which is used to perform logical “either/or”

operation. It is denoted by ( ). It generates 1 or TRUE or ON output if the

number of TRUE inputs are odd, therwise 0 or FALSE or OFF output. It is also

known as even parity generator.

Algebraic Expression: R=A B

Graphical Symbols

A

R=(A B)

B

Input Output

A B R=(A.B)’ 1 1 0

1 0 1 0 1 1

0 0 1

Input Output

A B R=(A+B)’

1 1 0

1 0 0

0 1 0 0 0 1

Input Output

A B R=(A B)

1 1 0 1 0 1

0 1 1

0 0 0

Page 4: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 4 of 22

1.3.7. X-NOR OR EX-NOR Gate

X-OR Gate is an electronic circuit which is used to perform logical complement of

Exclusive-OR. It generates 1 or TRUE or ON output if the number of TRUE inputs

are even, otherwise 0 or FALSE or OFF output. It is also known as odd parity

generator.

Algebraic Expression: R=(A B)’

Graphical Symbols

A

R=(A B)

B

1.4. Universal Gate

A Universal Gate is a gate which can implement any Boolean function without using any

other type of gates. NAND and NOR gates are known as universal gates.

EG:

A =A

Input Output

A B R=(A B)’

1 1 1 1 0 0

0 1 0

0 0 1

Page 5: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 5 of 22

2. Number System

A Number System is a system for expressing numbers that is mathematical notation

used for counting or manipulating other countable things. Here

Base Number System

2 Binary Number System

8 Octal Number System

10 Decimal Number System 16 Hexadecimal Number System

2.1. Binary Number System

A Number System having base or radix 2 is called Binary Number System. It consists

of two bits ie. 0 and 1.It is also called Binary Digits. Eg: (11011)2.

2.2. Octal Number System

A Number System having base or radix 8 is called Octal Number System. It consists

of number 0, 1, 2, 3, 4, 5, 6, 7, and 8. Eg: (6105)8

2.3. Decimal Number System

A Number System having base or radix 10 is called Decimal Number System. It

consists of number 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. It is also known as Denary Number

System. Eg: (9105)10

2.4. Hexadecimal Number System

A Number System having base or radix 16 is called Decimal Number System. It

consists of number 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and character A, B, C, D, E, and F where

A=10, B=11, C=12, D=13, E=14, and F=15. Eg: (92A5)16

2.5. Conversation of Number System

Table:

Number System

Decimal Hexadecimal Octal Binary

0 0 0 0000

1 1 1 0001

2 2 2 0010 3 3 3 0011

4 4 4 0100

5 5 5 0101 6 6 6 0110

7 7 7 0111

8 8 10 1000

9 9 11 1001

10 A 12 1010

11 B 13 1011

12 C 14 1100

13 D 15 1101

14 E 16 1110 15 F 17 1111

Page 6: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 6 of 22

2.6. Decimal to Other Number System conversion

2.6.1. Decimal to binary conversion

Eg: convert (58.515)10=(?)2

0

1

0

1

1

(58)10=(111010)2

For fractional decimal,

Fractioned Multiplier Answer Integer 0.515 2 1.030 1

0.030 2 0.06 0

0.06 2 0.12 0

0.12 2 0.24 0 0.24 2 0.48 0

0.48 2 0.96 0

0.96 2 1.92 1

0.92 2 1.84 1

0.84 2 1.68 1 (0.515)10=(0.100000111)2

∴(58.515)10=(111010.100000111)2

2.6.2. Decimal to Octal conversion

Convert (697.687)10=(?)8

1

7

2

(697.687)10=(1271)8

For Fraction,

Fractioned Multiplier Answer Integer

0.687 8 5.496 5

0.496 8 3.968 3

0.968 8 7.744 7

0.744 8 5.952 5 0.952 8 7.616 7

0.616 8 4.928 4 0.928 8 7.424 7

0.424 8 3.392 3 0.392 8 3.136 3

Hence the equivalent answer is

(697.687)10=(1271.537574733)8

2 58

2 29

2 14

2 7

2 3

1

8 697

8 87

8 10

1

Page 7: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 7 of 22

2.6.3. Decimal to Hexadecimal conversion

Convert (4989.612)10=(?)16

13=D

7

3

For Fraciton,

Fractioned Multiplier Answer Integer

0.612 16 9.792 9 0.792 16 12.672 12=C

0.672 16 10.752 10=A

0.752 16 12.032 12=C 0.032 16 0.512 0

0.512 16 8.192 8 0.192 16 3.072 3

0.072 16 1.152 1 0.152 16 2.431999 2

The equivalent answer is

(4989.612)10=(137D.9CAC08312)16

2.7. Other System to Decimal conversion

2.7.1. Binary to Decimal conversion

Convert (111011.1101)2=(?)10

Here, (111011.1101)2 =1x25+1x24+1x23+0x22+1x21+1x20+1x2-1+1x2-2+0x2-

3+1x2-4 =59.8125

∴(111011.1101)2=(59.8125)10

2.7.2. Octal to Decimal conversion

Convert (7635.46)8=(?)10

Here, (7635.46)8 =7x83+6 x82+3 x81+5 x80+4 x8-1+6 x8-2

=3997.59375

∴(7635.46)8=(3997.59375)10

2.7.3. Hexadecimal to Decimal conversion

Convert (7D9A.EA)16=(?)10

Here, (7D9A)16 =7x163+D x162+9 x161+A x160+E x16-1+A x16-2

=7x163+13 x162+9 x161+10 x160+14 x16-1+10 x16-2

=32154.9140625

∴(7D9A.EA)16=(32154.9140625)10

2.8. Binary to Octal and Hexadecimal conversion

A. Binary to Octal conversion

Convert (1011101)2 = (?)8

16 4989

16 311

16 19

1

Page 8: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 8 of 22

Method 1:

Here, 001 011 101

1 3 5

∴(1011101)2=(135)8

Method 2:

B. Binary to Hexadecimal conversion

Convert (1011101)2 = (?)16

Method 1:

Here, 0101 1101

5 13=D

∴(1011101)2=(5D)16

Method 2:

2.9. Octal and Hexadecimal to Binary conversion

A. Octal to Binary

Convert (3756)8=(?)2

Method 1:

Here, 3= 011

7= 111

5= 101

6= 110

∴(3756)8=(11111101110)2

Method 2:

B. Hexadecimal to Binary

Convert (BC0)16=(?)2

Method 1: Here, B= 1011

C= 1100

0= 0000

∴(BC0)16=(101111000000)2

Binary Decimal Octal

Binary Decimal Hexadecimal

Octal Decimal Binary

Page 9: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 9 of 22

Method 2:

2.10. Octal to Hexadecimal and vice versa

A. Octal to Hexadecimal

Method 1:

Method 2:

B. Hexadecimal to Octal

Method 1:

Method 2:

2.11. Decimal Calculation

Complements are used in digital computers for simplifying the subtraction

operation and for logical manipulation. Using complements, all the arithmetic

operations can be performed in the form of addition.

2.11.1. 9’s Complement:

A 9’s Complement of a given decimal number is obtained by subtracting each

digit from 9.

For example:

9’s complement of 9 is 0 (9-9=0) and

678 is 321 (999-678=321).

2.11.2. 10’s Complement:

A 10’s Complement of a given decimal number is obtained by subtracting each

digit from 9 and finally adding one.

For example:

10’s complement of 9 is 1 ( 9’s complement of 9 +1 =0 +1 =1) and

678 is 322 (9’s complement of 678 +1=999-678+1= 322).

Hexadecimal Decimal Binary

Octal Binary Hexadecimal

Octal Decimal Hexadecimal

Hexadecimal Binary Octal

Hexadecimal Decimal Octal

Page 10: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 10 of 22

2.12. Binary Calculation

2.12.1. Binary Addition

Calculate sum of two binary numbers 101 and 110

101

+110

1011

2.12.2. Binary Subtraction

Substract 101 from 1011

1011

+ 101

0110

2.12.3. Binary Multiplication

0x0=0

0x1=0

1x0=0

1x1=1

2.12.4. Binary Division

Divide 110101 by 101

101) 110101 ( 1010

101

11

00

110

101

11

00

11

Page 11: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 11 of 22

3. Programming Language

The language like Nepali, English, Hindi,etc. used by human beings is called natural

language whereas the communication language between user ( human being) and

computer is called Programming Language. The language which is used to develop

program in computer is called Programming Language. Since a computer is electronic

device, it can only understand binary digit ie. 0 and 1.

3.1. Low Level Language

The low level language is a machine-oriented langunge so it is closer to what

machine can understand. It is difficult to write program using low level language.

Classified into two types

3.1.1. Machine Level Language (MLL)

Machine level language is first programming language used to make program in

computer. It is the language of CPU as it consists of series of 0’s and 1’s which

represents ‘off’ and ‘on’ state of electricity in computer circuit. Still modern

digital computer system uses Machine Level Language for processing and

storing data in 0 and 1 format. But, It is not used as programming language. The

MLL is also called generic language of digital computer.

Advantage of MLL

a. Program execution is faster than any other language as it is directly

understood and executed by the computer.

b. It does not require any translating program like compiler, interpreter or

translator because program itself is in binary form.

Disadvantage of MLL

a. It is very difficult and boring to make program in MLL since everything

should be in 0 and 1.

b. Program development is time consuming and almost impossible to

develop large program.

c. It is machine dependent language. So. The program written for one

processor cannot be used in others. Eg: the program for Intel processor

cannot run in AMD processor.

Programming Language

Low Level Language High Level Language Fourth Generation

Language

Machine Level Language

Assembly Level Language

Page 12: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 12 of 22

3.1.2. Assembly Level Language (ALL)

ALL came in existence to overcome the difficulties of Machine Language. In ALL,

instead of writing the instruction in the series of 0’s and 1’s, we can use

mnemonics like ADD, SUB, DIV, JMP, MOD, etc. along with the decimal number

in order to perform the different types of tasks and calculation.

Processing Architecture

Advantage of ALL

a. It is easier to write, debug and understand than MLL due to use of

mnemonics.

b. Program execution is faster than High Level Language.

c. It is efficient in program execution. Hence, ALL is still used in developing

firmware, device driver and operating system kernel.

Disadvantage of ALL

a. It is machine dependent language. The program made for one processor

does not work for other processors.

b. Program development and debugging is more difficult and time

consuming than in High Level Language.

c. It is very hard ot remember the mnemonics since they are in

abbreviated from and large in number.

3.2. High Level Language (HLL)

HLL is written in code of English language like structure and mathematical notation.

HLL instruction is not directly understood by the processor for execution. It need

conversion and the conversion is done by translating software like compiler and

interpreter. The Program written by the programmer in any HLL is called source

program. The codes that are converted into machine compatible or intermediate

code by compiler or interpreter is called Object Program. EG: Pascal, C, FORTRAN,

etc.

Advantage of HLL

a. It is easier to write, debug and understand HLL than other language due to

the similar structure of English language and mathematical notation.

Processor Source

Program

Object

Program

Assembler

Source Program

Compiler

Interpreter

Object Program Processor

Page 13: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 13 of 22

b. Program development is faster and require less effort than other languages.

c. Since it is machine independent programing language, program made up for

one processor can be used in otgher processor also.

d. Programmer does not need to remember larger number of mnemonics and

other unusual codes as in Low level language.

e. The programmer does not require the knowledge of internal structure of

computer architecture for writing the source programs in HLL.

f. Due to the similarity of English sentence, the source code itself provides

some form of technical documentation.

Disadvantage of HLL

a. Computer does not understand HLL directly, so the program needs

conversion before execution.

b. Program execution time is longer than in Low level language.

c. Every HLL must have its own translator because it cannot directly

generate executable code.

3.3. Fourth Generation Language (4GL)

Fourth Generation Language was developed after HLL, so it is one step ahead from

HLL. It is a result oriented programming language and it contains database query

language. 4GL program is also needed to be translated either by compiler or

interpreter into machine understandable code before they are executed as it is not

directly understood by the computer. Eg: SQL ( Structured Query Language).

3.4. Compiler

Compiler is software that converts source program written in HLL or 4GL into

machine level language at once. The compiler reads the complete program at first

and if it is bug free then it converts the source program in object program at once.

For every different processor or computer type, there must be a separate compiler.

It converts the source program into object program faster than interpreter does.

The process of running the compiler is called compiling. The object program consists

of binary file format and directly executed by the processor.

Source Program

Compiler

Interpreter

Object Program Processor

Processor Source

Program

Object

Program

Compiler

Page 14: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 14 of 22

3.5. Interpreter

Interpreter is also software that translates source program code written in HLL or

4GL into machine language line by line. Although the task of interpreter and

compiler is same, the working method of interpreter is different from compiler.

Unlike compiler, the interpreter reads each line of source program and if it is bug

free, then it convert program code into machine language. Since the interpreter

needs to evaluate the program line by line, it takes more time than compiler to

convert into machine language. The interpreter finds the error after translation of

every line of code.

3.6. Assembler

Assembler is translating software which converts, the source program written in

Assembly Level Language into object program which the computer can understand

for execution. It also read each line of Assembly Language code and if it is bug free,

then it translates the line into object program.

3.7. Difference between Compiler and Interpreter

Compiler Interpreter

1. It translates a complete high level language program into machine language at once.

1. It translates high level language program into machine language instructions line by line.

2. It finds the syntax errors during

compiling the whole programs.

2. It finds the syntax errors during

translating a line of the program.

3. The compiling process is faster than interpreter.

3. The interpreting process is slower than compiler.

4. It creates the object code after compiling.

4. It does not create object code at once.

5. Eg: C, C++, vb, etc. 5. Eg: BASIC, LISP, etc.

Processor Source

Program

Object

Program

Interpreter

Processor Source

Program

Object

Program

Assembler

Page 15: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 15 of 22

4. Software

Software is the computer programs, producers and documentation that performs

different tasks on computer system.

4.1. System Software

System Software is computer software designed to operate the computer hardware

and to provide a platform for running application software. System Software is a

collection of Operating Systems; device drivers, servers, windowing systems and

utilities. System software helps and application programmer in viewing away from

hardware, memory and other internal complexities of computer.

4.1.1. Operating System

Operating Systems performs basic tasks, such as It is the first program loaded

into memory when the computer is turned on and in a sense, bring life to the

computer hardware. Without it, you cannot communicate with your computer.

When you give the computer a command, the operating system relays the

instructions to microprocessor. When you are working in an application

software program such as Microsoft Word, Microsoft Excel, etc commands that

you give the application are sent through OS to CPU. Some of OS are Windows

95/98, Mac OS, Windows 7, DOS, Ubuntu, etc.

Function of OS are:-

Recognizing input from the keyboard

Sending output to display screen

Keeping track of files and directories on the disk

Controlling peripheral devices such as disk drives and printers

Provide security and backup

Provide interface between hardware and software

Management of memory

Scheduling processes

Software

System Software Application Software

Operating Software

Utility Software

Language Processor

Package Software

Tailor Software

Page 16: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 16 of 22

4.1.2. Utility Software

Utility programs help manage, maintain and control computer resources. These

programs are available to help you with the day-to-day chores associated with

personal computing and to keep out system running at peak performance.

Some examples of utility programs include:

Virus Scanning Software are designed to protect computer from computer

virus.

Backup Software is software that assists you in backing up your files and even

the entire computer hard drive. It is important to back up your files regularly.

Scan disk is a utility provided with Windows computers. It scans disks to see if

there are any potential problems on the disk such as bad sector areas.

Disk Defragmenter software assists you in keeps reorganizing disk drives.

After files are saved, deleted and resaved again, the disk can become

fragmented. It gathers those free spots and put them together to enable to

save data in most efficient manner.

4.1.3. Language Processor

Language Processor/ Translator is special types of computer system software

that can use to translate the program written in one language to another

language.

Types of language Processor/Translator

Compiler

Interpreter

Assembler

4.2. Application Software

Application Software enables the users to accomplish certain specific tasks. It

utilizes the capacities of a computer directly to dedicated task.

4.2.1. Package Software

Package Software is mainly designed by software companies to generalize

tasks. Hence it is also called general purpose software.

Common types of Package Software are:

Word Processing Software: This software enables the users to create and edit

documents. Eg: MS-Word, WordPad, Notepad, etc.

Database Software: Database Software allows the users to store and retrieve

data from databases. Eg: Oracle, MS Access, etc.

Spreadsheet Software: Spreadsheet software allows users to perform

calculations. They simulate paper worksheets by displaying multiple cells that

make up grid. Eg: MS-Excel, Lotus 1-2-3, etc.

Multimedia Software: They allow the user to crate and play audio and video

media. Players, Converter, burners, etc are some form of it. Eg: Window Media

Player, Window Movie Maker, etc.

Page 17: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 17 of 22

Presentation Software: The software that is used to display information int the

form of a slide show is known as presentation software. Eg: MS- Powerpoint.

4.2.2. Tailored Software

The software which are developed in high level language such as java, c, etc for

specific task is called Tailored Software. Eg: Banking Software, Billing software,

Ticketing Software, etc.

4.3. Computer Virus

Computer Virus is a kind of program that destroys the functioning power of

computer smoothly. There are 2 types of Virus according to functioning property:

Compiled Virus: which are executed by the operating system.

Interpreted Virus: which are executed by an application.

4.4. Antivirus

Antivirus software is a type of utility used for scanning and removing virus from your

computer. While many types of antivirus (or "anti-virus") programs exist, their

primary purpose is to protect computers from viruses and remove any viruses that

are found. Examples of common antivirus programs include Norton Antivirus,

Kaspersky Anti-Virus, NOD32 Antivirus, etc.

Page 18: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 18 of 22

5. Operating System

Operating System is the System Software which is designed to control the hardware of a

specific data-processing system in order to allow users and application programs to

make use of it. Eg: Linux, Mac OS, Microsoft Windows, etc.

5.1. Types of Operating System

Operating system is Categorized into 3 major group.

A. Based on processing method

a) Batch Processing

Batch Processing OS allowed to run only one program at a time. Batch processing

OS works on a series of programs which are held in queue. The jobs with similar

requirements were batched together and run as a group is called batch

processing. EG: an operator receives jobs in the series like FORTRAN, COBOL,

FORTRAN, FORTRAN and COBOL programs to run. If operator execute these

program on the same order. The operator has to run FORTRAN terminates it and

start COBOL again reloads FORTRAN and so on. If the operator runs 3 FORTRAN

and 2 COBOL programs as batch, this will save operator time.

b) Multitasking/ Multiprogramming

A running state of a program is called a task. Any operating System which

supports two or more active task or running programs simultaneously is called

multitasking operating system. It is also called Multiprogramming OS. EG: if any

operating system can run more than one program like word, spreadsheet, etc at

one monitor is called Multitasking OS.

c) Time sharing operating system

Time sharing OS is a kind of Multiprogramming OS which operates in an

interactive mode with quick response time. It allows the many users to

simultaneously share the computer resources. Eg: As the CPU switches rapidly

from one user to another user, each user feels that he/she has using his/her own

computer, which is actually one computer and its resources are shared among

many user by the help of OS.

d) Real Time Operating System (RTOS)

The primary objective of RTOS is to provide quick response time. RTOS is another

form of OS which monitors various input variables and process in short time or

within certain deadlines and performs its function.EG: Application used in flight

control, missile guidance, etc.

e) Multiprocessing operating system

Any Operating System which is capable of handling more than one processor and

its resources efficiently is called multiprocessing OS. It manages all available

Page 19: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 19 of 22

resources and schedules its function to program execution and interaction with

users.

B. Based on User Interface

a) CUI or CLI

CUI= Character User Interface

CLI= Command Line Interface

If the primary method of communication with the computer system is command

or text based system then this type of OS is called CUI or CLI. Eg: DOS, UNIX,etc.

b) GUI ( Graphical User Interface)

A visual computing environment that represents programs, files and options with

graphical images such as icons, menus and dialog boxes on the screen is called

GUI. Eg: Mac OS, MS Windows, etc.

C. Based on the mode of user

a) Single user OS

The OS which allows exactly one user at a time to operate Computer System at a

time is called Single user OS. Eg: MS-DOS, Windows 7, Windows XP, etc.

b) Multiuser OS

An Operating System that allows multiple users to user single computer

resources simultaneously on a single network server is called Multiuser OS. Eg:

UNIX, LINUX, etc.

5.2. DOS ( Disk Operating System )

DOS is a single user, and single task operating system. DOS was used in two versions

Microsoft version called MS-DOS and IBM version called PC-DOS. It has text based

user interface Ie. User has to use and type commands by using keyboard to get

computer response.

5.3. Windows

Window is an operating system which is an interface or bridge between computer

hardware and software, the hardware is really hard to understand, by using the

software we made soften the things and forgot about the hardness of hardware so

window is and user friendly interface between computer and user. It is a rectangular

area showing an application, document, contents of a folder or a dialog box when

you start computer. The Windows developed by Microsoft are listed below:

1) Windows 1.0, 2.0, 2.1x

2) Windows 3.0 and 3.1x

3) Windows 9x (95,98,ME)

4) Windows NT

5) Windows XP, Vista,7,

Page 20: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 20 of 22

6) Windows 8

5.4. Linux

Linux is a Unix-like operating System(OS) created by Linus Torvalds. He developed Linux

because he wasn't happy with the currently available options in Unix and felt he could

improve it. So he did what anybody else would do, and created his own operating

system.

When Linus finished building a working version of Linux, he freely distributed the OS,

which helped it gain popularity. Today, Linux is used by millions of people around the

world. Many computer hobbyists (a.k.a. nerds) like the operating system because it is

highly customizable. Programmers can even modify the source code and create their

own unique version of the Linux operating system. Web hosting companies often Install Linux on their Web servers because Linux-based

servers are cheaper to set up and maintain than Windows-based servers. Since the Linux

OS is freely distributed, there are no licensing fees. This means Linux servers can host

hundreds or even thousands of websites at no additional cost. Windows servers, on the

other hand, often require user licenses for each website hosted on the server.

Some of the linux OS are:

1) Red Hat Enterprise

2) CentOS

3) Ubuntu/Kubuntu

4) Debian

5) openSUSE

5.5. Mac OS

This is the operating system that runs on Macintosh computers. The company

dubbed it "Mac OS X," correctly pronounced "Mac OS 10." Unlike earlier versions of

the Mac OS, Mac OS X is based on the same kernel as Unix and has many advanced

administrative features and utilities. Though the operating system is much more

advanced than earlier versions of the Mac OS, it still has the same ease-of-use that

people have come to expect from Apple software.

The Windows developed by Microsoft are listed below:

1) Mac OS 8

2) Mac OS 9

3) Mac OS X (10)

5.6. Function of Operating System

Most of the Operating System can do following functions:

a) Process Management

Currently executing program or program segment inside CPU is called the

process. Process Management main concern is the execution of user programs

and system activities. This activities is called process. The process have 5 stage:

new, ready, running, waiting, end.

Page 21: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 21 of 22

New state: is the staring of any new program or application which want

microprocessor time.

Ready state: is the state lined for microprocessor time.

Running State: indicate job is being executing in the microprocessor.

Waiting State: pausing of the process execution on microprocessor.

End State: indicates the process has no longer exists on the microprocessor for

execution.

b) Memory Management

The OS mange all the memory devices like primary memory ( RAM and ROM).

Related to Memory Management, OS does following function:

i. Keep track which memory segment is using by whom.

ii. Manages for blank memory space available.

iii. Allocate and de-allocate memory space as needed.

iv. Decides location for storage of new program.

c) Storage Management

The OS also manage the secondary storage device like Hard disk. Related to

secondary device, OS is responsible for:

i. Free space, file and folders management.

ii. Reading and writing of data from disk and to the disk.

iii. Storage allocation and de-allocation

iv. Management of disk scheduling, formatting, cleanup and fragmentation.

d) Input/output Management

The OS plays a vital role in the management of input device like keyboard,

mouse, etc and output devices like monitor, printer, etc. Related to I/O

Management, OS is responsible for

i. To activate general device driver software.

ii. To run driver software for specific hardware when required.

iii. To manage buffer catching system for temporarily hold data and

information.

e) File Management

Files and Folder management is one of the most visible service of operating

system. Related to File and Folder Management, OS responsible for:

i. Creation and deletion of File and folder

ii. Support for manipulation of files and folder

iii. Backup files on non-volatile storage device.

iv. Mapping of files into disk storage.

v. Manages all system files and folders and protect it from unnecessary

deletion and modification

Page 22: 1. Digital Logic Function and Boolean Algebra

FCH 1: Fundamental of Computer

Instructor: Saroj Maharjan Page| 22 of 22

f) Protection and Security

Protection is the process of securing the data and information from

unauthorized users. Related to Protection and security, OS responsible for:

i. Protection and security of files and directories.

ii. Hiding system files and directories from unwanted modification or deletion

iii. Preventing theft, corruption and loss of data

iv. Ensuring user authentication by promoting username and password

g) Network Management

A collection of autonomous computer system is called computer network.

Autonomous means each computer has its own local resources. Related to

network management, OS responsible for:

i. Sharing of resource even hardware or software.

ii. Sharing of data, information, files, etc.

iii. To generate communication medium

iv. To create single computer to server various workstations

v. To increase computational speed.

vi. To generate data availability and reliability.

h) Command Interpretation

The command is an input signal for the computer, on the basis of this command

computer produces its output. Related to command interpretation, OS

responsible for:

i. To translate the user command in computer readable form.

ii. Management of interface between hardware and peripheral devices like

printer, etc.

i) Virtual Memory Management

The OS manages the workable space by combining secondary storage device

and primary memory is called Virtual Memory. Related to Virtual Memory

Management, OS is responsible for:

i. Creating virtual memory by using two common methods paging and

segmentation techniques

ii. Maximum utilization of the primary and secondary memory

iii. For efficient execution of program on computer system even though it has

less amount of primary memory.

j) Backup and Recovery

Backup is the process of storing data and information on the drive. Recovery is

the process generating information from the stored devices. Backup and

Recovery ensures from the loosing data and provide facilities to come back

previous recovery point.