Computer -Module 3

Embed Size (px)

Citation preview

  • 8/8/2019 Computer -Module 3

    1/72

    COMPUTER APPLICATIONS IN BUSINESS

    Course Code:BCHCS 10001

    Module IIITotal 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. MCQ12. KEY of MCQ

    -Dr. Puja Singhal

  • 8/8/2019 Computer -Module 3

    2/72

    LECTURE-I

    Objective of this Lecture

    Computer hardware and software.

    Application software.

  • 8/8/2019 Computer -Module 3

    3/72

    1 Computer hardware and software.

    Computer Hardware

    A personal computer is made up of multiple physical components ofcomputer hardware, upon which can be installed an operating system anda 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 themouse you're using to navigate is considered computer hardware.

    Computer Software

    Software is code and instructions that tell a computer and/or hardware howto operate. This code can be viewed and executed using a computer or

    other hardware device. However, without any hardware software would notexist. An examples of software is Microsoft Windows, an operating systemthat 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 viewthis page.

  • 8/8/2019 Computer -Module 3

    4/72

    Layers and Views of aComputer System

    End

    User

    Programmer

    Operating-

    System

    Designer

    Computer Hardware

    Operating-System

    Utilities

    Application

    Programs

  • 8/8/2019 Computer -Module 3

    5/72

    Computer software, or just software is a general term primarilyused for digitally stored data such as computer programs and otherkinds of information read and written by computers. Today, thisincludes data that has not traditionally been associated withcomputers, such as film, tapes and records. The term was coined in

    order to contrast to the old term hardware (meaning physicaldevices); in contrast to hardware, software is intangible, meaning it"cannot be touched".

    Practical computer systems divide software systems into three majorclasses

    system software programming software

    application software

  • 8/8/2019 Computer -Module 3

    6/72

    System software is computer software designed to operate thecomputer hardware and to provide and maintain a platform forrunning application software.

    The most important types of system software are:

    The computer BIOS and device firmware, which provide basicfunctionality to operate and control the hardware connected to orbuilt into the computer.

    The operating system (prominent examples being MicrosoftWindows, Mac OS X and Linux), which allows the parts of a

    computer to work together by performing tasks like transferring databetween memory and disks or rendering output onto a displaydevice. It also provides a platform to run high-level system softwareand application software.

  • 8/8/2019 Computer -Module 3

    7/72

    Utility software, which helps to analyze, configure, optimize and maintainthe computer.

    The purpose of systems software is to unburden the applicationsprogrammer 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 thecomputer's resources such as memory and processor time in a safe andstable manner. Examples are- Windows XP, Linux, and Mac OS X.

    Programming software

    A programming tool or software development tool is a program orapplication that software developers use to create, debug, maintain, orotherwise support other programs and applications. The term usually refersto relatively simple programs that can be combined together to accomplisha 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 thatattempts to manage all these functions.

  • 8/8/2019 Computer -Module 3

    8/72

    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, buttypically does not directly apply them in the performance of tasks thatbenefit the user. A simple, if imperfect analogy in the world of hardwarewould be the relationship of an electric light bulb (an application) to anelectric power generation plant (a system). The power plant merelygenerates electricity, not itself of any real use until harnessed to anapplication like the electric light that performs a service that benefits theuser.

  • 8/8/2019 Computer -Module 3

    9/72

    LECTURE-IIObjective of this Lecture

    3. Operating system.

    4. Computer program.

    5. Machine language and high level language.

  • 8/8/2019 Computer -Module 3

    10/72

    3 Operating System

    An operating system (OS) is an interface between hardware and userwhich is responsible for the management and coordination of activities andthe sharing of the resources of a computer, that acts as a host for computingapplications run on the machine. As a host, one of the purposes of anoperating system is to handle the resource allocation and access protectionof the hardware. This relieves application programmers from having tomanage these details.

    Operating systems offer a number of services to application programs andusers. Applications access these services through application programminginterfaces (APIs) or system calls. By invoking these interfaces, theapplication can request a service from the operating system, passparameters, and receive the results of the operation. Users may also interact

    with the operating system with some kind of software user interface liketyping commands by using command line interface (CLI) or using agraphical user interface. For hand-held and desktop computers, the userinterface is generally considered part of the operating system. On largemulti-user systems like Unix and Unix-like systems, the user interface isgenerally implemented as an application program that runs outside theoperating system.

  • 8/8/2019 Computer -Module 3

    11/72

    The below diagram gives a graphical depiction of the interfaces between theoperating system and the computer component.

  • 8/8/2019 Computer -Module 3

    12/72

    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 directlyaccessing hardware devices: protected

    Whether it has built-in support for graphics. Whether it has built-in support for networks.

  • 8/8/2019 Computer -Module 3

    13/72

    Important functions of Operating system :

    1)Job Management

    Job management controls the order and time in which programs are runand is more sophisticated in the mainframe environment wherescheduling the daily work has always been routine. IBM's job controllanguage (JCL) was developed decades ago. In a desktop environment,batch files can be written to perform a sequence of operations that can bescheduled to start at a given time.

    2) Task Management

    Multitasking, which is the ability to simultaneously execute multipleprograms, is available in all operating systems today. Critical in the

    mainframe and server environment, applications can be prioritized to runfaster or slower depending on their purpose. In the desktop world,multitasking is necessary for keeping several applications open at thesame time so you can bounce back and forth among them.

  • 8/8/2019 Computer -Module 3

    14/72

    3) Data Management

    Data management keeps track of the data on disk, tape and optical storagedevices. The application program deals with data by file name and aparticular location within the file. The operating system's file system knowswhere that data are physically stored (which sectors on disk) and

    interaction between the application and operating system is through theprogramming interface. Whenever an application needs to read or writedata, it makes a call to the operating system

    4) Device Management

    Device management controls peripheral devices by sending themcommands in their own proprietary language. The software routine thatknows how to deal with each device is called a "driver," and the OSrequires drivers for the peripherals attached to the computer. When a new peripheral is added, that device's driver is installed into the operatingsystem.

  • 8/8/2019 Computer -Module 3

    15/72

    5) User Interface

    All graphics based today, the user interface includes the windows, menusand method of interaction between you and the computer. Prior to graphicaluser interfaces (GUIs), all operation of the computer was performed bytyping in commands. Not at all extinct, command-line interfaces are alive

    and well and provide an alternate way of running programs on all majoroperating systems. Operating systems may support optional interfaces, bothgraphical and command line. Although the overwhelming majority ofpeople work with the default interfaces, different "shells" offer variations ofappearance and functionality.

    6) Security

    Operating systems provide password protection to keep unauthorized usersout of the system. Some operating systems also maintain activity logs andaccounting of the user's time for billing purposes. They also providebackup and recovery routines for starting over in the event of a systemfailure.

  • 8/8/2019 Computer -Module 3

    16/72

    4 Computer program

    Computer programs (also software programs, or just programs) areinstructions for a computer. A computer requires programs to function,typically executing the program's instructions in a central processor. Theprogram has an executable form that the computer can use directly toexecute 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 thatusually 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 andlater executed by a central processing unit. Alternatively, computer programs may be executed with the aid of an interpreter, or may beembedded directly into hardware.

  • 8/8/2019 Computer -Module 3

    17/72

    5 Machine language and high level language.

    Machine language

    Machine code or machine language is a system of instructions and dataexecuted directly by a computer's central processing unit. Machine codemay be regarded as a primitive (and cumbersome) programminglanguage or as the lowest-level representation of a compiled and/orassembled computer program. Programs in interpreted languages are notrepresented by machine code however, although theirinterpreter(whichmay be seen as a processor executing the higher level program) often is.Machine code is sometimes called native code when referring toplatform-dependent parts of language features or libraries. Machine codeshould not be confused with so called "byte code", which is executed byan interpreter.

  • 8/8/2019 Computer -Module 3

    18/72

    Machine code instructions

    Every processor or processor family has its own machine code instructionset. Instructions are patterns of bits that by physical design correspond todifferent commands to the machine. The instruction set is thus specific to aclass of processors using (much) the same architecture. Successor or

    derivative processor designs often include all the instructions of apredecessor and may add additional instructions. Occasionally a successordesign will discontinue or alter the meaning of some instruction code(typically because it is needed for new purposes), affecting codecompatibility to some extent; even nearly completely compatibleprocessors may show slightly different behavior for some instructions butthis is seldom a problem. Systems may also differ in other details, such as

    memory arrangement, operating systems, or peripheral devices; because aprogram normally relies on such factors, different systems will typicallynot run the same machine code, even when the same type of processor isused.

  • 8/8/2019 Computer -Module 3

    19/72

    A machine code instruction set may have all instructions of the samelength, or it may have variable-length instructions. How the patterns areorganized varies strongly with the particular architecture and often alsowith the type of instruction. Most instructions have one or more opcodefields which specifies the basic instruction type (such as arithmetic, logical,

    jump, etc) and the actual operation (such as add or compare) and otherfields that may give the type of the operand(s), the addressing mode(s), theaddressing offset(s) or index, or the actual value itself (such constantoperands contained in an instruction are called immediates).

  • 8/8/2019 Computer -Module 3

    20/72

    Diagram of level of Languages

  • 8/8/2019 Computer -Module 3

    21/72

    Assembly language

    Assembly languages are a family of low-level languages for programmingcomputers, microprocessors, microcontrollers, and other (usually)

    integrated circuits. They implement a symbolic representation of thenumeric machine codes and other constants needed to program a particularCPU architecture. This representation is usually defined by the hardwaremanufacturer, and is based on abbreviations (called mnemonics) that helpthe programmer remember individual instructions ,registers, etc. Anassembly language is thus specific to a certain physical or virtual computerarchitecture (as opposed to most high-level languages, which are usuallyportable).

  • 8/8/2019 Computer -Module 3

    22/72

    A utility program called an assembler is used to translate assemblylanguage statements into the target computer's machine code. Theassembler performs a more or less isomorphic translation (a one-to-onemapping) 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 facilitateprogram development, control the assembly process, and aid debugging. In particular, most modern assemblers include a macro facility (describedbelow), and are called macro assemblers.

  • 8/8/2019 Computer -Module 3

    23/72

    High-level programming language

    A high-level programming language is a programming language withstrong abstraction from the details of the computer. In comparison to low-level programming languages, it may use natural language elements, beeasier to use, or be more portable across platforms. Such languages hide thedetails of CPU operations such as memory access models and managementof scope.

    This greater abstraction and hiding of details is generally intended to makethe language user-friendly, as it includes concepts from the problemdomain instead of those of the machine used. A high-level language

    isolates the execution semantics of a computer architecture from thespecification of the program, making the process of developing a programsimpler and more understandable with respect to a low-level language. Theamount of abstraction provided defines how "high-level" a programminglanguage is.

  • 8/8/2019 Computer -Module 3

    24/72

    Features

    The term "high-level language" does not imply that the language is superiorto low-level programming languages - in fact, in terms of the depth ofknowledge 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 thandealing with registers, memory addresses and call stacks, high-levellanguages deal with usability, threads, locks, objects, variables, arrays andcomplex arithmetic or boolean expressions. In addition, they have noopcodes that can directly compile the language into machine code, unlikelow-level assembly language. Other features such as string handling

    routines, object-oriented language features and file input/output may alsobe present.

  • 8/8/2019 Computer -Module 3

    25/72

  • 8/8/2019 Computer -Module 3

    26/72

    6 Computer virus, Antivirus and Computer security

    Computer Virus

    A computer virus is a computer program that can copy itself and infect acomputer. The term "virus" is also commonly but erroneously used to refer

    to other types of malware, adware, and spyware programs that do not havethe reproductive ability. A true virus can only spread from one computer toanother (in some form of executable code) when its host is taken to thetarget computer; for instance because a user sent it over a network or theInternet, 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 systemthat is accessed by another computer.

  • 8/8/2019 Computer -Module 3

    27/72

    Types of viruses

    1Resident Viruses

    This type of virus is a permanent which dwells in the RAM memory. Fromthere 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 isexecuted. When a specific condition is met, the virus will go into actionand infect files in the directory or folder that it is in and in directories thatare specified in the AUTOEXEC.BAT file PATH. This batch file is alwayslocated in the root directory of the hard disk and carries out certainoperations when the computer is booted.

  • 8/8/2019 Computer -Module 3

    28/72

    3 Overwrite Viruses Virus of this kind is characterized by the fact that itdeletes the information contained in the files that it infects, rendering thempartially or totally useless once they have been infected. The only way toclean 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 harddisk. This is a crucial part of a disk, in which information on the disk itselfis stored together with a program that makes it possible to boot (start) thecomputer from the disk.The best way of avoiding boot viruses is to ensurethat floppy disks are write-protected and never start your computer with anunknown floppy disk in the disk drive.Examples of boot viruses include: Polyboot.B, AntiEXE.

  • 8/8/2019 Computer -Module 3

    29/72

    5 FAT Virus -The file allocation table or FAT is the part of a disk used toconnect information and is a vital part of the normal functioning of thecomputer. This type of virus attack can be especially dangerous, bypreventing access to certain sections of the disk where important files arestored. Damage caused can result in information losses from individualfiles or even entire directories.

    6 WormsA worm is a program very similar to a virus; it has the ability toself-replicate, and can lead to negative effects on your system and mostimportantly 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 areTrojans or Trojan horses, which unlike viruses do not reproduce byinfecting other files, nor do they self-replicate like worms.

  • 8/8/2019 Computer -Module 3

    30/72

    Antivirus

    Antivirus (oranti-virus) software is used to prevent, detect, and removemalware, including computer viruses, worms, and trojan horses. Suchprograms may also prevent and remove adware, spyware, and other formsof malware.

    A variety of strategies are typically employed. Signature-based detectioninvolves searching for known malicious patterns in executable code.However, it is possible for a user to be infected with new malware in whichno 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 forknown malicious code (or slight variations of such code) in files. Someantivirus software can also predict what a file will do if opened/run byemulating it in a sandbox and analyzing what it does to see if it performsany malicious actions. If it does, this could mean the file is malicious.

  • 8/8/2019 Computer -Module 3

    31/72

    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 andproperty 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.

  • 8/8/2019 Computer -Module 3

    32/72

    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 unauthorizedpersons 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 enabledan 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

  • 8/8/2019 Computer -Module 3

    33/72

    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 notdenied 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 isoften 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

  • 8/8/2019 Computer -Module 3

    34/72

    LECTURE-IVObjective of this Lecture

    7. Elements of MS DOS and Windows OS.

    8. Computer arithmetic. Binary, octal and hexadecimalnumber systems.

  • 8/8/2019 Computer -Module 3

    35/72

    7 Elements of MS DOS and Windows OS.

    To begin to understand DOS commands, you first need toknow a few fundamental facts:

    DOS requires that you use a specific set of rules, orsyntax, whenyou issue commands.

    All DOS commands begin with a keyword that identifies the action youwant performed.

    Parameters, which are a part of a command's syntax, refine theway a command is executed.

    Major components of DOS operating system and how these major

    components allow DOS to accomplish its tasks. Two MajorCategories:

    1) User Interaction with DOS.

    2) DOS interaction with hardware.

  • 8/8/2019 Computer -Module 3

    36/72

    User Interaction with DOS

    1. COMMAND.COM - located in the root directory of the C:\ drive ona DOS-based computer system, is the primary vehicle for allowingyou 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 commandnext 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 understoodby lower layers of DOS.

  • 8/8/2019 Computer -Module 3

    37/72

    5. Single interface to allow DOS users to do their work completelyunaware of what part of operating system is performing the tasksthey are requesting.

    DOS Interaction with Hardware

    1. The DOS system files then communicate with the special memoryof the computer.

    2. The special memory is called ROM (Read-Only Memory) and itcontains 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 theBIOS.

  • 8/8/2019 Computer -Module 3

    38/72

    Windows Windows is a personal computer operating system from Microsoft

    that, together with some commonly used business applications suchas 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) ideasthat were developed at an experimental lab at Xerox and introducedcommercially 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

  • 8/8/2019 Computer -Module 3

    39/72

    - Vista, formerly code named Longhorn, is the most recent of Microsoft's Windows desktop operating systems. Vista was releasedfor businesses, the holders of most volume licenses, on November30, 2006. Bill Gates hosted the worldwide launch of Windows Vistaand Microsoft Office 2007 in Times Square on January 29, 2007.Vista ships in nine different versions that fall under the maincategories of home edition and business edition.

    The most noticeable change from Windows XP to Vista is asignificantly 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-basedspecification for creating documents similar to Portable DocumentFormat (PDF) files.

  • 8/8/2019 Computer -Module 3

    40/72

    8 Computer arithmetic- Binary, octal and hexadecimal

    number systems.

    Because electronic logic deals with currents that are on or off, it hasbeen found convenient to represent quantities in binary form toperform arithmetic on a computer. Thus, instead of having tendifferent 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 thenext column, instead of the digit representing a quantity that is ten

    times as large, it only represents a quantity that is two times aslarge. 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

  • 8/8/2019 Computer -Module 3

    41/72

    Binary addition

    In binary addition only 0's and 1's can be used, instead of the wholespectrum of 0-9. This actually makes binary addition much simplerthan decimal addition, as we only need to remember the following:

    0 + 0 = 00 + 1 = 11 + 0 = 11 + 1 = 10

    As an example of binary addition we have,

    101+1011010

  • 8/8/2019 Computer -Module 3

    42/72

    Binary multiplication is actually much simpler than decimalmultiplication. In the case of decimal multiplication, we need to remember3 x 9 = 27, 7 x 8 = 56, and so on. In binary multiplication, we only need toremember the following,

    0 x 0 = 00 x 1 = 01 x 0 = 01 x 1 = 1

    Example

    1

    01

    x11101

    10101111

  • 8/8/2019 Computer -Module 3

    43/72

    Binary division is almost as easy, and involves our knowledge ofbinary multiplication. Take for example the division of 1011 into 11.

    11 R=10

    11 )1011-11101-1110

  • 8/8/2019 Computer -Module 3

    44/72

    To check our answer, we first multiply our divisor11 by our quotient 11.Then we add its' product to the remainder 10, and compare it to ourdividend of1011.

    11x 11

    1111

    1001

  • 8/8/2019 Computer -Module 3

    45/72

    Decimal to binary follows a straightforward method. It involves dividing thenumber to be converted, say N, by 2 (since binary is in base 2), and making note ofthe remainder. We continue dividing the quotient (N / 2) by 2, until we reach thedivision 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.

  • 8/8/2019 Computer -Module 3

    46/72

    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 thebinary number. The example number, 10011011, has eight digits, sothe list, to eight elements, would look like this: 128, 64, 32, 16, 8, 4,2, 1

  • 8/8/2019 Computer -Module 3

    47/72

    Octal Number system

    The octal numeral system, oroct 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 bysuccessively 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.

  • 8/8/2019 Computer -Module 3

    48/72

    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: 125

    10 = 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

  • 8/8/2019 Computer -Module 3

    49/72

    Octal to Binary Conversion -To convert octal to binary, replace eachoctal digit by its binary representation.

    Example: Convert 518 to binary:

    58 = 1012

    18 = 0012Thus: 518 = 101 0012Binary to Octal conversion -The process is the reverse of the previous

    algorithm. The binary digits are grouped by threes, starting from the decimalpoint and proceeding to the left and to the right. Add leading 0s (or trailingzeros 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

  • 8/8/2019 Computer -Module 3

    50/72

    Octal to Hexadecimal conversion The conversion is made in twosteps using binary as an intermediate base. Octal is converted tobinary 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

  • 8/8/2019 Computer -Module 3

    51/72

    Hexadecimal NumberSystem 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 sixteendistinct symbols, most often the symbols 09 to represent values zero tonine, 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, indecimal, to (2 163) + (10 162) + (15 16) + 3, or10,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 digitalelectronics. For example, byte values can range from 0 to 255 (decimal) butmay be more conveniently represented as two hexadecimal digits in therange 00 through FF. Hexadecimal is also commonly used to representcomputer memory addresses.

  • 8/8/2019 Computer -Module 3

    52/72

    Binary to Hex Conversion

    It is easy to convert from an integer binary number to hex. This isaccomplished 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

  • 8/8/2019 Computer -Module 3

    53/72

    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.

  • 8/8/2019 Computer -Module 3

    54/72

    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

  • 8/8/2019 Computer -Module 3

    55/72

    Decimal to Hex Conversion

    To convert decimal to hex is slightly more difficult. The typical method toconvert from decimal to hex is repeated division by 16. While we may alsouse repeated subtraction by the weighted position value, it is more difficultfor large decimal numbers.

    Repeated Division By 16

    For this method, divide the decimal number by 16, and write the remainderon the side as the least significant digit. This process is continued bydividing the quotient by 16 and writing the remainder until the quotient is0. When performing the division, the remainders which will represent thehex equivalent of the decimal number are written beginning at the leastsignificant digit (right) and each new digit is written to the next moresignificant digit (the left) of the previous digit. Consider the number 44978.

  • 8/8/2019 Computer -Module 3

    56/72

    Division Quotient Remainder HexNumber

    44978 / 16 2811 2 2

    2811 / 16 175 11 B2

    175 / 16 10 15 FB2

    10 / 16 0 10 AFB2

  • 8/8/2019 Computer -Module 3

    57/72

    LECTURE-VObjective of this Lecture

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

    11. MCQ

  • 8/8/2019 Computer -Module 3

    58/72

    9 Algorithm and flowcharts. Illustrations.

    In mathematics, computing, and related subjects, an algorithm is aneffective method for solving a problem using a finite sequence ofinstructions. Algorithms are used for calculation, data processing, andmany other fields. Each algorithm is a list of well-defined instructions forcompleting a task. Starting from an initial state, the instructions describe a

    computation that proceeds through a well-defined series of successivestates, eventually terminating in a final ending state. The transition fromone 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 flowchartsplay a vital role in the programming of a problem and are quite helpful in

    understanding the logic of complicated and lengthy problems. Once theflowchart is drawn, it becomes easy to write the program in any high levellanguage. Often we see how flowcharts are helpful in explaining theprogram to others. Hence, it is correct to say that a flowchart is a must forthe better documentation of a complex program. Flowcharts are usuallydrawn using some standard symbols; (explain in next slide)

  • 8/8/2019 Computer -Module 3

    59/72

    Start or end of the program

    Computational steps or processingfunction of a program

    Input or output operation

    Decision making and branching

    Connector or joining of two parts ofprogram

  • 8/8/2019 Computer -Module 3

    60/72

    The following are some guidelines in flowcharting:

    a. In drawing a proper flowchart, all necessary requirements shouldbe 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 theflowchart.

    c. The usual direction of the flow of a procedure or system is fromleft 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 orthree flow lines, one for each possible answer, should leave thedecision symbol.

  • 8/8/2019 Computer -Module 3

    61/72

    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 intersectionof flow lines if you want to make it more effective and better wayof communication.

    h Ensure that the flowchart has a logical startand finish.I It is useful to test the validity of the flowchart by passing through it

    with a simple test data.

  • 8/8/2019 Computer -Module 3

    62/72

    Example of a flowchart:

    Problem 1: Write an algorithm and draw the flowchart forfinding the average of two numbers

    Algorithm

    Input: two numbers x and y Output: the average of x and y

    Steps

    1. input x

    2. input y

    3. sum = x + y

    4. average = sum /2

    5. output average

    START

    Input x

    Input y

    Sum = x + y

    Average = sum/2

    OutputAverage

    END

  • 8/8/2019 Computer -Module 3

    63/72

    10 Elements of database and its applications.

    A database is an integrated collection of logically-related records or filesconsolidated into a common pool that provides data for one or moremultiple uses.

    A Database Management System (DBMS) is a set of computer programsthat controls the creation, maintenance, and the use of the database withcomputer as a platform or of an organization and its end users. It allowsorganizations to place control of organization-wide database developmentin the hands of database administrators (DBAs) and other specialists. ADBMS is a system software package that helps the use of integratedcollection of data records and files known as databases. It allows differentuser application programs to easily access the same database. DBMSs mayuse any of a variety of database models, such as the network model orrelational model. In large systems, a DBMS allows users and othersoftware to store and retrieve data in a structured way. Instead of having towrite computer programs to extract information, user can ask simplequestions in a query language. Thus, many DBMS packages provideFourth-generation programming language (4GLs) and other applicationdevelopment features.

  • 8/8/2019 Computer -Module 3

    64/72

    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 ofEmployee

  • 8/8/2019 Computer -Module 3

    65/72

    Components of DBMS

    DBMS Engine accepts logical request from the various other DBMSsubsystems, converts them into physical equivalent, and actuallyaccesses the database and data dictionary as they exist on a

    storage device. Data Definition Subsystem helps user to create and maintain thedata dictionary and define the structure of the files in a database.

    Data Manipulation Subsystem helps user to add, change, anddelete information in a database and query it for valuableinformation. Software tools within the data manipulation subsystemare most often the primary interface between user and theinformation contained in a database. It allows user to specify itslogical information requirements.

  • 8/8/2019 Computer -Module 3

    66/72

    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.

    D

    ata Administration Subsystem helps users to manage the overalldatabase 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.

  • 8/8/2019 Computer -Module 3

    67/72

    Backup and replication -Copies of attributes need to be made regularly incase primary disks or other equipment fails. A periodic copy of attributesmay also be created for a distant organization that cannot readily access theoriginal. DBMS usually provide utilities to facilitate the process ofextracting and disseminating attribute sets. When data is replicated betweendatabase servers, so that the information remains consistent throughout the

    database system and users cannot tell or even know which server in theDBMS they are using, the system is said to exhibit replicationtransparency.

    Security -Often it is desirable to limit who can see or change whichattributes or groups of attributes. This may be managed directly byindividual, or by the assignment of individuals and privileges to groups, or(in the most elaborate models) through the assignment of individuals andgroups to roles which are then granted entitlements.

    Computation There are common computations requested on attributessuch as counting, summing, averaging, sorting, grouping, cross-referencing, etc. Rather than have each computer application implementthese from scratch, they can rely on the DBMS to supply such calculations.

  • 8/8/2019 Computer -Module 3

    68/72

    Change and access logging - Often one wants to know who accessed whatattributes, what was changed, and when it was changed. Logging servicesallow this by keeping a record of access occurrences and changes.

    Automated optimization - If there are frequently occurring usagepatterns or requests, some DBMS can adjust themselves to improve the

    speed of those interactions. In some cases the DBMS will merelyprovide tools to monitor performance, allowing a human expert tomake the necessary adjustments after reviewing the statistics collected.

    Applications ofDatabase

    Databases function in many applications, spanning virtually the entirerange 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 themconvenient, and many electronic mail programs and personal organizersare based on standard database technology. Software database driversare available for most database platforms so that application softwarecan use a common API to retrieve the information stored in a database.

    Commonly used database APIs include JDBC and ODBC.

  • 8/8/2019 Computer -Module 3

    69/72

    11 Multiple Choice Questions

    Q1.. is a general term primarily used for digitally stored data such ascomputer 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

  • 8/8/2019 Computer -Module 3

    70/72

    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) NoneQ6 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 algorithma) DBMS b ) OS c) flowchart d) None

  • 8/8/2019 Computer -Module 3

    71/72

    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 ofa) 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

  • 8/8/2019 Computer -Module 3

    72/72

    Key Of Module-III

    1 a

    2 b

    3 a

    4 c

    5 b

    6 d

    7 c

    8 a9 c

    10 b