Laboratorio di Calcolo I Docente: prof. Berardi (Dip. Informatica) Lezione introduttiva su Computing ed esercitazioni di Unix/Linux tenute da Fabrizio.

Slides:



Advertisements
Similar presentations
Computer Memory and Data Transfer
Advertisements

Laboratorio di Calcolo II Obbiettivo: insegnarvi a scrivere programmi in c++ 2 ore/settimana di lezione in aula 4 ore/settimana di esercitazioni personali.
Lecture 1: Overview of Computers & Programming
The Central Processing Unit: What Goes on Inside the Computer.
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Computer Programming Belaid Moa Phone: Office : ECS 115 Spring 2008.
Introduction to Computer Systems
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Introduction to Computers
1 Introduction to Computers Prof. Sokol Computer and Information Science Brooklyn College.
Chapter 4  Converts data into information  Control center  Set of electronic circuitry that executes stored program instructions  Two parts ◦ Control.
Introduction to Computers and Python. What is a Computer? Computer- a device capable of performing computations and making logical decisions at speeds.
1 Chapter-01 Introduction to Computers and C++ Programming.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
BLOCK DIAGRAM OF COMPUTER
Course Introduction C++ An Introduction to Computing.
Computer Organization Hardware and Software. Computing Systems Computers have two kinds of components: Hardware, consisting of its physical devices (CPU,
Learning Targets Identify the external parts of the computer Identify examples of input devices Identify examples of output devices Define basic computer.
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions.
Introduction CS 104: Applied C++ What is Programming? For some given problem: __________ a solution for it -- identify, organize & store the problem's.
Hardware & Software The CPU & Memory.
Introduction to Computers
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Introduction to Computers
1 Introduction to Computers Prof. Sokol Computer and Information Science Brooklyn College.
1 Introduction to Computers Lect 1 Won’t tell you much you don’t know. (Misleading– the course gets more conceptual as we create webpages.) Will go into.
Computer Parts. Two Basic Parts Hardware & Software.
Computer Basics 2.
Chapter 1 Intro to Computer Department of Computer Engineering Khon Kaen University.
1 CPSC 185 Introduction to Computing The course home page
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
1Copyright © Prentice Hall 2000 The Central Processing Unit Chapter 3 What Goes on Inside the Computer.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
What is computer hardware? Computer hardware are the physical components of the computer.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Computer Basics Terminology - Take Notes. What is a computer? well, what is the technical definition A computer is a machine that changes information.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
Computer Architecture
Computer Component. A computer is a machine that is used to store and process data electronically Computer Definition.
CSCI-100 Introduction to Computing Hardware Part I.
Computer Organization. The digital computer is a digital system that performs various computational tasks Digital computer use binary number system which.
Introduction 1 (Read Chap. 1) What is Programming? For some given problem: design a solution for it -- identify, organize & store the problem's data --
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
The Computer System CS 103: Computers and Application Software.
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,
1 Introduction to Computers Prof. Sokol Computer and Information Science Brooklyn College.
Memory The term memory is referred to computer’s main memory, or RAM (Random Access Memory). RAM is the location where data and programs are stored (temporarily),
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
 A computer is an electronic device that receives data (input), processes data, stores data, and produces a result (output).  It performs only three.
Chapter 1 An Overview of Computers and Programming Languages.
Information Technology (IT). Information Technology – technology used to create, store, exchange, and use information in its various forms (business data,
An Overview of the Computer System
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
An Introduction to The computer.
Computer Organization
The Central Processing Unit
Introduction to Computer Architecture
Introduction to Computers
An Introduction to The computer.
An Overview of the Computer System
Introduction to Computers
Topics Introduction Hardware and Software How Computers Store Data
Chapter 3 Hardware and software 1.
Chapter 3 Hardware and software 1.
Presentation transcript:

Laboratorio di Calcolo I Docente: prof. Berardi (Dip. Informatica) Lezione introduttiva su Computing ed esercitazioni di Unix/Linux tenute da Fabrizio Bianchi (saro’ il vostro docente di Laboratorio di Calcolo II) Lezioni “teoriche” tutti insieme Esercitazioni individuali al computer

Textbook & Slides Trasparenze in: *.ppt versione power point *.pdf versione Acrobate Reader Per la stampa usare la versione pdf

What is Programming? A sequence of statements that instruct a computer in how to solve a problem is called a program. The act of designing, writing and maintaining a program is called programming. People who write programs are called programmers.

What kinds of statements do computers understand? A computer only understands machine language statements. A machine language statement is a sequence of ones and zeros that cause the computer to perform a particular action, such as add, subtract, multiply,...

Machine Language (ML) ML statements are stored in a computer’s memory, which is a sequence of switches. For convenience of representation, an “on” switch is represented by 1, and an “off” switch is represented by 0. ML thus appears to be binary (base-2):

Early Computers... required a programmer to write in ML... –Easy to make mistakes! –Such mistakes are hard to find! –Not portable -- only runs on one kind of machine! Programming was very difficult!

A Bright Idea Devise a set of abbreviations (mnemonics) corresponding to the ML statements, plus a program to translate them into ML. The abbreviations are an assembly language, and the program is called an assembler. Assembler ADD

Assembly Languages Allowed a programmer to use mnemonics, which were more natural than binary. +Much easier to read programs +Much easier to find and fix mistakes –Still not portable to different machines

High Level Languages Devise a set of statements that are close to human language (if, while, do,...), plus a program to translate them into ML. The set of statements is called a high level language (HLL) and the program is called a compiler.

HLL Compilers Where an assembler translates one mnemonic into one ML statement, a HLL compiler translates one HLL statement into multiple ML statements. Compiler z = x + y;

HLLs High level languages (like C++) are +Much easier to read programs +Much easier to find and fix mistakes +Portable from one machine to another (so long as they keep to the language standard).

Objectives in Programming A program should solve a problem: +correctly (it actually solves the problem) +efficiently (without wasting time or space) +readably (understandable by another person) +in a user-friendly fashion (in a way that is easy for its user to use).

Summary There are “levels” to computer languages: –ML consists of “low” level binary statements, that is hard to read, write, and not portable. –Assembly uses “medium” level mnemonics: easier to read/write, but not portable. –C++ is a “high” level language that is even easier to read/write, and portable.

Computer Organization Hardware and Software

Computing Systems Computers have two kinds of components: Hardware, consisting of its physical devices (CPU, memory, bus, storage devices,...)Hardware, consisting of its physical devices (CPU, memory, bus, storage devices,...) Software, consisting of the programs it has (Operating system, applications, utilities,...)Software, consisting of the programs it has (Operating system, applications, utilities,...)

Hardware: CPU Central Processing Unit (CPU): –the “brain” of the machine –location of circuitry that performs arithmetic and logical ML statements –measurement: speed (roughly) in megahertz (millions of clock-ticks per second) –examples: Intel Pentium, AMD K6, Motorola PowerPC, Sun SPARC,

Hardware: RAM Random Access Memory (RAM) –“main” memory, which is fast, but volatile... –analogous to a person’s short-term memory. –many tiny “on-off” switches: for convenience “on” is represented by 1, “off” by 0.“on” is represented by 1, “off” by 0. –each switch is called a binary digit, or bit. 8 bits is called a byte.8 bits is called a byte bytes =1024 bytes is called a kilobyte (1K)2 10 bytes =1024 bytes is called a kilobyte (1K) 2 20 bytes is called a megabyte (1M).2 20 bytes is called a megabyte (1M).

Hardware (Disk) Secondary Memory (Disk): –Stable storage using magnetic or optical media. –Analogous to a person’s long-term memory. –Slower to access than RAM. –Examples: floppy disk (measured in kilobytes)floppy disk (measured in kilobytes) hard disk (measured in gigabytes (2 30 bytes))hard disk (measured in gigabytes (2 30 bytes)) CD-ROM (measured in megabytes),...CD-ROM (measured in megabytes),...

Hardware: the Bus The Bus: –Connects CPU to other hardware devices. –Analogous to a person’s spinal cord. –Speed measured in megahertz (like the CPU), but typically much slower than the CPU... –The bottleneck in most of today’s PCs.

Hardware: Cache While accessing RAM is faster than accessing secondary memory, it is still quite slow, relative to the rate at which the CPU runs. To circumvent this problem, most systems add a fast cache memory to the CPU, to store recently used instructions and data. (Assumption: Since such instructions/data were needed recently, they will be needed again in the near future.)

Hardware: Summary Putting the pieces together: CPU Bus Main Memory Secondary Memory cache Programs are stored (long-term) in secondary memory, and loaded into main memory to run, from which the CPU retrieves and executes their statements.

Software: OS The operating system (OS) is loaded from secondary memory into main memory when the computer is turned on, and remains in memory until the computer is turned off. RAM Disk CPU Cache Bus OS

Software: OS The OS acts as the “manager” of the system, making sure that each hardware device interacts smoothly with the others. It also provides the interface by which the user interacts with the computer, and awaits user input if no application is running. Examples: MacOS, Windows-98, Windows-NT, UNIX, Linux, Solaris,...

Software: Applications Applications are non-OS programs that perform some useful task, including word processors, spreadsheets, databases, web browsers, C++ compilers,... Example C++ compilers/environments: –CodeWarrior (MacOS, Win95, WinNT, Solaris) –GNU C++ (UNIX, Linux) –Turbo/Borland C++ (Win95, WinNT) –Visual C++ (Win95, WinNT)

Software: User Programs Programs that are neither OS programs nor applications are called user programs. User programs are what you’ll be writing in this course.

Putting it all together Programs and applications that are not running are stored on disk. RAM Disk CPU Cache Bus OS App

Putting it all together When you launch a program, the OS controls the CPU and loads the program from disk to RAM. RAM Disk CPU Cache Bus OS App OS

Putting it all together The OS then relinquishes the CPU to the program, which begins to run. RAM Disk CPU Cache Bus OS App

The Fetch-Execute Cycle As the program runs, it repeatedly fetches the next instruction (from memory/cache), executes it, and stores any results back to memory. RAM Disk CPU Cache Bus OS App That’s all a computer does: fetch-execute-store, millions of times each second!

Summary A computer has two kinds of components: –Hardware: its CPU, RAM, Disk(s),... –Software, its OS, Applications, and User Programs.