Docsity

Digital Data Representation and Program Design: A Comprehensive Guide - Prof. Mohamed, Slides of Introduction to Computers

Partial preview of the text

Download Digital Data Representation and Program Design: A Comprehensive Guide - Prof. Mohamed and more Slides Introduction to Computers in PDF only on Docsity!

Data and Program Representation

2

Data and Program Representation

  • In order to be understood by a computer, data and

programs need to be represented appropriately.

  • Coding systems: Used to represent data and programs

in a manner understood by the computer.

  • Digital computers: Can only understand two states, off

and on (0 and 1).

  • Digital data representation: The process of

representing data in digital form so it can be

understood by a computer.

4

Coding Systems for Text-Based Data

ASCII (American Standard

Code for Information

Interchange):

coding system traditionally used

with personal computers

7-bits (English only)

8-bits (English + another

language), also know as:

ISO-8859 or Extended ASCII

Extended ASCII (ISO-8859)

ISO produced a new standard ISO-8859 with 8-bit

characters. Actually, ISO-8859 has many parts.

Each part specifies a number of character sets.

The lower 127 characters in all parts are identical to

ASCII.

Program Design Tools

Definitions

Definitions

An Algorithm

An Algorithm

is a complete step-by-step procedure for solving a

is a complete step-by-step procedure for solving a

problem or accomplishing a task.

problem or accomplishing a task.

A computer program makes use of algorithms. A computer program makes use of algorithms.

Processing (Algorithm)

Input

Output

Basic Flow Chart Operations

Simple Sequence

Simple Sequence

Selection Pattern

Selection Pattern

Loop Pattern

Loop Pattern

All computer instructions are based on three basic processing

patterns:

1.Simple Sequence

Logic involves executing instructions one

statement after another, in the order presented by

the program.

This is the simplest and most-used pattern.

The computer assumes that all instructions are to

be executed in this order unless the program

presents other instructions.

2. Selection Pattern

Requires that the computer make a choice

among two or more items.

Each choice is based on one of two

comparisons a computer can make: true or

false (Yes or No).

Password

is

correct?

Error Message

Yes

Login to System

No

Basic Operations of Flow Charts (Selection Pattern)

Basic Operations of Flow Charts (Loop Pattern)

Basic Operations of Flow Charts (Loop Pattern)

More

Names?

No

Yes

Compare with Criteria

Print Eligible Names

Program flowcharts

Use geometric symbols and familiar relational operators

to provide a graphic display of the sequence of steps

involved in a program.

The steps in a flowchart follow each other in the same

logical sequence as their corresponding program

statements will follow in a program.

Different symbols are used to represent different

actions, such as start/stop, decision, input/output,

processing, and looping symbols.

Program Design:

Program Design Tools

Stop

Subtract Expenses

R = 1000-E

E<1000?

Start

No

Yes

Input Expenses E

Print

You Owe $

Print

You Owe $R

Flow chart Example