SFTW120-LectureNotes-01

SFTW120-LectureNotes-01 - SFTW120 Programming Science...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
SFTW120 Programming Science Lecture Notes 1: Introduction and Overview (Textbook Chapter 1) © Robert P. Biuk-Aghai SFTW120 - Programming Science 2 Lecture Notes 1 Basic principles ± Computers nowadays are widespread : they are used everywhere – traffic control, ATMs, lift control, digital watches, mobile phones, car control, etc. ± All computers follow the same principle: IPO (Input-Processing-Output) Input Output Processing
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SFTW120 - Programming Science 3 Lecture Notes 1 Main components of a computer system Keyboard Monitor Hard Disk CPU RAM Computer Input Output Processing Storage CPU = Central Processing Unit RAM = Random Access Memory SFTW120 - Programming Science 4 Lecture Notes 1 Computer memory ± Two main types: ² Primary memory: RAM (and others, e.g. ROM) ² Secondary memory: hard disk (and others, e.g. CD-ROM) ± Computer programs mainly work with primary memory: main memory ² Running computer programs are stored in main memory ² Data processed by running computer programs is stored in main memory
Background image of page 2
SFTW120 - Programming Science 5 Lecture Notes 1 Computer memory ± Secondary memory also stores programs and data, but: ² To run a program, it first needs to be copied to main memory ² To process data, it first needs to be copied to main memory SFTW120 - Programming Science 6 Lecture Notes 1 Structure of main memory ± Main memory consists of many memory cells ± Each memory cell can store any program or data (numbers, characters, etc.) ± Each memory cell has: ² A ( fixed ) address (0, 1, 2, …) ² A ( changing ) content or value (a number, character, program code, …) ² A ( fixed ) size (measured in bytes ; one byte can store one character) Contents Address 75.62 999 X 998 . . . . . . H 4 -26 3 0.005 2 364 1 -27.2 0 Example: Main memory with 1000 memory cells
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SFTW120 - Programming Science 7 Lecture Notes 1 Variables ± Memory cells are usually not accessed directly through their address, but through variables ± A variable is: “a name associated with one or more memory cells” ± Computer programs create variables for storing and retrieving data in memory ± The contents of the variable may change, but the name of the variable stays the same temp code dist Variable Contents Address 75.62 999 X 998 . . . . . . H 4 -26 3 0.005 2 364 1 -27.2 0 Example: Variable names for three main memory cells SFTW120 - Programming Science 8 Lecture Notes 1 Programs ± Computers process data ± Processing of data is done according to a set of instructions called a program ± For example: (part of a program to control a lift) lift-floor != button-floor) send-lift-to(button-floor);
Background image of page 4
SFTW120 - Programming Science 9 Lecture Notes 1 Programming science ± Programming may be seen as an art and a science – this course teaches the science of programming ± Programming involves solving a problem ± An algorithm provides the solution to a specific kind of problem: algorithm = a list of steps for solving a problem ± Programming science involves:
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/04/2011 for the course SFST 120 taught by Professor Dr.robert during the Spring '11 term at University of Macau.

Page1 / 16

SFTW120-LectureNotes-01 - SFTW120 Programming Science...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online