Computer - Module 3

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 72

COMPUTER APPLICATIONS IN BUSINESS

Course Code:BCHCS 10001

Module III
Total Number of Lectures Required=5
LECTURE-I
1. Computer hardware and software.
2. Application software.
LECTURE-II
3. Operating system.
4. Computer program.
5. Machine language and high level language.
LECTURE-III
6. Computer virus, Antivirus and Computer security.
LECTURE-IV
7. Elements of MS DOS and Windows OS.
8. Computer arithmetic. Binary, octal and hexadecimal number
systems.
LECTURE-V
9. Algorithm and flowcharts. Illustrations.
10. Elements of database and its applications.
11. MCQ
12. KEY of MCQ
-Dr. Puja Singhal
LECTURE-I
Objective of this Lecture

• Computer hardware and software.


• Application software.
1 Computer hardware and software.
• Computer Hardware
• A personal computer is made up of multiple physical components of
computer hardware, upon which can be installed an operating system and
a multitude of software to perform the operator's desired functions.
Hardware is a physical device something that you're able to touch and see.
For example, the computer monitor you're viewing this text on or the
mouse you're using to navigate is considered computer hardware.
• Computer Software
• Software is code and instructions that tell a computer and/or hardware how
to operate. This code can be viewed and executed using a computer or
other hardware device. However, without any hardware software would
not exist. An examples of software is Microsoft Windows, an operating
system that allows you to control your computer and other programs that
run on it. Another example of software is the Internet browser you're using
to view this page.
Layers and Views of a
Computer System

End
User

Programmer

Application
Programs

Operating-
Utilities System
Designer

Operating-System

Computer Hardware
• Computer software, or just software is a general term primarily
used for digitally stored data such as computer programs and other
kinds of information read and written by computers. Today, this
includes data that has not traditionally been associated with
computers, such as film, tapes and records. The term was coined in
order to contrast to the old term hardware (meaning physical
devices); in contrast to hardware, software is intangible, meaning it
"cannot be touched".
• Practical computer systems divide software systems into three
major classes
• system software
• programming software
• application software
• System software is computer software designed to operate the
computer hardware and to provide and maintain a platform for
running application software.
• The most important types of system software are:
• The computer BIOS and device firmware, which provide basic
functionality to operate and control the hardware connected to or
built into the computer.
• The operating system (prominent examples being Microsoft
Windows, Mac OS X and Linux), which allows the parts of a
computer to work together by performing tasks like transferring data
between memory and disks or rendering output onto a display
device. It also provides a platform to run high-level system software
and application software.
• Utility software, which helps to analyze, configure, optimize and maintain
the computer.
• The purpose of systems software is to unburden the applications
programmer from the often complex details of the particular computer
being used, including such accessories as communications devices,
printers, device readers, displays and keyboards, and also to partition the
computer's resources such as memory and processor time in a safe and
stable manner. Examples are- Windows XP, Linux, and Mac OS X.
• Programming software
• A programming tool or software development tool is a program or
application that software developers use to create, debug, maintain, or
otherwise support other programs and applications. The term usually refers
to relatively simple programs that can be combined together to accomplish
a task, much as one might use multiple hand tools to fix a physical object.
The tools include: compilers ,debuggers ,interpreters ,linkers ,text editors ,
An Integrated development environment (IDE) is a single application that
attempts to manage all these functions.
2Application software

Application software
Application software is computer software designed to help the user perform a
particular task. Such programs are also called software applications,
applications or apps. Typical examples are word processors, spreadsheets,
media players and database applications.
Application software should be contrasted with system software
(infrastructure) or middleware (computer services/ processes integrators),
which is involved in integrating a computer's various capabilities, but
typically does not directly apply them in the performance of tasks that
benefit the user. A simple, if imperfect analogy in the world of hardware
would be the relationship of an electric light bulb (an application) to an
electric power generation plant (a system). The power plant merely
generates electricity, not itself of any real use until harnessed to an
application like the electric light that performs a service that benefits the
user.
LECTURE-II
Objective of this Lecture

3. Operating system.
4. Computer program.
5. Machine language and high level language.
3 Operating System
• An operating system (OS) is an interface between hardware and user which is
responsible for the management and coordination of activities and the sharing
of the resources of a computer, that acts as a host for computing applications
run on the machine. As a host, one of the purposes of an operating system is to
handle the resource allocation and access protection of the hardware. This
relieves application programmers from having to manage these details.
• Operating systems offer a number of services to application programs and
users. Applications access these services through application programming
interfaces (APIs) or system calls. By invoking these interfaces, the application
can request a service from the operating system, pass parameters, and receive
the results of the operation. Users may also interact with the operating system
with some kind of software user interface like typing commands by using
command line interface (CLI) or using a graphical user interface. For hand-
held and desktop computers, the user interface is generally considered part of
the operating system. On large multi-user systems like Unix and Unix-like
systems, the user interface is generally implemented as an application program
that runs outside the operating system.
• The below diagram gives a graphical depiction of the interfaces between the
operating system and the computer component.
• Characteristics of an Operating System are:
• Whether multiple programs can run on it simultaneously: multi-
tasking
• Whether it can take advantage of multiple processors: multi-
processing
• Whether multiple users can run programs on it simultaneously:
multi-user
• Whether it can reliably prevent application programs from directly
accessing hardware devices: protected
• Whether it has built-in support for graphics.
• Whether it has built-in support for networks.
Important functions of Operating system :

1)Job Management
Job management controls the order and time in which programs are
run and is more sophisticated in the mainframe environment where
scheduling the daily work has always been routine. IBM's job control
language (JCL) was developed decades ago. In a desktop environment,
batch files can be written to perform a sequence of operations that can
be scheduled to start at a given time.
2) Task Management
Multitasking, which is the ability to simultaneously execute multiple
programs, is available in all operating systems today. Critical in the
mainframe and server environment, applications can be prioritized to
run faster or slower depending on their purpose. In the desktop world,
multitasking is necessary for keeping several applications open at the
same time so you can bounce back and forth among them.
3) Data Management
Data management keeps track of the data on disk, tape and optical storage
devices. The application program deals with data by file name and a
particular location within the file. The operating system's file system
knows where that data are physically stored (which sectors on disk) and
interaction between the application and operating system is through the
programming interface. Whenever an application needs to read or write
data, it makes a call to the operating system
4) Device Management
Device management controls peripheral devices by sending them
commands in their own proprietary language. The software routine that
knows how to deal with each device is called a "driver," and the OS
requires drivers for the peripherals attached to the computer. When a new
peripheral is added, that device's driver is installed into the operating
system.
5) User Interface
All graphics based today, the user interface includes the windows, menus
and method of interaction between you and the computer. Prior to
graphical user interfaces (GUIs), all operation of the computer was
performed by typing in commands. Not at all extinct, command-line
interfaces are alive and well and provide an alternate way of running
programs on all major operating systems. Operating systems may support
optional interfaces, both graphical and command line. Although the
overwhelming majority of people work with the default interfaces,
different "shells" offer variations of appearance and functionality.
6) Security
Operating systems provide password protection to keep unauthorized users
out of the system. Some operating systems also maintain activity logs and
accounting of the user's time for billing purposes. They also provide
backup and recovery routines for starting over in the event of a system
failure.
4 Computer program

Computer programs (also software programs, or just programs) are


instructions for a computer. A computer requires programs to function,
typically executing the program's instructions in a central processor. The
program has an executable form that the computer can use directly to
execute the instructions. The same program in its human-readable source
code form, from which executable programs are derived (e.g., compiled),
enables a programmer to study and develop its algorithms.
Computer source code is often written by professional computer
programmers. Source code is written in a programming language that
usually follows one of two main paradigms: imperative or declarative
programming. Source code may be converted into an executable file
(sometimes called an executable program or a binary) by a compiler and
later executed by a central processing unit. Alternatively, computer
programs may be executed with the aid of an interpreter, or may be
embedded directly into hardware.
5 Machine language and high level language.

Machine language

• Machine code or machine language is a system of instructions and data


executed directly by a computer's central processing unit. Machine code
may be regarded as a primitive (and cumbersome) programming
language or as the lowest-level representation of a compiled and/or
assembled computer program. Programs in interpreted languages are
not represented by machine code however, although their interpreter
(which may be seen as a processor executing the higher level program)
often is. Machine code is sometimes called native code when referring
to platform-dependent parts of language features or libraries. Machine
code should not be confused with so called "byte code", which is
executed by an interpreter.
Machine code instructions
Every processor or processor family has its own machine code instruction
set. Instructions are patterns of bits that by physical design correspond to
different commands to the machine. The instruction set is thus specific to a
class of processors using (much) the same architecture. Successor or
derivative processor designs often include all the instructions of a
predecessor and may add additional instructions. Occasionally a successor
design will discontinue or alter the meaning of some instruction code
(typically because it is needed for new purposes), affecting code
compatibility to some extent; even nearly completely compatible
processors may show slightly different behavior for some instructions but
this is seldom a problem. Systems may also differ in other details, such as
memory arrangement, operating systems, or peripheral devices; because a
program normally relies on such factors, different systems will typically
not run the same machine code, even when the same type of processor is
used.
• A machine code instruction set may have all instructions of the same
length, or it may have variable-length instructions. How the patterns are
organized varies strongly with the particular architecture and often also
with the type of instruction. Most instructions have one or more opcode
fields which specifies the basic instruction type (such as arithmetic, logical,
jump, etc) and the actual operation (such as add or compare) and other
fields that may give the type of the operand(s), the addressing mode(s), the
addressing offset(s) or index, or the actual value itself (such constant
operands contained in an instruction are called immediates).
• Diagram of level of Languages
Assembly language

• Assembly languages are a family of low-level languages for programming


computers, microprocessors, microcontrollers, and other (usually)
integrated circuits. They implement a symbolic representation of the
numeric machine codes and other constants needed to program a particular
CPU architecture. This representation is usually defined by the hardware
manufacturer, and is based on abbreviations (called mnemonics) that help
the programmer remember individual instructions ,registers, etc. An
assembly language is thus specific to a certain physical or virtual computer
architecture (as opposed to most high-level languages, which are usually
portable).
• A utility program called an assembler is used to translate assembly
language statements into the target computer's machine code. The
assembler performs a more or less isomorphic translation (a one-to-one
mapping) from mnemonic statements into machine instructions and data.
This is in contrast with high-level languages, in which a single statement
generally results in many machine instructions.

• Many sophisticated assemblers offer additional mechanisms to facilitate


program development, control the assembly process, and aid debugging. In
particular, most modern assemblers include a macro facility (described
below), and are called macro assemblers.
High-level programming language
• A high-level programming language is a programming language with
strong abstraction from the details of the computer. In comparison to low-
level programming languages, it may use natural language elements, be
easier to use, or be more portable across platforms. Such languages hide
the details of CPU operations such as memory access models and
management of scope.
• This greater abstraction and hiding of details is generally intended to make
the language user-friendly, as it includes concepts from the problem
domain instead of those of the machine used. A high-level language
isolates the execution semantics of a computer architecture from the
specification of the program, making the process of developing a program
simpler and more understandable with respect to a low-level language. The
amount of abstraction provided defines how "high-level" a programming
language is.
Features

The term "high-level language" does not imply that the language is
superior to low-level programming languages - in fact, in terms of the
depth of knowledge of how computers work required to productively
program in a given language, the inverse may be true. Rather, "high-level
language" refers to the higher level of abstraction from machine language.
Rather than dealing with registers, memory addresses and call stacks, high-
level languages deal with usability, threads, locks, objects, variables, arrays
and complex arithmetic or boolean expressions. In addition, they have no
opcodes that can directly compile the language into machine code, unlike
low-level assembly language. Other features such as string handling
routines, object-oriented language features and file input/output may also
be present.
LECTURE-III
Objective of this Lecture

6. Computer virus, Antivirus and Computer security.


6 Computer virus, Antivirus and Computer security

Computer Virus
• A computer virus is a computer program that can copy itself and infect a
computer. The term "virus" is also commonly but erroneously used to refer
to other types of malware, adware, and spyware programs that do not have
the reproductive ability. A true virus can only spread from one computer to
another (in some form of executable code) when its host is taken to the
target computer; for instance because a user sent it over a network or the
Internet, or carried it on a removable medium such as a floppy disk, CD,
DVD, or USB drive. Viruses can increase their chances of spreading to
other computers by infecting files on a network file system or a file system
that is accessed by another computer.
• Types of viruses
1 Resident Viruses

This type of virus is a permanent which dwells in the RAM memory. From there it
can overcome and interrupt all of the operations executed by the system: corrupting
files and programs that are opened, closed, copied, renamed etc.
Examples include: Randex, CMJ, Meve, and MrKlunky.
2 Direct Action Viruses

The main purpose of this virus is to replicate and take action when it is executed.
When a specific condition is met, the virus will go into action and infect files in the
directory or folder that it is in and in directories that are specified in the
AUTOEXEC.BAT file PATH. This batch file is always located in the root directory
of the hard disk and carries out certain operations when the computer is booted.
3 Overwrite Viruses Virus of this kind is characterized by the fact that it
deletes the information contained in the files that it infects, rendering them
partially or totally useless once they have been infected. The only way to
clean a file infected by an overwrite virus is to delete the file completely,
thus losing the original content.Examples of this virus include: Way,
Trj.Reboot, Trivial.88.D.
4 Boot Virus This type of virus affects the boot sector of a floppy or hard
disk. This is a crucial part of a disk, in which information on the disk itself
is stored together with a program that makes it possible to boot (start) the
computer from the disk.The best way of avoiding boot viruses is to ensure
that floppy disks are write-protected and never start your computer with an
unknown floppy disk in the disk drive.
Examples of boot viruses include: Polyboot.B, AntiEXE.
5 FAT Virus -The file allocation table or FAT is the part of a disk used to
connect information and is a vital part of the normal functioning of the
computer. This type of virus attack can be especially dangerous, by
preventing access to certain sections of the disk where important files are
stored. Damage caused can result in information losses from individual files
or even entire directories.
6 WormsA worm is a program very similar to a virus; it has the ability to
self-replicate, and can lead to negative effects on your system and most
importantly they are detected and eliminated by antiviruses.
Examples of worms include: PSWBugbear.B, Lovgate.F, Trile.C, Sobig.D,
Mapson.
7 Trojans or Trojan HorsesAnother unsavory breed of malicious code are
Trojans or Trojan horses, which unlike viruses do not reproduce by
infecting other files, nor do they self-replicate like worms.
Antivirus
• Antivirus (or anti-virus) software is used to prevent, detect, and remove
malware, including computer viruses, worms, and trojan horses. Such
programs may also prevent and remove adware, spyware, and other forms
of malware.
• A variety of strategies are typically employed. Signature-based detection
involves searching for known malicious patterns in executable code.
However, it is possible for a user to be infected with new malware in
which no signature exists yet. To counter such so-called zero-day threats,
heuristics can be used. One type of heuristic approach, generic signatures,
can identify new viruses or variants of existing viruses by looking for
known malicious code (or slight variations of such code) in files. Some
antivirus software can also predict what a file will do if opened/run by
emulating it in a sandbox and analyzing what it does to see if it performs
any malicious actions. If it does, this could mean the file is malicious.
Computer security
• Computer security is a branch of computer technology known as
information security as applied to computers and networks. The objective
of computer security includes protection of information and property from
theft, corruption, or natural disaster, while allowing the information and
property to remain accessible and productive to its intended users. The
terms computer system security, means the collective processes and
mechanisms by which sensitive and valuable information and services are
protected from publication, tampering or collapse by unauthorized
activities or untrustworthy individuals and unplanned events respectively.
• Computer security is frequently associated with three core areas, which can be
conveniently summarized by the acronym "CIA":
• Confidentiality -- Ensuring that information is not accessed by unauthorized
persons
• Integrity -- Ensuring that information is not altered by unauthorized persons
in a way that is not detectable by authorized users
• Authentication -- Ensuring that users are the persons they claim to be

• A strong security protocol addresses all three of these areas. Take, for
example, Netscape's SSL (Secure Sockets Layer) protocol. It has enabled an
explosion in ecommerce which is really about trust (or more precisely, about
the lack of trust). SSL overcomes the lack of trust between transacting parties
by ensuring confidentiality through encryption, integrity through checksums,
and authentication via server certificates
• Computer security is not restricted to these three broad concepts. Additional
ideas that are often considered part of the taxonomy of computer security
include:
• Access control -- Ensuring that users access only those resources and
services that they are entitled to access and that qualified users are not denied
access to services that they legitimately expect to receive
• Nonrepudiation -- Ensuring that the originators of messages cannot deny
that they in fact sent the messages
• Availability -- Ensuring that a system is operational and functional at a
given moment, usually provided through redundancy; loss of availability is
often referred to as "denial-of-service“
• Privacy -- Ensuring that individuals maintain the right to control what
information is collected about them, how it is used, who has used it, who
maintains it, and what purpose it is used for
LECTURE-IV
Objective of this Lecture

7. Elements of MS DOS and Windows OS.


8. Computer arithmetic. Binary, octal and hexadecimal
number systems.
7 Elements of MS DOS and Windows OS.

• To begin to understand DOS commands, you first need to


know a few fundamental facts:
• DOS requires that you use a specific set of rules, or syntax, when
you issue commands.
• All DOS commands begin with a keyword that identifies the action you
want performed.
• Parameters, which are a part of a command's syntax, refine the
way a command is executed.
Major components of DOS operating system and how these major
components allow DOS to accomplish its tasks. Two Major
Categories:
1) User Interaction with DOS.
2) DOS interaction with hardware.
• User Interaction with DOS
• 1. COMMAND.COM - located in the root directory of the C:\ drive on
a DOS-based computer system, is the primary vehicle for allowing
you to communicate with your computer, and vice versa. Also
known as the Command Interpreter, or the Command Processor.
• 2.When dealing with the user, the command interpreter presents a
command-line prompt C:\ and waits for a user to type in a command
next to the Prompt.
• 3. On the other side of the command interpreter are actual DOS
system files. These files communicate with the hardware and BIOS.
• 4. COMMAND.COM takes commands issued by the user through
their text strings and translate them into calls that can be
understood by lower layers of DOS.
• 5. Single interface to allow DOS users to do their work completely
unaware of what part of operating system is performing the tasks
they are requesting.
• DOS Interaction with Hardware
• 1. The DOS system files then communicate with the special memory
of the computer.
• 2. The special memory is called ROM (Read-Only Memory) and it
contains information that was written to it at the factory.
• 3. ROM BIOS (Basic Input/Output System). All requests to access
hardware and all responses from the hardware goes through the
BIOS.
• Windows
• Windows is a personal computer operating system from Microsoft
that, together with some commonly used business applications such
as Microsoft Word and Excel, has become a de facto "standard" for
individual users in most corporations as well as in most homes.
• The original 1985 version of Windows introduced to home and
business PC users many of the graphical user interface (GUI) ideas
that were developed at an experimental lab at Xerox and introduced
commercially by Apple's Lisa and Macintosh computers.
• Some of the well-known versions of Windows have included:
Windows 95,Windows 98,Windows NT, Windows 2000 ,Window ME,
Window XP, Window XP
• - Vista, formerly code named Longhorn, is the most recent of
Microsoft's Windows desktop operating systems. Vista was released
for businesses, the holders of most volume licenses, on November
30, 2006. Bill Gates hosted the worldwide launch of Windows Vista
and Microsoft Office 2007 in Times Square on January 29, 2007.
Vista ships in nine different versions that fall under the main
categories of home edition and business edition.
• The most noticeable change from Windows XP to Vista is a
significantly redesigned user interface called Aero, which stands for
"authentic, energetic, reflective and open." Other additions include a
faster and customizable search engine and an XML-based
specification for creating documents similar to Portable Document
Format (PDF) files.
8 Computer arithmetic- Binary, octal and hexadecimal
number systems.

• Because electronic logic deals with currents that are on or off, it has
been found convenient to represent quantities in binary form to
perform arithmetic on a computer. Thus, instead of having ten
different digits, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, in binary arithmetic,
there are only two different digits, 0 and 1, and when moving to the
next column, instead of the digit representing a quantity that is ten
times as large, it only represents a quantity that is two times as
large. Thus, the first few numbers are written in binary as follows:
• Decimal Binary
• Zero 0 0 Seven 7 111
• One 1 1 Eight 8 1000
• Two 2 10 Nine 9 1001
• Three 3 11 Ten 10 1010
• Four 4 100 Eleven 11 1011
• Five 5 101 Twelve 12 1100
• Six 6 110
• Binary addition
• In binary addition only 0's and 1's can be used, instead of the whole
spectrum of 0-9. This actually makes binary addition much simpler
than decimal addition, as we only need to remember the following:
• 0+0=0
0+1=1
1+0=1
1 + 1 = 10
• As an example of binary addition we have,
•   101
+101
1010
• Binary multiplication  is actually much simpler than decimal multiplication. In
the case of decimal multiplication, we need to remember 3 x 9 = 27, 7 x 8 = 56,
and so on. In binary multiplication, we only need to remember the following,

• 0x0=0
0x1=0
1x0=0
1x1=1

• Example
•   101
  x11
  101
1010
1111
• Binary division  is almost as easy, and involves our knowledge of
binary multiplication. Take for example the division of 1011 into 11.

•           11   R=10


 11 )1011
        -11
         101
          -11
           10  <-- remainder, R
• To check our answer, we first multiply our divisor 11 by our quotient 11.
Then we add its' product to the remainder 10, and compare it to our
dividend of 1011.
•      11
  x 11
     11
   11 
  1001  <-- product of 11 and 11

•  1001
 +  10
  1011  <-- sum of product and remainder

• The sum is equal to our initial dividend, therefore our solution is correct.
• Decimal to binary follows a straightforward method. It involves dividing the
number to be converted, say N, by 2 (since binary is in base 2), and making note of
the remainder. We continue dividing the quotient (N / 2) by 2, until we reach the
division of (1 / 2), also making note of all remainders.
• Example 1: Convert 98 from decimal to binary.
• 1) Divide 98 by 2, making note of the remainder. Continue dividing quotients by 2,
making note of the remainders. Also note the star (*) beside the last remainder.
• Division Remainder
• 98/2=49 0
• 49 / 2 = 24 1
• 24/2=12 0
• 12/2=6 0
• 6/2=3 0
• 3/2=1 1
• ½=1 1*
• 2) The sequence of remainders going up gives the answer. Starting from 1*,
we have 1100010. Therefore, 98 in decimal is 1100010 in binary.
Convert Binary to decimal

Q Convert the binary number 100110112 to decimal.


Solution
• List the powers of two from right to left. Start at 20, evaluating it as
"1". Increment the exponent by one for each power. Stop when the
amount of elements in the list is equal to the amount of digits in the
binary number. The example number, 10011011, has eight digits, so
the list, to eight elements, would look like this: 128, 64, 32, 16, 8, 4,
2, 1
Octal Number system
• The octal numeral system, or oct for short, is the base-8 number system,
and uses the digits 0 to 7. Numerals can be made from binary numerals by
grouping consecutive binary digits into groups of three (starting from the
right). For example, the binary representation for decimal 74 is 1001010,
which can be grouped into (00)1 001 010 — so the octal representation is
112.
• Decimal to Octal conversion Method of successive division by 8
• To convert integer decimals to octal, divide the original number by the
largest possible power of 8 and successively divide the remainders by
successively smaller powers of 8 until the power is 1. The octal
representation is formed by the quotients, written in the order generated by
the algorithm.
• For example, to convert 12510 to octal:
• 125 / 8^2 = 1
125 − ((8^2)*1) = 61
• 61 / 8^1 = 7
• 61 − ((8^1)*7) = 5
• Thus: 12510 = 1758
Octal to Decimal conversion
• Example: Convert 7648 to decimal:
• 7648 = 7 x 8² + 6 x 8¹ + 4 x 8° = 448 + 48 + 4 = 50010
• For double-digit octal numbers this method amounts to multiplying the
lead digit by 8 and adding the second digit to get the total.
• Example: 658 = 6x8 + 5 = 5310
Octal to Binary Conversion -To convert octal to binary, replace each
octal digit by its binary representation.
Example: Convert 518 to binary:
58 = 1012
18 = 0012
Thus: 518 = 101 0012
Binary to Octal conversion -The process is the reverse of the previous
algorithm. The binary digits are grouped by threes, starting from the decimal
point and proceeding to the left and to the right. Add leading 0s (or trailing
zeros to the right of decimal point) to fill out the last group of three if
necessary. Then replace each trio with the equivalent octal digit.
For instance, convert binary 1010111100 to octal:
001 010 111 100
1 2 7 4 Thus 10101111002 = 12748
Octal to Hexadecimal conversion The conversion is made in two
steps using binary as an intermediate base. Octal is converted to
binary and then binary to hexadecimal, grouping digits by fours,
which correspond each to a hexadecimal digit.
For instance, convert octal 1057 to hexadecimal:
• To binary: 1 0 5 7
• 001 000 101 111
– then to hexadecimal: 0010 0010 1111
» 2 2 F
» Thus 10578 = 22F16
Hexadecimal Number System
• In mathematics and computer science, hexadecimal (also base 16, or hex)
is a positional numeral system with a radix, or base, of 16. It uses sixteen
distinct symbols, most often the symbols 0–9 to represent values zero to
nine, and A, B, C, D, E, F (or alternatively a through f) to represent values
ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in
decimal, to (2 × 163) + (10 × 162) + (15 × 16) + 3, or 10,995.
• Each hexadecimal digit represents four binary digits (bits) (also called a
"nibble"), and the primary use of hexadecimal notation is as a human-
friendly representation of binary coded values in computing and digital
electronics. For example, byte values can range from 0 to 255 (decimal)
but may be more conveniently represented as two hexadecimal digits in the
range 00 through FF. Hexadecimal is also commonly used to represent
computer memory addresses.
• Binary to Hex Conversion
• It is easy to convert from an integer binary number to hex. This is
accomplished by:
• Break the binary number into 4-bit sections from the LSB to the
MSB.
• Convert the 4-bit binary number to its Hex equivalent.
• For example, the binary value 1010111110110010 will be written:
• 1010 1111 1011 0010
• A F B 2
• Hex to Binary Conversion
• It is also easy to convert from an integer hex number to binary.
This is accomplished by:
• Convert the Hex number to its 4-bit binary equivalent.
• Combine the 4-bit sections by removing the spaces.
• For example, the hex value $AFB2 will be written:
A F B 2
1010 1111 1011 0010
This yields the binary number 1010111110110010.
• Hex to Decimal Conversion
• To convert from Hex to Decimal, multiply the value in each position by its
hex weight and add each value. Using the value from the previous
example, $AFB2, we would expect to obtain the decimal value 44978.
(A*163) + (F*162) + ( B*161) + (2*160) =
(10*4096) + (15*256) + (11*16) + (2*1) =
40960 + 3840 + 176 + 2 = 44978
• Decimal to Hex Conversion
• To convert decimal to hex is slightly more difficult. The typical method to
convert from decimal to hex is repeated division by 16. While we may also
use repeated subtraction by the weighted position value, it is more difficult
for large decimal numbers.
• Repeated Division By 16
• For this method, divide the decimal number by 16, and write the remainder
on the side as the least significant digit. This process is continued by
dividing the quotient by 16 and writing the remainder until the quotient is
0. When performing the division, the remainders which will represent the
hex equivalent of the decimal number are written beginning at the least
significant digit (right) and each new digit is written to the next more
significant digit (the left) of the previous digit. Consider the number
44978.
• Division Quotient Remainder Hex Number
• 44978 / 16 2811 2 2
• 2811 / 16 175 11 B2
• 175 / 16 10 15 FB2
• 10 / 16 0 10 AFB2
LECTURE-V
Objective of this Lecture

9. Algorithm and flowcharts. Illustrations.


10. Elements of database and its applications.
11. MCQ
9 Algorithm and flowcharts. Illustrations.

• In mathematics, computing, and related subjects, an algorithm is an


effective method for solving a problem using a finite sequence of
instructions. Algorithms are used for calculation, data processing, and many
other fields. Each algorithm is a list of well-defined instructions for
completing a task. Starting from an initial state, the instructions describe a
computation that proceeds through a well-defined series of successive
states, eventually terminating in a final ending state. The transition from one
state to the next is not necessarily deterministic; some algorithms, known as
randomized algorithms, incorporate randomness.
• A flowchart is a graphical representation of an algorithm. These flowcharts
play a vital role in the programming of a problem and are quite helpful in
understanding the logic of complicated and lengthy problems. Once the
flowchart is drawn, it becomes easy to write the program in any high level
language. Often we see how flowcharts are helpful in explaining the
program to others. Hence, it is correct to say that a flowchart is a must for
the better documentation of a complex program. Flowcharts are usually
drawn using some standard symbols; (explain in next slide)
• Start or end of the program

Computational steps or processing


function of a program

Input or output operation

Decision making and branching

Connector or joining of two parts of


program
•  The following are some guidelines in flowcharting:
a. In drawing a proper flowchart, all necessary requirements should
be listed out in logical order.
b. The flowchart should be clear, neat and easy to follow. There
should not be any room for ambiguity in understanding the
flowchart.
c. The usual direction of the flow of a procedure or system is from
left to right or top to bottom.
d. Only one flow line should come out from a process symbol.
e. Only one flow line should enter a decision symbol, but two or
three flow lines, one for each possible answer, should leave the
decision symbol.
f Only one flow line is used in conjunction with terminal symbol.
g If the flowchart becomes complex, it is better to use connector
symbols to reduce the number of flow lines. Avoid the intersection
of flow lines if you want to make it more effective and better way
of communication.
h Ensure that the flowchart has a logical start and finish.
I It is useful to test the validity of the flowchart by passing through it
with a simple test data.
• Example of a flowchart:
• Problem 1: Write an algorithm and draw the flowchart for
finding the average of two numbers
• Algorithm START

• Input: two numbers x and y


Input x
• Output: the average of x and y
• Steps Input y

1. input x Sum = x + y
2. input y
3. sum = x + y Average = sum/2

4. average = sum /2 Output


5. output average Averag
e

END
10 Elements of database and its applications.

• A database is an integrated collection of logically-related records or files


consolidated into a common pool that provides data for one or more
multiple uses.
• A Database Management System (DBMS) is a set of computer programs
that controls the creation, maintenance, and the use of the database with
computer as a platform or of an organization and its end users. It allows
organizations to place control of organization-wide database development in
the hands of database administrators (DBAs) and other specialists. A DBMS
is a system software package that helps the use of integrated collection of
data records and files known as databases. It allows different user
application programs to easily access the same database. DBMSs may use
any of a variety of database models, such as the network model or relational
model. In large systems, a DBMS allows users and other software to store
and retrieve data in a structured way. Instead of having to write computer
programs to extract information, user can ask simple questions in a query
language. Thus, many DBMS packages provide Fourth-generation
programming language (4GLs) and other application development features.
• It helps to specify the logical organization for a database and access and
use the information within a database. It provides facilities for controlling
data access, enforcing data integrity, managing concurrency controlled,
restoring database. Example of database of Employee
Components of DBMS
• DBMS Engine accepts logical request from the various other DBMS
subsystems, converts them into physical equivalent, and actually
accesses the database and data dictionary as they exist on a
storage device.
• Data Definition Subsystem helps user to create and maintain the
data dictionary and define the structure of the files in a database.
• Data Manipulation Subsystem helps user to add, change, and
delete information in a database and query it for valuable
information. Software tools within the data manipulation subsystem
are most often the primary interface between user and the
information contained in a database. It allows user to specify its
logical information requirements.
• Application Generation Subsystem contains facilities to help users to
develop transactions-intensive applications. It usually requires that user
perform a detailed series of tasks to process a transaction. It facilities easy-
to-use data entry screens, programming languages, and interfaces.
• Data Administration Subsystem helps users to manage the overall
database environment by providing facilities for backup and recovery,
security management, query optimization, concurrency control, and change
management.
DBMS features and capabilities
• Query ability  Querying is the process of requesting attribute information
from various perspectives and combinations of factors. Example: "How
many 2-door cars in Texas are green?" A database query language and
report writer allow users to interactively interrogate the database, analyze its
data and update it according to the users privileges on data.
• Backup and replication -Copies of attributes need to be made regularly in
case primary disks or other equipment fails. A periodic copy of attributes
may also be created for a distant organization that cannot readily access the
original. DBMS usually provide utilities to facilitate the process of
extracting and disseminating attribute sets. When data is replicated between
database servers, so that the information remains consistent throughout the
database system and users cannot tell or even know which server in the
DBMS they are using, the system is said to exhibit replication transparency.
• Security  -Often it is desirable to limit who can see or change which
attributes or groups of attributes. This may be managed directly by
individual, or by the assignment of individuals and privileges to groups, or
(in the most elaborate models) through the assignment of individuals and
groups to roles which are then granted entitlements.
• Computation  There are common computations requested on attributes
such as counting, summing, averaging, sorting, grouping, cross-referencing,
etc. Rather than have each computer application implement these from
scratch, they can rely on the DBMS to supply such calculations.


• Change and access logging - Often one wants to know who accessed what
attributes, what was changed, and when it was changed. Logging services allow this
by keeping a record of access occurrences and changes.
• Automated optimization - If there are frequently occurring usage patterns or
requests, some DBMS can adjust themselves to improve the speed of those
interactions. In some cases the DBMS will merely provide tools to monitor
performance, allowing a human expert to make the necessary adjustments after
reviewing the statistics collected.
• Applications of Database
• Databases function in many applications, spanning virtually the entire range of
computer software. Databases have become the preferred method of storage for
large multi-user applications, where coordination between many users is
needed. Even individual users find them convenient, and many electronic mail
programs and personal organizers are based on standard database technology.
Software database drivers are available for most database platforms so that
application software can use a common API to retrieve the information stored in
a database. Commonly used database APIs include JDBC and ODBC.
11 Multiple Choice Questions

Q1….. is a general term primarily used for digitally stored data such as
computer programs and other kinds of information read and written by
computers
a) Computer software b) Hardware c) Operating System d) None

Q2 An operating system (OS) is an interface between …….and user


a) Software b) hardware c)Computer Program d) Application software

Q3…… are a family of low-level languages for programming computers,


microprocessors, microcontrollers, and other (usually) integrated circuits
a) Assembly languages b) Machine language c)High level language
d) C-language
Q4 This type of virus is a permanent which dwells in the RAM memory
a) FAT Virus b) Boot Virus c)Resident Virus d) File Virus
Q5 The……………, is the base-8 number system, and uses the digits 0 to 7
a)Binary Number system b) octal numeral system c) Hexadecimal Number
System d) None
Q6 An effective method for solving a problem using a finite sequence of
instructions
a) Number System b) Computer Hardware c) Operating System d)
algorithm
Q7 A ………is a graphical representation of an algorithm
a) DBMS b ) OS c) flowchart d) None
Q8A ……is an integrated collection of logically-related records or files
consolidated into a common pool that provides data for one or more
multiple uses.
a) Database b)OS c) Computer Program d) Software
Q9 PSWBugbear is an example of
a) Software b)File Virus c) WORM d) FAT virus

Q10 …….is a system of instructions and data executed directly by a


computer's central processing unit.
a) Assembly Language b) machine language c) Program d) Virus
• Key Of Module-III
1 a
2 b
3 a
4 c
5 b
6 d
7 c
8 a
9 c
10 b

You might also like