Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing Systems & Programming ECE 1113. Fundamental Concepts Chapter 1 Engineering Problem Solving.

Similar presentations


Presentation on theme: "Computing Systems & Programming ECE 1113. Fundamental Concepts Chapter 1 Engineering Problem Solving."— Presentation transcript:

1 Computing Systems & Programming ECE 1113

2 Fundamental Concepts Chapter 1 Engineering Problem Solving

3 Contents Computing Systems Types of Computers Computer Hardware Computer Software Executing a Computer Program Key Terms The C Programming Language An Engineering Problem-Solving Methodology First C Program

4 Computing Systems: Hardware and Software A computer is a machine designed to perform operations specified with a set of instructions called a program. Hardware refers to the computer equipment. keyboard, mouse, terminal, hard disk, printer Software refers to the programs that describe the steps we want the computer to perform.

5 Types of Computers Supercomputers -the largest and fastest -used primarily for large scientific or military calculations -occupy a room or rooms space -very expensive

6 Mainframe computers -not as fast or as large as supercomputers -usually take up a portion of a room -can be accessed from remote locations on campus Minicomputers -less powerful than mainframes -inexpensive enough to be owned by a small businesses Workstations -can be as powerful as minicomputers -used for engineering applications (CAD/CAM), desktop publishing, software development, which require a moderate amount of computing power & high quality graphic. Personal computers, Laptops & Palmtops

7 Computer Hardware CPU - Central processing unit ALU - Arithmetic and logic unit ROM - Read only memory RAM - Random access memory CPU Internal Memory External Memory InputOutput Processor ALU

8 Computer Software

9 Operating System - Provides an interface with the user unix, windows, linux,... Software Tools word processors (MicrosoftWord, WordPerfect,...) spreadsheet programs (Excel, Lotus1-2-3,...) mathematical computation tools (MATLAB, Mathematica,...) Computer Languages machine language assembly language binary language high level languages (C, C++, Ada, Fortran, Basic, java)

10 Executing a Computer Program Compiler Converts source program to object program Linker Converts object program to executable program CompileLink/loadExecute C language program Machine language program Program output Input data

11 Programming Errors Compile-time errors (compiler error) easy to debug Execution errors/run-time errors/logic error Error during linking or loading hard to debug might course your program to stop execute or not stop the program from executing the computer will perform step precisely as we specify (wrong specification, wrong execution)

12 Key Terms Source Program printable/Readable Program file Object Program nonprintable machine readable file Executable Program nonprintable executable code Syntax errors reported by the compiler Linker errors reported by the linker Execution/Run-time errors reported by the operating system Logic errors not reported

13 The C Programming Language General purpose, machine-independent language (portable between different computers and processors) Developed at Bell Labs in 1972 by Dennis Ritchie American National Standards Institute(ANSI) approved ANSI C standard in 1989 Useful for operating systems and low level computer applications Closely related to the hardware architecture and can be implemented to give high speed and small executable code. Has a wide set of facilities for data operations and control structures.

14 An Engineering Problem-Solving Methodology 1. PROBLEM STATEMENT 2. INPUT/OUTPUT DESCRIPTION 3. HAND EXAMPLE 4. ALGORITHM DEVELOPMENT 5. TESTING

15 PROBLEM STATEMENT -State the problem clearly INPUT/OUTPUT DESCRIPTION -Describe the input and output information HAND EXAMPLE -Work the problem by hand (or with calculator) for a simple set of data ALGORITHM DEVELOPMENT -Develop a solution and convert it to a computer program TESTING -Test the solution with a variety of data & compare with hand example

16 Example1 Problem Statement Compute the straight-line distance between two points in a plane Input/Output Description Hand Example Point1 Point2 Distance between points

17 Algorithm Development /*---------------------------------------------------*/ /* Program chapter1_1 */ /* */ /* This program computes the */ /* distance between two points. */ #include int main(void) { /* Declare and initialize variables. */ double x1=1, y1=5, x2=4, y2=7, side_1, side_2, distance; /* Compute sides of a right triangle. */ side_1 = x2 - x1; side_2 = y2 - y1; distance = sqrt(side_1*side_1 + side_2*side_2); /* Print distance. */ printf("The distance between the two points is " "%5.2f \n",distance); /* Exit program. */ return 0; } /*---------------------------------------------------*/

18 Testing Compare the result that you have calculated with the result from your program.

19 First Program - sum two numbers /******************************************************************/ /* Program chapter1 */ /* */ /* This program computes the sum two numbers */ #include int main(void) { /* Declare and initialize variables. */ double number1 = 473.91, number2 = 45.7, sum; /* Calculate sum. */ sum = number1 + number2; /* Print the sum. */ printf(“The sum is %5.2f \n”, sum); /* Exit program. */ return 0; } /***************************************************************************/


Download ppt "Computing Systems & Programming ECE 1113. Fundamental Concepts Chapter 1 Engineering Problem Solving."

Similar presentations


Ads by Google