Вы находитесь на странице: 1из 13

Engineering Problem Solving with C

Fundamental Concepts Chapter 1 Engineering Problem Solving

ECE1113 Sem I 05/06

saz / Chap1

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.

ECE 1113 Sem I 05/06

saz / Chap 1

Computer Hardware
Internal Memory External Memory

Processor Input ALU Output

CPU

   

CPU - Central processing unit ALU - Arithmetic and logic unit ROM - Read only memory RAM - Random access memory
saz / Chap 1

ECE 1113 Sem I 05/06

Computer Software
 Operating System - Provides an interface with the user


unix, windows, linux, ... word processors (MicrosoftWord, WordPerfect, ...) spreadsheet programs (Excel, Lotus1-2-3, ...) mathematical computation tools (MATLAB, Mathematica, ...) machine language assembly language binary language high level languages (C, C++, Ada, Fortran, Basic, java)
saz / Chap 1

 Software Tools
  

 Computer Languages
   

ECE 1113 Sem I 05/06

Main Memory
 Information is stored in main memory in bits

(binary digits).  Each bit is capable of being in one of two states that can be described in numerous ways:
     

On or Off Charged or discharged One or Zero True or False Set or Clear High or Low
saz / Chap 1

ECE 1113 Sem I 05/06

Executing a Computer Program


Input data C language program Machine language program Program output

Compile

Link/load

Execute

 Compiler


Converts source program to object program

 Linker


Converts object program to executable program

ECE 1113 Sem I 05/06

saz / Chap 1

Programming Errors
 Compile-time errors (compiler error)
   

easy to debug 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)
saz / Chap 1

 Execution errors/run-time errors/logic error

ECE 1113 Sem I 05/06

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

ECE 1113 Sem I 05/06

saz / Chap 1

The C Programming Language


 General purpose, machine-independent

language
 Developed at Bell Labs in 1972 by Dennis

Ritchie
 American National Standards Institute(ANSI)

approved ANSI C standard in 1989

ECE 1113 Sem I 05/06

saz / Chap 1

An Engineering Problem-Solving Methodology


1. PROBLEM STATEMENT 2. INPUT/OUTPUT DESCRIPTION 3. HAND EXAMPLE 4. ALGORITHM DEVELOPMENT 5. TESTING

ECE 1113 Sem I 05/06

saz / Chap 1

First Program - sum two numbers


/******************************************************************/ /* Program chapter1 */ /* */ /* This program computes the sum two number */ #include <stdio.h> 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; } /***************************************************************************/

ECE 1113 Sem I 05/06

saz / Chap 1

Engineering Application
         
ECE 1113 Sem I 05/06

Aerospace Engineering Biomedical Engineering Chemical Engineering Computer Engineering Electrical Engineering Environmental Engineering Genetic Engineering Manufacturing Engineering Mechanical Engineering Ocean Engineering
saz / Chap 1

Engineering Grand Challenges


 Prediction of Weather, Climate, and

Global Change  Improvement in Vehicle Performance  Computerized Speech Understanding  Enhanced Oil and Gas Recovery  Human Genome Project

ECE 1113 Sem I 05/06

saz / Chap 1

Вам также может понравиться