Sie sind auf Seite 1von 100

Lecture notes Computer systems and Programming Mechanical Engineering 1st Semester

By: Adam khan Lecturer computer science Sarhad University of science and IT, Peshawar.

What Is a Computer?
How is a computer defined?
Electronic device operating under the control of instructions stored in its own memory

The computer
first, Accepts data such as raw facts, figures, and symbol then, Processes data into information (Data that is organized, meaningful, and useful ) finally, Produces and stores results

The Components of a Computer


What is an input device? _____
Hardware used to enter data and instructions

The Components of a Computer


What is an output device? ______
Hardware that conveys information to a user

The Components of a Computer


What is the system unit?
Box-like case containing electronic components used to process data

What is the magical inside the black box?


Storage U nits

Memory card

Video Card

Power Supply

PU C

Sound Card 6

The Components of a Computer


What are two main components on the motherboard? Central Processing Unit (CPU)
Also called a processor Carries out instructions that tell computer what to do

Memory
Temporary holding place for data and instructions

The Components of a Computer


What is storage?
Holds data, instructions, and information for future use
Storage media Storage media
Physical material on which data, instructions, Physical material on which data, instructions, and information are stored and information are stored

Storage device Storage device


Records and retrieves items to and from Records and retrieves items to and from aastorage medium storage medium

Storage device
What is a floppy disk?

Thin, circular, flexible disk enclosed in rigid plastic shell

A Zip disk looks similar but has much greater storage capability (=170 floppy disk)
9

The Components of a Computer


What is a hard disk?
Provides much greater storage capacity than a floppy disk or Zip disk Housed inside the system unit

10

The Components of a Computer


What is a compact disc?
Flat, round, portable Optical disc
CD-ROM CD-RW Capacity: 673~768 MB DVD-ROM DVD+RW Capacity:4.7 ~ 17.1 GB

11

The Components of a Computer


What is miniature storage media?

Portable, thin Portable, thin memory cards memory cards used in: used in:

Digital Digital cameras cameras

Handheld Handheld computers computers


12

Primary Memory
Primary memory refers to internal storage of a computer, where the programs & data are stored. Primary storage or primary memory provides temporary (RAM) storage during program execution. Part of primary storage may also contain permanently (ROM) stored instructions that tell the computer what to do, when it turned on. Because primary storage is located inside the computer & is linked directly to the other components of the CPU, access time to data is very fast.
13

Primary Memory (continue)


RAM: (Random Access Memory):
HISTORY: For many years main memory was one of the most expensive computer components to the manufacturer. Their size has been dramatically reduced, & they have become less expensive as the manufacturing materials have changed from vacuum tubes to magnetic cores & then to transistors & finally to the chips we know today. The earliest form of main memory was based on vacuum tubes. There would have required a shelf of vacuum tubes more than a mile long for very small memory. As the tubes were not so variable their power requirements were high they generated heat, they failed frequently, & they were slow.
14

Primary Memory (continue)


The transistors, invented in 1947 were much smaller & more reliable provider of main memory. smaller power requirements & failed less frequently than vacuum tubes. Magnetic cores were smaller still. In mid 1970s work had begun on new type of main memory technology. A semiconductor material was used. The main memory of almost all computers today is based on this technology, chips are very small & relatively inexpensive to manufacturer, & they do not consume as much power as older forms of main memory.

15

Primary Memory (continue)


Functions of RAM: It is a part of primary storage where data & programs instructions are held temporarily They are referred to as Random Access Memory (RAM) chips because any of the locations on chip can be randomly selected & used to directly store & retrieve data & instructions. RAM depends on a steady supply of electricity to maintain data storage. When the power of the computer is shut off, everything stored in RAM is lost. So RAM is a volatile memory, which is subject to loss when the power is turned off.
16

Primary Memory (continue)


Different types of software have different types of space in memory the instructions of any software which is currently running by computer will be stored temporary in RAM. After closing of that software the memory (RAM) will be empty. So it is concluded that more space of RAM faster will be the computer.

17

Primary Memory (continue)


ROM: (Read only Memory )
As the name implies the contents of read only storage memory (ROM), can only be read data cant be written into it. ROM may contain information on how to start the computer & even the instructions to the entire operating system. The actual content of ROM are usually set by the computer manufacturer, they are unchangeable & permanent. Because the contents cannot be altered & they are not lost. When the electric current is turned off, ROM is non volatile.
18

Characters tics of computer


What makes a computer powerful? Speed ( ideal for processing large amounts of data ) Accuracy (accuracy of a computer is consistently high) Versatility (capable of performing any task provided) Power of remembering (store and recall any amount of information )

19

Characteristics (continue..)

Storage capability (able to store tremendous amounts of data ) No feelings (cant make judgments on their own)

20

Types of computers (According to work)


Three types:
1) Analog computers: Analog data (Temperature, pressure, speed, voltage) Continues E.g: Speedo meter (car speed)

21

Types (continue)
2) Digital computers: 1-ON 0-OFF Process numeric and non numeric data General purpose

22

Types (continue)
3) Hybrid computers: Combination of digital and analog Speed of analog Memory & Accuracy of digital Used where both type of data processed E.g: In hospitals ,ICU: Analog device measure temperature and B.P ,which are then converted into digits.
23

Classification of Computers
1)Super

computers: Largest, fastest and more expensive 50,000 times faster than microcomputers 60 miles of wiring inside Largely heat production AC is used all around Scientific purpose
E.g: Earth atmosphere,airplane,oil companies
24

Classification (continue)
2) Main frame computers: Slower, less powerful and less expensive Introduced by IBM Temperature may be adjusted Storage in Mb. Uses : Banks, ATM : different branches

25

Classification (continue)
3) Mini computers: General purpose Smaller and less expensive Storage as Tape,floppy,and removable disks Accounting, scientific and databases

26

Classification (continue
4) Micro computers : Smallest, less expensive Keyboard, disk drives, monitors, printer, cables Connected capability

27

Classification (continue)
5) Desktop computers: As micro computer The mini computer that fits nicely on the top of a desk at home or office

28

Classification (continue
6) Laptop: Briefcase computer Keyboard LCD

29

Classification (continue)
7) Handheld computers: A Portable computer that is small enough to be held in one's hand. extremely convenient to carry ipod, iphone, cell phones etc Provides personal organizer functions
Calendar Appointment book Address book Calculator Notepad

30

Types of computers (according to purpose)


1) General purpose: Word processing Databases Controlling security Can store and execute data

31

Types( continue)
2) Special purpose: Particular problem Dedicated computers Games, control of traffic lights, weather prediction Perform only one task

32

Software's
Definition: Software is made up of programs each of which is a group of related instructions that perform very specific task Bridge, between and a computer system Software can generally be divided into two categories System software Application software

33

Types of software's
Softwares

System Software's

Applications Software's

General Purpose s/w

Special Purpose s/w

34

Computer Software
What is system software?
Programs that control the operations of the computer and its devices
Operating System (OS) Operating System (OS)
is aaset of programs is set of programs that coordinates all that coordinates all activities among activities among computer hardware computer hardware devices and allows devices and allows users to run users to run application software application software

Utility Programs allow the user to Utility Programs allow the user to
perform maintenance-type tasks perform maintenance-type tasks usually related to managing aa usually related to managing computer, its devices or its programs computer, its devices or its programs

35

Computer Software
What is application software?
Programs that perform specific tasks for users
Suite
Popular software applications bundled together as a single unit
Word Processing Database Spreadsheet Presentation Graphics

Application software categorizes in two groups.


General purpose software. Special purpose software.
36

Types of Application Software's


General Purpose S/w: Enough features to do a wide variety of tasks (jobs) like Microsoft word which is a package includes word, excel, power point, & access it can be used by a student to write a research paper by an office secretary for mailing lists.etc The student, the secretary, or the lawyer can use the same software.

37

Special Purpose Software's


Special purpose software performs a very specific task for a user. cannot be changed to perform specific task for specific user.

38

Hardware's
The computer and its associated equipments are called as Hardware devices Physically exist We can touch Can be replaced There are four important areas in computer, which comes in HARDWARE Input devices Output devices CPU Secondary storage devices
39

1) 2) 3) 4)

Hardware (continue )
Output devices: to view information a) Printers b) Monitors c) Plotters d) speaker

40

Hardware (continue )
Processing Hardware(CPU): Interpret and direct the execution of software's a) CPU b) Main Memory

41

Hardware (continue)
Storage devices: To store computer instructions and data in a form that is relatively permanent. a) Hard drives b) Flash Memory c) CD/DVD disks

42

Hardware devices (continue)


1) a) b) c) d) e)

Input devices: To collect data and convert it into a computer readable form. Key board Mouse Touch pad Scanner Touch screen

43

Operating system:
An operating system is a set of programs that allows the computer to control and manage its own resources, such as the central processing unit, memory and secondary storage. intermediary between the hardware and software programs (Application) such as word processing and data base programs. Much of work of an operating system is hidden from the users; many necessary tasks are performed behind the scene.
44

Operating System (continue)


Evolution: In early days The programmer first writes a program & operates the program directly from the operator console. As time went on, additional, software & hardware were developed. First operating was developed in 1950s which was only used by IBM 701, computer system. After as the time was passed much operating system software were introduced, like windows, Apple Macintosh Microsoft Macintosh Dos (disk operating system) (Text based) Windows version G U I (graphical user interface) Apple (operating system) GUI

45

Operating System (continue)


Microsoft operating systems: (1) DOS: (Disk operating system): This operating system was used for earlier Intels personal computers. It was early developed in 1981 for IBM personal computer. Its interface is command line because it is text base environment. It supports only one user at a time & single processor.

46

Operating System (continue)


(2) Micro Soft windows: (a) MS win 3.x:
This version enables the user to take full advantage of Intels processor 80386. Other versions win 3.1, 3.11,

(b) Win 95 & win 98:


It was true operating system, & key feature was multitasking. Its properties was internet connectivity, update driver including DVD-ROM discs & devices for USB (Universal serial bus) connection
47

Operating System (continue)


(c) Windows 98 SE (d) Windows 2000
Windows 2000 (also called Windows Me) is an extension of the Windows 9x version,

48

Operating System (continue)


(C) MS win Me ( millennium): This operating system was released in 2000; it improved capability of multimedia & digital video editing support. (d) Ms win CE ( consumer electronics): This OS is designed for personal digital assistant (PDA), and it is the light version of windows which used for mobiles, e.t.c

49

Operating System (continue)


(e) MS win NT ( network ) This OS designed for networking (client/ server) (f) MS win 2000: This OS was released in the year 2000. It combines user friendly interface & features of win 98 with file system, networking power & stability, and new improvement was done. It has four editions. MS win professional MS win server standard edition MS win advanced server MS win data center server
50

Operating System (continue)


(g) Windows XP Microsoft has developed Windows XP is a line of operating systems for applying on general functional computer systems which includes business and home desktops, media centers and notebook computers. Windows XP was released on 25th October 2001. (h) Windows XP 64-bit Edition 2003 (i) Windows Server 2003 (j) Windows XP Professional x64 Edition

51

Operating System (continue)


(k) Windows Vista
After a world-wide success of XP and its service packs Microsoft has designed and created Windows Vista the operating system for use on personal computers, including business and home desktops, Tablet PCs, laptops and media centers. It was first named as "Longhorn" but later on 22nd July 2005, the name was announced as Windows Vista. The development of Vista was finished on 8th November, 2006. In the next three months Vista was available in steps to computer software and hardware manufacturers, retail counters, and business organizations. It was released globally on 30th January 2007, for the general public.

(l) Windows Home Server (m) Windows Server 2008 (n) Windows 7
52

Programming
A program is a set of step by step instructions that direct the computer to do the task user wants. Programming process: Define the problem: Problem can be analyzed by the users wants & needs. Planning the solution: After the analysis a software engineers think that how to plane the solution for the user needs. Coding: Coding is done by different programming tools. Testing: After the coding the s/w which is build, should be tested. Documenting: The detailed description & the programming cycle.
53

Programming (continue)
Programming languages: consists of all the symbols, characters. There are several thousand programming languages, programming languages consists of a vocabulary & set rules (called syntax ), that the programmer must learn. Instruction of programming languages: Input & output instructions ( data c.p.u ) Arithmetic instructions ------ mathematical operation Logical instructions --------- comparison Control instructions ---------- execution Data movement instructions------- copy & move Specification instructions--------- to specify memory allocation.
54

Programming (continue)
Levels of Programming Languages: Basically, programming languages are divided into different levels. 1) Low level languages 2) High level languages.

55

Programming (continue)
Levels of Programming Languages:
Levels Of Prog: Languages

Low Level Languages

High Level Languages

Machine Level Languages Assembly Level Languages

V.High Level Languages Natural Languages

56

Programming (continue)
Low level languages: Low level computer programming languages are machine codes or close to it. Computer cant understand instructions given in high level languages or in English. It can only understand & execute instructions given in the form of machine language, i.e. the language of 0, 1. There are two types of low level language.
1. Machine Languages 2. Assembly languages
57

Programming (continue)
1)Machine language: ( first generation language) (Instruction that computer execute directly). It is the lowest & most elementary level of programming language & was the first type of programming language which to be developed. Computer can only understand machine language. The computer manufacturer when design a computer so it will be necessary to obey just one language, i.e. machine code. 0, 1, where 0, stands for OFF & 1, stands for ON, of electric pulse.

58

Programming (continue)
Advantages: It makes fast and efficient use of the computer. It requires no translator to translate the code i.e. directly understood by the computer. Disadvantages: All operation codes have to remember. All memory addresses have to be remembered. To find out the error, is difficult. These are machine dependent.
59

Programming (continue)
Assembly language: (second generation language) designed to overcome the difficulties of machine language. The operation codes & operands are given in the form of alphanumeric symbols instead of 0s & 1s. These codes were called mnemonic codes, e.g. ADD for addition, SUB for subtraction, e.t.c. there was very small English support language given to this language. The instructions of the Assembly language will also be converted to machine codes by language translator to be executed by the computer. E.g. ADD CX AX.
60

Programming (continue)
Advantages: It is easy to use & understands as compared to machine language. Its error may be located easily. The modification is easy. Disadvantages: It is also machine dependent It was machine dependent so the programmer should have the knowledge of the hardware.
61

Programming (continue)
High level languages: (third generation language) This type of computer language is very much like everyday text & mathematical formulas. Its designed is to run on different computers with few or no change. It means the compatibility. Its format close to English language these are basically symbolic languages rather than mnemonic codes. This type of languages depends on.
Type of the problem. Purpose :business, educational e.t.c Ease of learning & use. Portability Documentation provided.

62

Programming (continue)
Advantages: User friendly. Similar to English vocabulary. Less time required to write. Easier to maintain. It is problem oriented. It is compatible. Portable. Disadvantages: It should be translated for the convert in machine language, so the computer time is waste.
63

Programming (continue)
Very high level languages: (fourth generation)
In this type of languages, programs are developed; speed is much higher and also required minimum user effort. The level of programming skills not required much more. Its maintenance is less because it reduces error. When we want to change the program so it is easy. These languages usually used in conjunction with data base. Query languages Report generators Application generators Decision support system & financial planning language (information & data) Micro computer application s/w (create s/w for specification)
64

i. ii. iii. iv. v.

Programming (continue)
Natural languages: The natural languages statements are very closely resemble to human speech. These types of languages used in expert system, artificial intelligence e.t.c.

65

Programming (continue)
Translators: Translators are used to: how to translate the programming code to machine language (0, 1). There are three types of Translators used in any programming language, for to convert code to machine language.
i. Assembler: ii. Complier: iii. Interpreter:

66

Programming (continue)
Assembler: Translate assembly code to machine language supplied by the manufacturer of computer. Complier: Program written in high level language to convert in machine instructions, before running the program, i.e. whole program. Interpreter: Program written in high level language to convert in machine instruction, before running the program , i.e. each & one statement of the code.
67

Data Communication and Networks


Data Representation Different forms of data Representation Text: bit pattern i.e 0,1 Numbers: Bit pattern i.e 0,1 Images: Bit Pattern but mechanism is different , Image is divide into pixels, called as resolution. Audio: converted into signals Video: combination and image and video.

68

Direction of Data flow


Communication b/w two devices can be of three types Simplex : data is unidirectional, one device transmits and the other receive, e.g. keyboard

69

Direction of Dataflow
Half duplex: each device can transmit and receive data/message but not at the same time, it is like one lane road. E.g walkie talkies, radios, etc

70

Modes of data communication


Full duplex: Both devices can transmit and receive data simultaneously. In full duplex signals going in either direction share the capacity of the link. E.g. Telephone network

71

Data communication
Sharing of information exchange of data b/w two devices via some form of transmission medium.

Fundamentals characteristics of data communication: Delivery: correct destination, sender or receiver Accuracy: in time of transmission data must secured Timeliness: Timely manner

72

Components of data communication


1)Message 2)Sender 3)Receiver 4)Medium 5)Protocol
Step#1 Step# 2 Step# 3 .. .. Step#1 Step# 2 Step# 3 .. ..

Protocol

Message

Protocol

Protocol

Message

Medium Sender Receiver 73

Types of Networks
There are three types of Networks: 1) LAN (Local Area Network) 2) MAN( Metropolitan Area Network) 3) WAN (Wide Area Network)

74

Local Area Network


Privately owned Within single office, building or campus May be as simple as two PCs and a printer Limited to few Kilometers Limited users

75

Metropolitan Area Network


Designed to extend over an entire city May be a single network It may be a means of connecting a number of LANs A company can use a MAN to connect the LANs in all its offices through a city MAN may be wholly owned and operated by a private company E.g: cable TV network

76

Wide Area Network


Provides long distance of transmission of data, voice, image, video over large geographic areas May be country to country, continent to continent Unlimited number of users Internet is best example of WAN

77

Networks and the Internet


What is a network?
Collection of computers and devices connected together
Communications Communications Device Device
Enables aa Enables connection connection between between computers computers One type is a modem
78

Communications Communications Media Media


Cables Telephone lines Cellular radio Satellites

Networks and the Internet


Why do we need network?
To share To share
Resources Resources Hardware Hardware devices devices Software Software programs programs

Data Data Information Information

To save To save time time and and money money


79

Internet
Also called internetworking Technically it is best defined technology for linking LANs into a huge congested networks. ISP( who sell internet subscription to the public Interoperability Global Network of computers More interactive than the other types of media

80

Internet
Worldwide collection of networks that connects millions of computers

81

Internet (History)
The internet began way back in 1961, but it was called the ARPANET (Advanced Research project Agency), within the US defense Department, in conjunction with a number of universities & military contractors. Its purpose was to explore the possibility of a communication. Network that could survive a nuclear attack. The ARPANET quickly developed into a communication tool. It was used for e-mail, discussion groups & for exchanging files. In 1979 its capacity of users increased & popular & more universities connected. Some other communication networks were introduced, but these were not go along with internet because they have very complications & problems in communication with other computers.
82

Internet (History)
In 1983 a standard communication protocol was introduce called as TCP/IP (transmission control protocol / internet protocol). So the internet became very sophisticated & increasingly growth of internet starts of its multi advantages. Protocols: In data communication & networking, a standard specifying the format of data & the rules to be followed is called Protocol. The function of a network are the standards, these are Protocols.
83

Internet (uses)
(1) To find general information about a subject: The web is like a huge encyclopedia of information. The information find on the internet is amazing, It offers much different perspective on one single topic Also we can access that information which is not easily accessible, e.g. online apply to international universities reading books, much more information.

84

Internet Uses (Continue)


(2) To meet people: The web is generally a very friendly place. People may use e-mail which is cheap & very easy, also it is very faster. Different types of chatting software's have been developed for this purpose. It offers text chat as well as voice chatting also.

85

Internet Uses (continue)


(3) To learn: On-line distance education courses can give you an opportunity to gain a qualification over the internet. (4) To find softwares: The internet contains a wealth of useful downloadable softwares. Some are for limited time & some are full versions of software.

86

Internet Uses (continue)


(5) To buy things: If you want to buy something through internet, so there are many companies who offering his services. But Security for online shopping is still not good, as well as some websites may have minimal security. (6) To advertise a product: Most company websites start up as a big advertisement for their products & services. Companies may also give away some information for free as an incentive for people to visit their pages.

87

Internet Uses (continue)


(7) To sell a product: Internet shopping (E- commerce) is still is its growth it takes a very good marketing strategy to actually make money out of selling items over the web. (8) To make money: A popular way to make money out of the web is from advertising revenue. Popular websites have banners at the top of the page attract people to click them and be taken to the advertisers website. These banners are generally animated and very appealing, with good messages, to make users wonder.
88

Internet Uses (continue)


(9)To share knowledge with the world: Many individuals write webpages to share information about their interest or hobbies. They just feel that the web has given then so much information that at least they can put something that can be useful for others.

89

Internet (Features)
1) Geographic distribution: Connection to any part of it, can communicate with all of it. Global village

90

Internet (Features)
2) Robust Internet Architecture No central control, administration or authority Cant be bought, hijacked or monopolized A damaged computer connected to internet cant effect the whole network

91

Internet (Features)
3) Internet near light speed: Digital information such as internet packets travel at 2/3 of the speed of light on copper wire and on fiber optic cables Light speed is 300,000 km/sec

92

Internet (Features)
4) Universal internet access: Gives same powerful capabilities to everyone who has connected and accessing the internet

93

Internet (Features)
5) Internet Growth rate: Depends upon three directions size: more than half the worlds population now using internet Power: more powerful software's have been developed Functionality: new software's and new browsers

a) b) c)

94

Internet (Features)
6) The internet digital advantage: Digital data doesn't degrade Internet is based on digital data The information never changes or becomes distorted over time or in transmission b/w sites.

95

Internet (Features)
7) Internet freedom of speech: Common area, Public place like village. Any thing that any body wishes to say can be heard by anyone else connected to internet.

96

Web Browser
A web Browser display a web document and enables users to access linked documents When the user chooses a hyperlink, the browser originates a message to a web server Browser also contains navigation tools The first web browsers were Text -only browsers first successful graphical browser, mosaic Developed by the National center for supercomputing Application (NCSA)

97

Web server
A web server is a program that waits for browsers to request a web page. When the server receives request for a specific resource, it looks for the requested file & sends it to the browser

98

Networks and the Internet


What is the World Wide Web (WWW)?
Billions of documents, called Web pages, available to anyone connected to the Internet
A Web site is A Web site is aacollection of collection of related Web pages related Web pages

A Web page contains A Web page contains text, graphics, sound, text, graphics, sound, video, and links to video, and links to other Web pages other Web pages

You can share You can share information by information by creating Web pages creating Web pages or posting photos on or posting photos on aaphoto community photo community
99

Prepared by: Adam Khan


100

Das könnte Ihnen auch gefallen