Fundamentals of Computer Programming

Slides:



Advertisements
Similar presentations
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
Advertisements

Lecture 1: Overview of Computers & Programming
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Introduction to Computer Systems
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
1 Introduction to computers Overview l · Grading Policy »Cheating Rules (serious concern) »Examinations and Fixation of Timings »Quizzes »Homework Assignments.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
Systems Software Operating Systems.
WHAT IS A COMPUTER??? An electronic device that accepts: n Input n Processes the input n Stores the results of the processing n provides Output Computers.
CS 161 INTRO TO PROGRAMMING I Dr. Blaise W. Liffick Fall
INTRODUCTION TO COMPUTER PROGRAMMING itc-314 LECTURE 01.
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1 1.  The computer system consists of: 1. Hardware: Physical Components, like the system unit,monitor,keyboard, mouse, camera, printer … etc.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Introduction to Programming Using C Introduction to Computer Programming.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Introduction Lecture 01.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
COMPUTER PROGRAMMING. Computer programming the objective of the module to gain the necessary skills to develop a computer program using one of the high.
Computer Basics. Samples of Operating Systems IBSYS (IBM 7090) OS/360 (IBM 360) TSS/360 (360 mod 67) Michigan Terminal System CP/CMS & VM 370 MULTICS.
The Computer System CS 103: Computers and Application Software.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Chapter 1 An Overview of Computers and Programming Languages.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Chapter 3 Getting Started. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To give an overview of the structure of a contemporary.
Computer Graphics HARDWARE. Computers  Computers are automatic, electronic machines that –accept data & instructions from a user (INPUT) –store the data.
Chapter 1: Introduction to Computers and Programming
Software Development Environment
Java Programming: From the Ground Up
BASIC PROGRAMMING C SCP1103 (02)
King Saud University- College OF Applied Studies
King Saud University- College OF Applied Studies
An Overview of the Computer System
Chapter 1: An Overview of Computers and Programming Languages
Engineering Problem Solving With C An Object Based Approach
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1: An Overview of Computers and Programming Languages
BASIC PROGRAMMING C SCP1103 (02)
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Computer System and Programming
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Programming COMP104: Fundamentals and Methodology Introduction.
Looking Inside the machine (Types of hardware, CPU, Memory)
Chapter 1: Introduction to Computers and Programming
An Overview of the Computer System
Computer Science I CSC 135.
Computer Electronic device Accepts data - input
Computer Electronic device Accepts data - input
Topics Introduction Hardware and Software How Computers Store Data
Chapter 2: Computer Hardware
National Diploma in Computer Studies
Computer components.
Computer Electronic device Accepts data - input
Introduction to Computer Systems
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
ICS103 Programming in C 1: Overview of Computers And Programming
Chapter 1: Introduction to Computers and Programming
Computer components.
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Fundamentals of Computer Programming IN HIS NAME Fundamentals of Computer Programming

Course description Instructor: Mohammad amin mehralian Contact: mehralian@comp.iust.ac.ir Put CP before the subject: ex: CP اعتراض به نمره Time: Sat. & Mon., [15:30] -> [17] Textbooks: Your own choice! Grading Policy: 0-3 Midterms: Final Exam: Programming Assignments Quizzes

A Computer System (Contd.) In general, a computer is a machine which accepts data, processes it and returns new information as output. Processing Data Information 12/3/2018 Introduction to Computers

Introduction to Computers Language of Computers Computers only understand the electronic signals. Either Current is flowing or not. Current Flowing : ON Current Not Flowing : OFF Binary Language ON : 1 OFF : 0 Bit, Byte, KB, MB, GB 12/3/2018 Introduction to Computers

Introduction to Computers Metric units 12/3/2018 Introduction to Computers

Components of a simple personal computer Outside world Video controller Hard drive controller USB controller Network controller CPU Computer internals (inside the “box”) Memory 12/3/2018 Introduction to Computers

A Look Inside…. Computer internals (inside the “box”) Video controller Outside world Video controller Hard drive controller USB controller Network controller CPU Computer internals (inside the “box”) Memory 12/3/2018 Introduction to Computers

Von Neumann architecture 12/3/2018 Introduction to Computers

Introduction to Computers CPU The central processing unit or (CPU) is the "brain" of your computer. It contains the electronic circuits that cause the computer to follow instructions from memory. The CPU contains three main parts, all housed in a single package (Chip): Control Unit (CU) Arithmetic Logic Unit (ALU) Memory CU ALU Memory Registers 12/3/2018 Introduction to Computers

Memory Computer Input Unit CPU Output Unit Control Unit ALU Keyboard Mouse Scanner Modem Input Unit CPU Monitor Printer Modem Output Unit Control Unit ALU Registers Bank Cache Memory Memory Main Memory RAM ROM Secondary Memory HD FD CD Flash Tertiary Memory Tape

Storage pyramid Goal: really large memory with very low latency Capacity Access latency < 1 KB Registers Cache (SRAM) Main memory (DRAM) Magnetic disk Magnetic tape 1 ns Better 1 MB 2–5 ns 1 GB 50 ns 200 GB 5 ms > 1 TB Better 50 sec Goal: really large memory with very low latency Latencies are smaller at the top of the hierarchy Capacities are larger at the bottom of the hierarchy Solution: move data between levels to create illusion of large memory with low latency

Introduction to Computers Software Software is set of programs (which are step by step instructions) telling the computer how to process data. Software needs to be installed on a computer, usually from a CD. Softwares can be divided into two groups: - System SW - Application SW 12/3/2018 Introduction to Computers

Introduction to Computers System Software System Software It controls the overall operation of the system. It is stored in the computer's memory and instructs the computer to load, store, and execute an application. Examples: Operating System (OS):DOS, Windows, Unix, Linux, Mac, Solaris, etc. Drivers, Disk Managers, … 12/3/2018 Introduction to Computers

Computer Machine (Hardware) User / Programmer Operating System Human Understandable Language (High Level Language) Machine Language (Low Level Language) Computer Machine (Hardware)

Samples of Operating Systems (continue…)

Introduction to Computers Application Software Application Software They are Softwares written to perform specific tasks. The basic types of application software are: word processing, database, spreadsheet, desktop publishing, and communication. Examples: Notepad!, MS Office, Skype, Firefox 12/3/2018 Introduction to Computers

Machine Languages System of instructions and data directly understandable by a computer's central processing unit. Example: 100011 00011 01000 00000 00001 000100 000010 00000 00000 00000 10000 000001 000000 00001 00010 00110 00000 100000 Every CPU model has its own machine code, or instruction set, although there is considerable overlap between some

Assembly Languages Human-readable notation for the machine language that a specific computer architecture uses representing elementary computer operations (translated via assemblers) Example: load hourlyRate mul workHours store salary Even into the 1990s, the majority of console video games were written in assembly language.

Available Programming Languages Machine Languages Assembly Languages High-level Languages Pascal, BASIC (Educational) C/C++ MATLAB, J, Fortran, R (Array processing, Mathematics) JAVA, C#, VB.NET Python Scala, Haskell (Functional) Prolog (Logic-based programming) Special Purpose: GAMS, SQL Hardware description Languages: (VHDL, Verilog) Etc.

High-level Languages Higher level of abstraction from machine language Codes similar to everyday English Use mathematical notations (translated via compilers) Example: salary = hourlyRate * workHours Make complex programming simpler

Interpreters and Compilers Computers cannot understand human-language. They understand machine-language. Machine-language is all ones and zeros. To get a computer to understand a high-level language like Python, we have to translate.

Interpreters The first type of translator is an interpreter. Interpreters read the source-code a programmer writes, parses the code, and interprets it on-the-fly. Interpreters can be interactive. Python is an interpreter.

Interpreters: Example >>> x = 6 >>> print x >>> y = x * 7 >>> print y

Compilers Compilers need to have the entire program written into a file. It runs a process to convert the program to machine-language, and saves this for later use. File extensions such as “.exe” (executable) and “.dll” (dynamically loadable library) are examples. C is a compiled language.

Software Development Cycle Library Editor Compiler Linker XXX.c Source Program XXX.obj Object Program XXX.exe Executable C:\XXX↓ Debugger

Why Programming using C General-purpose computer programming language high-level assembly Simplicity and efficiency of the code The most widely used programming languages Both in academia and industry Commonly used for writing system software Widely used for writing applications Hardware independent (portable) Great influence on many other popular languages Ease of switching to other languages

?