Beruflich Dokumente
Kultur Dokumente
Dr. Pramod M
Dr. Pramod M
Dr. Pramod M
Dr. Pramod M
In order to solve a computational problem, a computer has to perform the following four major tasks: Input Process Output Storage Input/output Unit The computer is a machine which processes input data according to a given set of instructions and gives output. Before a computer does processing, it should be given data and instructions. After processing, output should be displayed or printed by computer. The unit used for getting the data and instructions into computer and displaying or printing output is known as an Input/Output Unit (I/O Unit). There are many peripheral devices which are used as input/output units for a computer. The most common form of an input device is known as terminal. A terminal has an electronic typewriter-like device called
Dr. Pramod M
Dr. Pramod M
Dr. Pramod M
Printer Printer is the most important output device. It is used to print information on paper. It is essential for getting output of any computer-based application. Types of Printers Printers can be broadly categorized into the following two types: 1. Impact Printers The printers that print the characters by striking against the ribbon and onto the paper are called impact printers. These are of two types: (a) Character Printers These printers print one character at a time. These printers are further of two types: (i) Daisy Wheel Printers These printers print the characters by a mechanism that uses a plastic or metal hub with spokes, called daisy wheel (refer to figure 2.20). The characters are embossed on the radiating spokes and printed by striking these spokes against the ribbon and paper. These printers give a good quality but are more expensive than dot matrix printers.
Dr. Pramod M
Dr. Pramod M
10
Dr. Pramod M
11
Dr. Pramod M
In the above structure, principal is instructed by the management or government. Without any knowledge of the management or government he does not take any action. Principal has to depend upon the management or government. But principal has to instruct the staff working under him to carry out the administrative activity in a satisfactory manner. The staff members can interact with the students and vice-versa. From the above example we know what the work of principal is. Now we will compare this with the computer system. A Computer system may be divided into four major components 1. Hardware (Principal) 2. Operating System (Management) 3. Application Programs (Teaching & Non- Teaching Staff) 4. Users (Students)
The computer is an electronic machine with built-in intelligence to execute the instructions. A Computer System is an arrangement of hardware and software. The term hardware generally refers to the electronic circuits in the computer. The main hardware modules are keyboard, CRT monitor, Disk Drive, Printer, and other peripherals. In practice, the term hardware is used for all physical items in a computer including mechanical, electrical and electronic assemblies and components. The Electrical components are Motors, power supplies, Transformers, Relays, Fans, PCBs, Wires, and Cables. The Mechanical components are Switches, Panels, Covers, Chassis, Nuts and Screws. The Electronic components are Resistors, Capacitors, Coils, Diodes, Transistors, ICs, Crystals, LED, Speakers, and CRT. Fig 1.3 Shows Components of a Typical Computer System
12
Dr. Pramod M
Any program is software. The software is developed to solve a problem and it controls the hardware when the program is executed. The hardware can be seen visually whereas the software is a logical action plan that is not visually noticeable. Computer Software is classified into two types: Application and System Software. An application program is a program solving users problems. Typical examples are: Payroll program, Inventory control program, tax calculator, class room scheduler, library management software, train reservation software, billing software and game programs. A system program is a program which helps in efficient utilization of the system by other programs and the users. It is generally developed for a given type of computer and it is not concerned with specific application or user. Operating system and compiler are examples of system software.
Another way of looking into a typical personal computer is as shown Fig 1.4. At the core of this computer is a single-chip microprocessor such as the Pentium Dual Core or AMD. The microprocessors internal (micro) architecture usually contains a number of speedup features not found in its earlier version. A system bus connects the microprocessor to a main memory based on semiconductor DRAM technology and to an I/O subsystem. The widely used I/O bus (peripheral bus) used in computers of all sizes, provides a shared data path between the Central Processing Unit (CPU) and peripheral controllers, such as network, display, SCSI and RAID cards.
13
Dr. Pramod M
14
Dr. Pramod M
OS Functions A computers operating system (OS) is a group of programs designed to serve two basic purposes: To control the allocation and use of the computing systems resources among the various users and tasks, and To provide an interface between the computer hardware and the programmer that simplifies and makes feasible the creation, coding, debugging, and maintenance of application programs. An Operating System does the following: Facilitate creation and modification of program and data files through an editor program, Provide access to compilers to translate programs from high-level languages to machine language, Provide a loader program to move the complied program code to the computers memory for execution, Provide routines that handle the intricate details of I/O programming, Assure that when there are several active processes in the computer, each will get fair and non interfering access to the central processing unit for execution, Take care of storage and device allocation, Provide for long term storage of user information in the form of files, and Permit system resources to be shared among users when appropriate, and be protected from unauthorized or mischievous intervention as necessary.
15
Dr. Pramod M
16
Dr. Pramod M
17
Dr. Pramod M
18
Dr. Pramod M
19
Dr. Pramod M
20
Dr. Pramod M
21
Dr. Pramod M
22
Dr. Pramod M
There is nothing essentially easier about using the base-10 system. It just seems more intuitive only because it is the only system that you have used extensively, and, again, the fact that it is used extensively is due to the fact that humans have 10 fingers. If humans had six fingers, we would all be using a base-6 system, and we would all find that system to be the most intuitive and natural. So, long ago, humans looked at their hands, saw ten fingers, and decided to use a base-10 system. But how many fingers does a computer have? Consider: Computers are built from transistors, and an individual transistor can only be ON or OFF (two options). Similarly, data storage devices can be optical or magnetic. Optical storage devices store data in a specific location by controlling whether light is reflected off that location or is not reflected off that location (two options). Likewise, magnetic storage devices store data in a specific location by magnetizing the particles in that location with a specific orientation. We can have the north magnetic pole pointing in one direction, or the opposite direction (two options). Computers can most readily use two symbols, and therefore a base-2 system, or binary number system, is most appropriate. The base-10 number system has 10 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. The base-2 system has exactly two symbols: 0 and 1. The base-10 symbols are termed digits. The base-2 symbols are termed binary digits, or bits for short. All base-10 numbers are built as strings of digits (such as 6349). All binary numbers are built as strings of bits (such as 1101). Just as we would say that the decimal number 12890 has five digits, we would say that the binary number 11001 is a five-bit number. The point: All data in a computer is represented in binary. The pictures of your last vacation stored on your hard driveits all bits. The YouTube video of the cat falling off the chair that you saw this morningbits. Your Face book pagebits. The tweet you sentbits. The email from your professor telling you to spend less time on vacation, browsing YouTube, updating your Face book page and sending tweetsthats bits too. Everything is bits. To understand how computers work, you have to speak the language. And the language of computers is the binary number system. The Binary Number System Consider again the example of a child counting a pile of pennies, but this time in binary. He would begin with the first penny: 1. The next penny counted makes the total one single group of two pennies. what number is this? When the base-10 child reached nine (the highest symbol in his scheme), the next penny gave him one group of ten, denoted as 10, where the 1 indicated one collection of ten. Similarly, when the base-2 child reaches one (the highest symbol in his scheme), the next penny gives him one group of two, denoted as 10, where the 1 indicates one collection of two. Back to the base-2 child: The next penny makes one group of two pennies and one additional penny: 11. The next penny added makes two groups of two, which is one group of 4: 100. The 1 here indicates a collection of two groups of two, just as the 1 in the base-10 number 100 indicates ten groups of ten. Upon completing the counting task, base-2 child might find that he has one group of four pennies, no groups of two pennies, and one penny left over: 101 pennies. The child counting the same pile of pennies in base-10
23
Dr. Pramod M
Just as with decimal notation, we write a binary number as a string of symbols, but now each symbol is a 0 or a 1. To interpret a binary number, we multiply each digit by the power of 2 associated with that digits position. For example, consider the binary number 1101. This number is:
Since binary numbers can only contain the two symbols 0 and 1, numbers such as 25 and 1114000 cannot be binary numbers. We say that all data in a computer is stored in binarythat is, as 1s and 0s. It is important to keep in mind that values of 0 and 1 are logical values, not the values of a physical quantity, such as a voltage. The actual physical binary values used to store data internally within a computer might be, for instance, 5 volts and 0 volts, or perhaps 3.3 volts and 0.3 volts or perhaps reflection and no reflection. The two values that are used to physically store data can differ within different portions of the same computer. All that really matters is that there are two different symbols, so we will always refer to them as 0 and 1. A string of eight bits (such as 11000110) is termed a byte. A collection of four bits (such as 1011) is smaller than a byte, and is hence termed a nibble. (This is the sort of nerd-humor for which engineers are famous.) Decimal and Binary Numbers When we write decimal (base 10) numbers, we use a positional notation system. Each digit is multiplied by an appropriate power of 10 depending on its position in the number:
For whole numbers, the rightmost digit position is the ones position (100 = 1). The numeral in that position indicates how many ones are present in the number. The next position to the left is tens, then hundreds, thousands, and so on. Each digit position has a weight that is ten times the weight of the position to its right. In the decimal number system, there are ten possible values that can appear in each digit position, and so there are ten numerals required to represent the quantity in each digit position. The decimal numerals are the familiar zero through nine (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). In a positional notation system, the number base is called the radix. Thus, the base ten systems that we normally use have a radix of 10. The term radix and base can be used interchangeably. When writing numbers in a radix other than ten, or where the radix isnt clear from the context, it is customary to specify the radix using a subscript. Thus, in a case where the radix isnt understood, decimal numbers would be written like this:
Generally, the radix will be understood from the context and the radix specification is left off.
24
Dr. Pramod M
In the binary number system, there are only two possible values that can appear in each digit position rather than the ten that can appear in a decimal number. Only the numerals 0 and 1 are used in binary numbers. The term bit is a contraction of the words binary and digit, and when talking about binary numbers the terms bit and digit can be used interchangeably. When talking about binary numbers, it is often necessary to talk of the number of bits used to store or represent the number. This merely describes the number of binary digits that would be required to write the number. The number in the above example is a 6 bit number.
25
Dr. Pramod M
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely. The earliest programming languages predate the invention of the computer, and were used to direct the behavior of machines such as Jacquard looms and player pianos. Thousands of different programming languages have been created, mainly in the computer field, with many being created every year. Most programming languages describe computation in an imperative style, i.e., as a sequence of commands, although some languages, such as those that support functional programming or logic programming, use alternative forms of description. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages, such as Perl 5 and earlier, have a dominant implementation that is used as a reference. The first programming languages predate the modern computer. The 19th century saw the invention of "programmable" looms and player piano scrolls, both of which implemented examples of domainspecific languages. By the beginning of the twentieth century, punch cards encoded data and directed mechanical processing. In the 1930s and 1940s, the formalisms of Alonzo Church's lambda calculus and Alan Turing's Turing machines provided mathematical abstractions for expressing algorithms; the lambda calculus remains influential in language design In the 1940s, the first electrically powered digital computers were created. Grace Hopper, was one of the first programmers of the Harvard Mark I computer, a pioneer in the field, developed the first compiler, around 1952, for a computer programming language. Notwithstanding, the idea of programming language existed earlier; the first high-level programming language to be designed for a computer was Plankalkl, developed for the German Z3 by Konrad Zuse between 1943 and 1945. However, it was not implemented until 1998 and 2000.
26
Dr. Pramod M
27
Dr. Pramod M
28
Dr. Pramod M
SUE
CPL
BCPL B C
Alef C++
Java
Groovy Scala Join Java J# Processing X10 Cobra (class/object model and other features) Windows PowerShell (also under DCL, ksh and Perl)
C#
C-D ColdFusion Coyote eC (Ecere C) Go (also under Oberon) Harbour Limbo LPC Pike Objective-C (also under Smalltalk) PCASTL (also under Lisp) Perl Windows PowerShell (also under C#, DCL and ksh) S2 PHP Ruby (also under Smalltalk) PDL (also under APL) Python QuakeC tcsh (also under sh) MCPL
29
Dr. Pramod M
30
Dr. Pramod M
31
Dr. Pramod M
32
Dr. Pramod M
33
Dr. Pramod M
34
Dr. Pramod M
35
Dr. Pramod M
ENGINEERING AND ROBOTICS Software. Design of buildings and maps. Designing VLSI chip and many more. Robotics research. ENTERTAINMENT Chatting /browsing. Music/Videos Games etc..
36
Dr. Pramod M
37
Dr. Pramod M