Está en la página 1de 29

Programming Language II

Introduction
LECTURER: PROFESSOR DR. M. MONESS

TUESDAY 8:30-10 & 10:30-12 A. M.

About This Course


Introduction to computer programming using

MATLAB Overall course goals


Describe and motivate Computer Programming Explain the principles underlying problem solving Equip you with tools to design problem solutions Explore more advanced ideas
Abstract data types Object oriented programming

What I Hope to Achieve


Explain concepts clearly and completely Encourage understanding, not memorization

Be available to answer questions and encourage

deeper topic comprehension

What I Expect from You


Pay attention during class time Make best effort on assignments, both in-class and

take-home
Be willing to ask questions when something is not

clear

Course vitals
Textbook: MATLAB Programming for Engineers

by Stephen J. Chapman Tools Used: MATLAB

Course vitals: Class Policies


Refrain from cell-phone use during class time

Highly recommended to take notes Dont depend on the PowerPoint slides!


Attendance at every class is important Student guidelines for Freshmen make attendance mandatory Skipping class means you will miss important topic explanations and interactive lab time Basically: Dont cheat. Do all your own work.

Course vitals: Grading Rubric


Homework and Projects: 25 marks Bi-weekly homework assignments Possibly a term project Midterm: 25 marks Participation: 10 marks Based on attendance and class interaction Final Exam: 90 marks

Course vitals: Homework Policy


Do your own work! Unless otherwise stated, all

homework is to be your own individual work.


Tutoring is available and encouraged check with

Eng. Ahmed Mustafa for tutors

Course vitals: Topics Covered


Computer Programming Basics (today) MATLAB Basics (next week) Variables and Arrays Operators and Functions Input, Output, and Plotting Fundamentals of Program Design Logic and Relational Operators Control Structures Loops Custom Functions Data Types and Data Functions

Lecture 1-1

Elements of a Computer System, Microcomputers

Outline
Elements of a Computer System Hardware Components of a Computer System Classification of Computers Microcomputers Modern PCs

Categorisation of Computers
First Generation computers using vacuum tubes (1939-58) Second Generation computers using transistors (1958-64) Third Generation computers using integrated circuits, ICs (1964-75 Fourth Generation Computers using large scale integrated circuits, LSIC (1975- )

Active components

Classification of Computers
Computers are broadly grouped into one of three categories imprecise categories (a moving target) roughly based on power and type of usage Mainframes Minis Micros

Classification of Computers - 2
Mainframes

Multi-user Very high data processing rates & high costs ($100k-$?M) Applications such as banking. Becoming rare. Multi-user Powerful still Typically single user Multi-purpose Workstations: high-end Micros

Minis

Micros

Elements of a Computer System


A computer system is the total environment and method of employment of the computer Main elements: Hardware Software People Procedures

Hardware Components of a Computer System


In order for a computer to do useful work it must have: Input devices: keyboard, mouse, microphone, bar code reader Processing device(s): CPU, graphics Storage: main memory, disk, CD, DVD, USB memory stick Output devices: screen, printer, speaker

CPU
Heart of Computer: - fetches instructions of program from memory - performs operation (e.g., addition) - writes result back into memory - performs simple atomic operations Consists of a number of components

e.g., registers where variables are stored, ALU (Arithmetic/Logic Unit) etc.

Clock speed (measured in MHz) often taken to be the power of the CPU

Can be misleading

Memory
Memory (primary storage) is essential to: hold the instructions of a program that is executing hold the data upon which the program acts Two main types: Random Access Memory (RAM) Read Only Memory (ROM)

Random Access Memory (RAM)

Can be read from and written to Main memory of the computer Volatile - when the power is turned off its contents are lost Different speeds: faster = more expensive. Small amount of fast memory used as a cache

Read Only Memory (ROM)

Cannot be written to by user Non-volatile (burned in at time of manufacture) Often used to hold the boot code on micros

Secondary Storage
Non-volatile (persistent) record of data and programs Diverse range of equipment with different properties

Disks (hard and soft) CD & DVD drive Tape Memory chips (e.g. USB memory stick)

Data kept as files - a collection of data with a name by which it can be addressed (opened, read, written etc.) Cheaper (per byte) than main memory but much slower (100s to 1000s of times)

I/O Devices
Computers need a means to communicate with the user

accept input to act upon (input) produce results (output) keyboard, mouse, scanner, touch screen, modem printer, screen, plotter, microphone, modem

Typical input devices

Typical output devices

Performance characteristics and how to drive them vary remarkably

generally I/O devices are orders of magnitude slower than the CPU

Data Pathways
Bus

connects the components together printed on the motherboard


Address, control, data the wider the bus the more data that can be fetched in one operation fetches (bus operations) are considerably slower than the execution of a CPU instruction (c.f. 800 MHz front-side bus of modern 3.8GHz Pentium 4)

Need to communicate

The Bus is typically a bottleneck on the machine


Anatomy of a Current PC
The major hardware components (on which you will spend your money) of a modern PC include the following:

CPU: Central Processing Unit (clock speed, cache size, manufacturer) Motherboard: Printed circuit board to which CPU, memory, cards etc. are attached Monitor: Display screen. (Size, dpi, resolution and refresh speed + manufacturer).

Anatomy of a Current PC - 2

RAM: Main memory (256Meg +) Hard Disk: Permanent storage. (80gig +) Video Card: Interface between computer and monitor. Also off-load graphics calculations (e.g. Hardware transform & lighting for Video games) Sound Card: Music and sound-effects CD or DVD Drive: Case & Power Supply: Keyboard, Mouse, etc.:

People
Commercial computer systems often require a number of professionals to ensure the smooth running of the system

Evolution towards information officer: multi-skilled

System Administrator/Computer Operator


Programmer Systems Analyst

Procedures

Hardware: how often are computers upgraded or


replaced? Application software: when are new versions purchased? Backup routine: how often? where are copies kept? Anti-virus software: how is is renewed? Security: who has access to servers? Passwords: how many letters / numbers?

Summary
4 main elements of a computer system

software, hardware, people, procedures


micro, workstation, mini, mainframe, super

Classification of computers

Main Hardware Components of a Computer

memory - volatile storage (primary) CPU - program execution Secondary storage devices - permanent copies of data I/O devices - means of communicating with the user bus - means for the components to communicate with each other

También podría gustarte