Title: Software
1(No Transcript)
2Software
3How Programs Direct the CPU
- the typical CPU is designed to perform basic
arithmetic, logic, and data transfer operations - a program is a list of instructions that direct
the processing of the computer - programs are stored in memory and executed
step-by-step by the CPU - programs are translated to machine code for
execution on a given processor
4Assembly Instruction Set
5A Simple Program
6Programming Language
- a tool for expressing computational processes
- a program is a list of statements in a
programming language - programs are symbolic representations of
computational processes - programs are translated to machine code for
execution on a given processor
7Programming Languages
- ASSEMBLY LANGUAGES
- 11 representations of host processor machine
code - symbolic representations
- not portable
- Assembler translated code to machine language
- HIGH LEVEL LANGUAGES
- 1many representations of the machine code
- more abstract
- portable (with translation programs)
- Interpreter or Compiler translated code to
machine language
8A Simple Program
9A Simple Program
ltHTMLgt ltHEADgt ltTITLEgtimage scriptlt/TITLEgt
ltSCRIPT LANGUAGEmJavaScriptftgt var counter
0 function changers counter 1 if (counter
4) counter 0 document.images
O.src counter '.jpg' lt/SCRIPTgt lt/HEADgt
ltBODY BGCOLORFFFFFFgt ltPgtClick on the image
to change it.lt/Pgt ltPgt ltA HREF""
onclickchanger()gtltIMG SRC0.jpg WIDTH279
HEIGHT184 BORDERO ALIGNbottomgt lt/Agt lt/Pgt
lt/BODYgt lt/HTMLgt
10A Simple Program
FORTRAN DO 100 I 1, 10 PRINT
,I 100 CONTINUE
11A Simple Program
FORTRAN DO 100 I 1, 10 PRINT
,I 100 CONTINUE COBOL 100-PERFORM
200-PRINT-NUMBERS UNTIL COUNT IS EQUAL
10. 200-PRINT-NUMBERS ADD 1 TO
COUNT. WRITE COUNT TO DETAIL-LINE. WRITE
DETAIL-LINE AFTER ADVANCING 1 LINES
12A Simple Program
FORTRAN DO 100 I 1, 10 PRINT
,I 100 CONTINUE COBOL 100-PERFORM
200-PRINT-NUMBERS UNTIL COUNT IS EQUAL
10. 200-PRINT-NUMBERS ADD 1 TO
COUNT. WRITE COUNT TO DETAIL-LINE. WRITE
DETAIL-LINE AFTER ADVANCING 1
LINES BASIC 100 FOR I 1 TO 10 110
PRINT I 120 NEXT I
13Programming Paradigms
- A paradigm is a model of a process
- PROCEDURAL- The code specifies WHAT and HOW the
processes is to be done - NON-PROCEDURAL- the code specifies WHAT is to be
done, but not HOW - OBJECT ORIENTED- the data and code are together
in units
14Programming Paradigms
- PROCEDURAL Program instructs the computer HOW
to produce results. - OPEN addressfile for reading
- WHILE NOT EOF DO
- READ first, last, address, city, state, zip
- IF last Massey THEN
- PRINT first, last
- ENDIF
- SKIP
- CLOSE addressfile
15Programming Paradigms
- NON PROCEDURAL The program has instructions
WHAT is to be done, but not HOW it is to be done. - SELECT first, last
- FROM addressfile
- WHERE last Massey
- ORDER by last, first
- SEND TO PRINTER
16Programming Paradigms
- OBJECT-ORIENTED contains both data and programs
that operate on the data. - Person object
- attributes of name, address, etc
- Methods of printing address, finding a name,
sorting - Employer object
- subclass of person
- addition attributes of parking space number,
stock options - additional methods of list members of department
17Visual Programming
- a method of using a GUI of predetermined objects
to create the code automatically by manipulating
graphical objects
Visual Programming allows programmers to write
programs by drawing pictures and pointing to
objects on the screen
18Software Complexity
- tasks that software systems model are often
complicated and not well understood - scale of software systems is often too great for
a single person to comprehend and manage - software systems components interact in
unpredictable ways
19Risks of Software
- Mariner I Atlas booster fails (18 million)
- Mariner 8 probe lost
- Therac X-ray system kills two and injures others
- Over 1,000 British cancer patients are underdosed
in radiation therapy - Airbus 320 crashes due to control system problems
- Audi 5000 recalled after 250 accidents blamed on
computer-controlled system malfunction - ATT computer switching failure (1/15/90)
20How People Solve Problems
Problem solving involves
- Understanding the problem
- Devising a plan for solving the problem
- Carrying out the plan
- Evaluating the solution
21How People Make Programs
Programming involves
- Defining the problem
- Devising, refining and testing the algorithm
- Writing the program
- Testing and debugging the program
22Program Development Cycle
- ANALYSIS SPECIFICATION
- understanding the process or problem
- deciding on requirements and features
23Program Development Cycle
- DESIGN
- devising a plan
- dividing tasks into program components
- writing algorithms for program components
24Program Development Cycle
- CODING
- employing symbolic programming languages as an
aid - translating algorithms into executable programs
25Program Development Cycle
- TESTING CORRECTION
- assembling/testing program components
- testing the system
- maintenance revising the system to meet new
specifications
26Software
- In house completed version is called
- Alpha version
- A complete version sent out to users to test
- Beta Version