Upload
student-life
View
56
Download
3
Embed Size (px)
Citation preview
EC-102 Computer System and Programming
Lecture 1Fundametals
02/05/23 Lecture 1, Computer System and Programming EME
(NUST)
1
Introduction – (Yours) Name Previous institution Grade/Marks Aims and goals
02/05/23Lecture 1, Computer System and Programming EME (NUST) 2
Course Information
Course Title: Computer System & Programming
Course Code: EC-102 Semester: Fall 2016
02/05/23Lecture 1, Computer System and Programming EME (NUST) 3
Books Textbook:
C++ How to program, P. Deitel and H. Deitel, Prentice Hall, Latest Issue
Reference: Object-Oriented Programming in C++, Robert Lafore, Sams
Publishing, 4th edition, 2001 Programming with ANSI C, DP Publications Ltd, 1995, By B. J.
Holmes. The C programming language by Kernighan and Richie. Structured Computer Organization, Andrew S. Tanenbaum and
Todd Austin, Prentice Hall, 6th edition, 2012
02/05/23Lecture 1, Computer System and Programming EME (NUST) 4
Course Contents Introduction to computers, central processing unit
organization, main memory organization, secondary storage organization, input/output devices interaction/organization
What is Programming? Algorithms, computer languages, Compiler, Assembler and Interpreter, Data and results.
Data, Data types, data representation, identifiers, reserved words, variables, constants.
Inputs and outputs, Standards Library, address operator, string I/O, character I/O.
Escape sequences, format specifiers, assignment statement, Compound operators, Instruction Sequence, Sequential structures, ASCII. 02/05/23
Lecture 1, Computer System and Programming EME (NUST) 5
Course Contents Arithmetic operators, operator precedence, Selection, Relational
and logical operators. If/else. Nested if’s conditional operator, conditional expressions,
switch statements. Repetition, While, do/while, for(;;), break and continue statements. Functions, Programmer defined functions, library functions,
storage classes, scope, parameter passing. Arrays, input and output of data, searching. Array of characters, array as parameters. Pointers, address and indirection operators, pointer arithmetic, pointers and
arrays, call by value and call by reference.
02/05/23Programming EME (NUST) 6
Course Learning OutcomesCourse Learning Outcomes (CLOs)
Level of Learning PLO
1. Applying concepts of selection statements and repetition
structures in solving complex problems.C3 1
2. Understanding and implementing different functions in C++. C3 1
3. Design algorithms to solve complex problems using arrays and
pointers.C6 3
4. Create a software development process by designing,
implementing and testing C++ programs.P4 3
02/05/23Lecture 1, Computer System and Programming EME (NUST) 7
Policies No extensions in assignment deadlines. Quizzes will be unannounced. Exams will be closed book. Never cheat.
“Better fail NOW or else will fail somewhere LATER in life”
Plagiarism will also have strict penalties.
Adapted from What is Plagiarism PowerPointhttp://mciu.org/~spjvweb/plagiarism.pptCourtesy Dr. Khawar
02/05/23Lecture 1, Computer System and Programming EME (NUST) 8
Computer System
Introduction to Computers A computer is an electronic device, operating under
the control of instructions (software) stored in its own memory unit, that can accept data (input), manipulate data (process), and produce information (output) from the processing. Generally, the term is used to describe a collection of devices that function together as a system.
Devices that comprise a computer system
Printer (output)
Monitor (output)
Scanner (input)
Speaker (output)
Mouse (input)
Keyboard (input)
System unit(processor, memory…)
Storage devices(CD-RW, Floppy, Hard disk)
Compare a computer ,Typical workshop features
Materials Tools Working Area Storage Measurements
Workshop Materials: Wood Tools: Hammer, screw driver, drill… Work area: Worktable Storage: Cabinet Measurements Yards, feet, inches, meters,
centimeters, millimeters
Compare a computer, Kitchen Materials: Food Tools: Stove, mixer, spoon… Work Area: Counter, cutting board, bowl… Storage: Refrigerator, cabinet… Measurements: Cups, tablespoons, teaspoons etc
Computers How does this apply to computers? You will find materials, tools, work area,
storage, and measurements
Computer Materials Information
Words Numbers Pictures
Computer Tools Two kinds:
Hardware Physical parts to computer
Software All information or data This slide show for example
Computer Working Area The work area of a computer is called a window. The figure shows a typical window.
Computer Storage Two main types:
Memory (RAM) Data Storage (CD, DVD, Flash Drive)
Measuring Information Bytes
One character takes up about one Byte. An email takes up a few (thousand bytes) Kilobytes
(thousands of bytes) A picture may take up Megabytes (millions of
bytes) All the information on a computer may run into
Gigabytes (billions of bytes) Terabytes (TBs)
What Does A Computer Do? Computers can perform four general operations,
which comprise the information processing cycle.
Input Process Output Storage
Data and Information All computer processing requires data, which is a
collection of raw facts, figures and symbols, such as numbers, words, images, video and sound, given to the computer during the input phase.
Computers manipulate data to create information. Information is data that is organized, meaningful, and useful.
During the output Phase, the information that has been created is put into some form, such as a printed report.
The information can also be put in computer storage for future use.
Why Is A Computer So Powerful? The ability to perform the information processing
cycle with amazing speed. Reliability (low failure rate). Accuracy. Ability to store huge amounts of data and
information. Ability to communicate with other computers.
How Does a Computer Know what to do? It must be given a detailed list of instructions,
called a compute program or software, that tells it exactly what to do.
Before processing a specific job, the computer program corresponding to that job must be stored in memory.
Once the program is stored in memory the computer can start the operation by executing the program instructions one after the other.
What Are The Primary Components Of A Computer ? Input devices. Central Processing Unit
(containing the control unit and the arithmetic/logic unit).
Memory. Output devices. Storage devices.
The Central processing Unit (CPU) The central processing unit (CPU) contains electronic
circuits that cause processing to occur. The CPU interprets instructions to the computer, performs the logical and arithmetic processing operations, and causes the input and output operations to occur. It is considered the “brain” of the computer.
Memory Memory also called Random Access Memory or RAM
(temporary memory) is the main memory of the computer. It consists of electronic components that store data including numbers, letters of the alphabet, graphics and sound. Any information stored in RAM is lost when the computer is turned off.
Read Only Memory or ROM is memory that is etched on a chip that has start-up directions for your computer. It is permanent memory.
Output Devices Output devices make the information resulting from
the processing available for use. The two output devices more commonly used are the printer and the computer screen.
The printer produces a hard copy of your output, and the computer screen produces a soft copy of your output
Storage Devices Auxiliary storage devices are used to store data
when they are not being used in memory. The most common types of auxiliary storage used on personal computers are floppy disks, hard disks and CD-ROM drives.
Floppy Disks A floppy disk is a portable, inexpensive storage
medium that consists of a thin, circular, flexible plastic disk with a magnetic coating enclosed in a square-shaped plastic shell.
Hard Disks Another form of auxiliary storage is a hard disk. A
hard disk consists of one or more rigid metal plates coated with a metal oxide material that allows data to be magnetically recorded on the surface of the platters.
The hard disk platters spin at a high rate of speed, typically 5400 to 7200 revolutions per minute (RPM).
Storage capacites of hard disks for personal computers range from 10 GB to thousands of GBs.
Solid State Drives (SSD)
Compact Discs / DVD / Blu ray A compact disk (CD), also called an optical disc, is a flat
round, portable storage medium that is usually 4.75 inch in diameter.
A CD-ROM (read only memory), is a compact disc that used the same laser technology as audio CDs for recording music. In addition it can contain other types of data such as text, graphics, and video.
The capacity of a CD-ROM is 650-700 MB of data
Flash Drive Most recent widely used storage system Very portable, often worn like jewelry 128MB to GBs
Computer Software Computer software is the key to productive use
of computers. Software can be categorized into two types:
Operating system software Application software
Operating System Software Operating system software tells the computer how to
perform the functions of loading, storing and executing an application and how to transfer data.
Today, many computers use an operating system that has a graphical user interface (GUI) that provides visual clues such as icon symbols to help the user. Microsoft Windows XP/Vista/7/8 are widely used graphical operating systems. DOS (Disk Operating System) is an older but still rarely used operating system that is text-based.
Application Software Application Software consists of programs that
tell a computer how to produce information. Some of the more commonly used packages are:
Word processing Electronic spreadsheet Database Presentation graphics
Word Processing Word Processing software is used to create and print
documents. A key advantage of word processing software is that users easily can make changes in documents.
Electronic Spreadsheets Electronic spreadsheet software allows the user to add,
subtract, and perform user-defined calculations on rows and columns of numbers. These numbers can be changed and the spreadsheet quickly recalculates the new results.
Presentation Graphics Presentation graphic software allows the user to create
documents called slides to be used in making the presentations. Using special projection devices, the slides display as they appear on the computer screen.
Von Neumann Machine First stored programmed computer, basis of
modern digital computers. Memory Arithmetic and Logic Unit Control Unit I/O Equipment Inside ALU , Special 40bit register called
Acuumulator
Von Neumann Machine
The First Microprocessor – 1971 Intel 4004
Microprocessor The 4004 had 2,250
transistors 108Khz Called “Microchip”
What is a Microchip? Very Large Scale Integrated Circuit (VLSIC)
Transistors, resistors, and capacitors 4004 had 2,250 transistors Pentium IV has 42 MILLION transistors
Each transistor 0.13 microns (10-6 meters) Getting smaller and smaller, but we are still
using microchip technology
The Computer Spectrum
Birth of Personal Computers - 1975 256 byte memory (not
Kilobytes or Megabytes)
2 MHz Intel 8080 chips Just a box with flashing
lights cost $395 kit, $495
assembled.
Personal Computer
This circuitboard is at the heartof every personalcomputer. Thisfigure is aphotograph of theIntel D875PBZboard. Thephotograph iscopyrighted by theIntel Corporation,2003 and is used bypermission.