CSC141 - INTRODUCTION TO COMPUTER PROGRAMMING CREDIT HOURS 4(3,1) Teacher: AHMED MUMTAZ MUSTEHSAN.

Slides:



Advertisements
Similar presentations
D75P 34 – HNC Computer Architecture Week 10 Computer Memory. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated.
Advertisements

Parts & Functions of a Computer. 2 Functions of a Computer.
Introduction to Microprocessors Number Systems and Conversions No /6/00 Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
Memory Devices Wen-Hung Liao, Ph.D..
Enhanced A+ Guide to Managing and Maintaining Your PC Third Edition.
COMPUTER MEMORY Modern computers use semiconductor memory It is made up of thousands of circuits (paths) for electrical currents on a single silicon chip.
Computer memory.
ALGORITHMS AND PROGRAMMING LANGUAGES Lecture 5: Algorithms and programming languages Networks and Communication Department 1.
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.
Memory. When we receive some instruction or information we retain them in our memory. Similarly a computer stores the instructions for solving a problem,
COMPONENTS OF A PERSONAL COMPUTER.
F1020/F1031 COMPUTER HARDWARE MEMORY. Read-only Memory (ROM) Basic instructions for booting the computer and loading the operating system are stored in.
RAM (random access memory)
COMPONENTS OF THE SYSTEM UNIT
Memory. Random Access Memory Defined What is memory? operating system and other system software that control the usage of the computer equipment application.
Computer Architecture Part III-A: Memory. A Quote on Memory “With 1 MB RAM, we had a memory capacity which will NEVER be fully utilized” - Bill Gates.
CS102 Introduction to Computer Programming
Tools make jobs easier to do -A computer is a tool used by many professions A computer can do many different jobs because they are programmable - Machine.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
C.S. Choy95 COMPUTER ORGANIZATION Logic Design Skill to design digital components JAVA Language Skill to program a computer Computer Organization Skill.
Memory Hierarchy.
Memory Main memory consists of a number of storage locations, each of which is identified by a unique address The ability of the CPU to identify each location.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
Lesson 3 — How a Computer Processes Data
Chapter 3 Computer Hard ware
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 2. Computer Structure Computer Structure The traditional diagram of a computer...
Introduction to Computing: Lecture 4
Random access memory.
1 A+ Guide to Managing and Maintaining Your PC, Fifth Edition Hardware Needs Software to Work Hardware  Physical components of a computer  Visible part.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 1 Introducing Hardware.
Discovering Computers 2012: Chapter 4
CISC105 General Computer Science Class 1 – 6/5/2006.
 Computer memory is device that is used to store data or programs (sequences of instructions) on a temporary or permanent basis for use in an electronic.
© Banff and Buchan College 2007 DH2T 34 Computer Architecture 1 LO2 Lesson One Memory.
1Copyright © Prentice Hall 2000 The Central Processing Unit Chapter 3 What Goes on Inside the Computer.
CIM101 : Introduction to computer Lecture 3 Memory.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
Lesson 3 — How a Computer Processes Data Unit 1 — Computer Basics.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
SKILL AREA: 1.2 MAIN ELEMENTS OF A PERSONAL COMPUTER.
Information Technology Basic Computer Architecture Adnan Khalid.
PROGRAMMING LANGUAGES
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Computer Architecture Lecture 24 Fasih ur Rehman.
Overview von Neumann Architecture Computer component Computer function
Computer operation is of how the different parts of a computer system work together to perform a task.
A memory is just like a human brain. It is used to store data and instructions. Computer memory is the storage space in computer where data is to be processed.
Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)
Components of Hardware 1. Processor Memory Input and output devices Storage 2.
CSC141 Introduction to Computer Programming Programming Language.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
PCs ENVIRONMENT and PERIPHERALS Lecture 3. operating system and other system software that control the usage of the computer equipment application programs.
Seminar On RAM & ROM. PRESENTED BY PRESENTED BY 1) YATIN KSHIRSAGAR. 2) GHANSHYAM DUSANE. 3) GANESH RAJOLE.
Components of Computer. Memory Unit Most important part of the computer Used to store data and instructions that are currently in use Main memory consists.
CSCI-235 Micro-Computer Applications
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Internal Memory.
Memory Main memory consists of a number of storage locations, each of which is identified by a unique address The ability of the CPU to identify each location.
Memory Main memory consists of a number of storage locations, each of which is identified by a unique address The ability of the CPU to identify each location.
The Central Processing Unit
C++ Programming: From Problem Analysis to Program Design
COMPUTER ORGANISATION AND ARCHITECTURE
Introduction to Computing
Computer Memory BY- Dinesh Lohiya.
Introduction to Computing Chapter 0
MICROPROCESSOR MEMORY ORGANIZATION
Lecture 2 (Memory) Computer Organization and Assembly Language. (CSC-210) Dr. Mohammad Ammad uddin.
Computer Memory.
Presentation transcript:

CSC141 - INTRODUCTION TO COMPUTER PROGRAMMING CREDIT HOURS 4(3,1) Teacher: AHMED MUMTAZ MUSTEHSAN

Additional References: 1.Reference book: “Programming Languages and Methodologies” by Robert J. Schalkoff Publisher Jones and Barrlett CSC141 Introduction to Computer Programming

RAM Volatile Memory RAM Volatile Memory ROM Non-Volatile Memory ROM Non-Volatile Memory Loses its contents when power goes off Doesn’t lose its contents when power goes off Memory Types of Memory

CSC141 Introduction to Computer Programming Dynamic RAM (DRAM) Used in Main Memory Slower Data needs to be refreshed periodically Consumes more Power Less Desirable Cheap Dynamic RAM (DRAM) Used in Main Memory Slower Data needs to be refreshed periodically Consumes more Power Less Desirable Cheap Static RAM (SRAM) Used in Cache Memory Faster Data DOES NOT need to be refreshed. Consumes Less Power More Desirable Expensive Static RAM (SRAM) Used in Cache Memory Faster Data DOES NOT need to be refreshed. Consumes Less Power More Desirable Expensive RAM Types of RAM

CSC141 Introduction to Computer Programming Memory Modules SIMM (Single Inline Memory Module) 72-pins Transfers information over a 32-bit data path SIMM (Single Inline Memory Module) 72-pins Transfers information over a 32-bit data path DIMM (Dual Inline Memory Module) 168 and 184- pins Transfers information over a 64-bit data path DIMM (Dual Inline Memory Module) 168 and 184- pins Transfers information over a 64-bit data path RIMM (Robust ® Inline Memory Module) 184-pins Transfers information over a 16-bit data path RIMM (Robust ® Inline Memory Module) 184-pins Transfers information over a 16-bit data path Types of Memory Modules

SIMM, DIMM and RIMM CSC141 Introduction to Computer Programming Source: Webanswers.com

Cache Memory The cache is a small amount of high-speed memory, usually with a memory cycle time comparable to the time required by the CPU to fetch one instruction. The most frequently used instructions are kept in cache memory so that CPU can look there first. Saved time which was wasted by CPU in swapping instructions in and out of main memory. It can be located on Microprocessor chip or on a separate chip next to CPU. CSC141 Introduction to Computer Programming

Levels of Cache Memory L1 (Primary or Internal Cache): Located directly on the processor chip Runs at the same speed as the CPU Small Capacity L2 (Secondary or External Cache): Located directly on the processor chip Runs at CPU speeds (or nearly so) Larger capacity than L1 but slower than L1. L3: Part of the system’s motherboard. Present in high-performance systems like servers. Larger capacity than L2 but slower than L2. CSC141 Introduction to Computer Programming

Types of ROM ROM (Read-Only Memory) PROM (Programmable Read-Only Memory) EPROM (Erasable Programmable Read-Only Memory) EEPROM (Electrically Erasable PROM) Flash EEPROM CSC141 Introduction to Computer Programming

ROM (Read-Only Memory) Also known as Firmware Manufactured with permanently written data. Cannot be erased or written on by the user. PROM (Programmable Read-Only Memory) one-time programmable non-volatile memory manufactured blank depending on the technology, PROM can be programmed at final test. EPROM (Erasable Programmable Read-Only Memory) Multiple times erasable programmable non-volatile memory It requires UV box to erase the EPROM CSC141 Introduction to Computer Programming

EEPROM (Electrically Erasable PROM) user-modifiable read-only memory (ROM) can be erased and reprogrammed (written to) repeatedly through the application of higher than normal electrical voltage generated externally or internally For Example: Flash Memory. CSC141 Introduction to Computer Programming

Flash Memory Non-volatile Electrically Erasable Programmable Read- Only Memory Examples: memory cards, USB flash drives, solid-state drives CSC141 Introduction to Computer Programming Source:

CMOS Memory (BIOS Memory) Small memory on PC motherboards that is used to store BIOS settings. Traditionally called as CMOS RAM It uses a low-power Complementary metal-oxide- semiconductor (CMOS) SRAM which is powered by a small battery to retain information when power goes off. Stores configuration information about the computer Disk drives Keyboard Mouse‘ Monitor Time/date. CSC141 Introduction to Computer Programming

Processing CSC141 Introduction to Computer Programming Input Processing Output Input device Central Processing Unit Main Memory Output Devices Bus

CSC141 Introduction to Computer Programming Data flow for a complete job Input device Central Processing Unit Main Memory Output Devices Steps (b) and (c ) usually repeat many times (a) First data flows from the input device into the main memory Input device Central Processing Unit Main Memory Output Devices (c) Then CPU sends processed data back to main memory Input device Central Processing Unit Main Memory Output Devices (d)Finally the results go to the output device Input device Central Processing Unit Main Memory Output Devices (b) Next CPU brings the data into its registers for processing

CSC141 Introduction to Computer Programming Programming Language

Programming Language: A programming Language is a notational system intended primarily to facilitate human-machine interaction. The notational is understood both by human and machine. The programming language has Syntax, and language elements have Semantics. CSC141 Introduction to Computer Programming

What is a program? A program is something that is produced using a programming Language. A program is a structured entity with Semantics. CSC141 Introduction to Computer Programming

What is programming?

Programming is a Science: Because it implement the algorithms describe by mathematics and science. Programming is a Skill: Because it requires design efforts. Programming is an Engineering: Because it requires a tradeoffs between program size, speed, time (required for development and debugging) and maintainability among many solutions. Programming is an Art It requires creativity and employ imagination. CSC141 Introduction to Computer Programming

Types of programming Languages

Levels/Generations of Programming Languages 1 st Generation Programming language (1GL) Machine Language: 0s or 1s 2 nd Generation Programming language (2GL) Assembly Language : Mnemonics 3 rd Generation Programming language (3GL) High-Level Languages ; (procedure oriented or Object Oriented) 4 th Generation Programming language (4GL) Very-High-Level Languages 5 th Generation Programming Language Natural Languages CSC141 Introduction to Computer Programming

Machine language (1GL) The lowest level of language. The language used to program the first- generation computers. The instructions in 1GL are made of binary numbers, represented by 1s and 0s. 1s and 0s correspond to the on and off states of electrical switches. Suitable for the understanding of the machine but very much difficult to interpret and learn by the human programmer. CSC141 Introduction to Computer Programming

Assembly language (2GL) Low-level language that allows a programmer to use abbreviations or easily remembered words instead of numbers. These Observations are called Mnemonics. These Mnemonic are Opcode and Operands For Example: ADDAX, BX MOVCX, AX INCCX Op-code;ADD, MOV, INC OperandsAX, BX,CX CSC141 Introduction to Computer Programming

Assembly language (2GL) Programmer can write instructions faster but it is still not an easy language to learn. Drawback: The language is specific to a particular processor family and environment. (Machine Dependent Language) Assembler – A program that translates the assembly language program into machine language. CSC141 Introduction to Computer Programming

High Level languages (3GL) A High-Level Language is an English-like language. It is a refinement of a second-generation programming language. It allowed users to write in familiar notation, rather than numbers or abbreviations. Most High-level languages are not Machine Dependent. Translator for High-level languages is either a Compiler or an Interpreter. Examples of High-level languages: ― FORTRON ― COBOL ― BASIC ― C and C++ CSC141 Introduction to Computer Programming

Very-High-Level Languages (4GL) 4GLs are much more user-oriented and allow programmers to develop programs with fewer commands compared with 3GLs. Non-Procedural Language; Programmers don’t have to specify all the programming logic, only tell the computer what they want done. Saves a lot of time. 4GLs consist of report generators, query languages, application generators, and interactive database management system For example: RPG III (Report Generator) SQL (Structured Query Language) NOMAD and FOCUS (DBMS) CSC141 Introduction to Computer Programming

Natural Languages (5GL) Two types Ordinary Human Languages; like English. Programming language that use human language to give people a more natural connection with computers. 5GLs are designed to make the computer solve a given problem without the programmer. Natural languages are part of the field of study known as Artificial Intelligence. Develop machines to emulate human-like qualities such as learning, reasoning, communicating, seeing and hearing. CSC141 Introduction to Computer Programming

Evolution of Programming

Programming Paradigms A number of programming paradigms are: Procedural/Imperative Programming Functional Programming Declarative Programming Object Oriented Programming Event driven Programming Parallel Programming CSC141 Introduction to Computer Programming

Procedural or Imperative: Imperative programs emphasize “tell what to do” When we say “ Do this, then do this, then do this, and if xx, do this, otherwise do this” This is imperative programming: They focus on evaluating expressions and storing results in a variable. The most common imperative language consists of statements such as: a = 10; b = 5; c = a + b; CSC141 Introduction to Computer Programming

Procedural or Imperative: … Contd Example of imperative languages are: Assembly language COBOL Pascal C and C++ CSC141 Introduction to Computer Programming

Is there any Best Programming Language? Programming Language is probably used most efficient if it is well suited For a specific task. For example Business applications are often written in COBOL. Beginners to programming use BASIC. Scientific programming is often undertaken with either FORTON, PASCAL or C. CSC141 Introduction to Computer Programming

Language Evaluation Criteria Readability: measure programmer ease in reading source code Orthogonality: include context sensitive restrictions. Applicability: this is best suited as “use the right tool for the job” Writ ability: includes simplicity and orthogonality and support for the abstraction Reliability: include type checking and inspection handling Cost: includes learning and writing cost, productivity, compilation cost, execution cost, debugging cost etc. Other: flexibility of control statements and availability of data structures CSC141 Introduction to Computer Programming

History of C Language A general-purpose computer programming language. Developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the UNIX operating system. Descendant of Ken Thompson’s language “B” The first C programming language standard was published in 1978 as “The C Programming Language” by Kernighan and Ritchie (K&R). "ANSI C" was the second C programming language standard published in ISO approved “ANSI C” in The latest stable release is C11. CSC141 Introduction to Computer Programming