COMP1070/2002/lec1/H.Melikian COMP1070 Lecture #2 Computers and Computer Languages Some terminology What is Software? Operating Systems.

Slides:



Advertisements
Similar presentations
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Advertisements

COMP 2003: Assembly Language and Digital Logic
Overview of Programming and Problem Solving ROBERT REAVES.
ENGR2216 FORTRAN PROGRAMMING FOR ENGINEERS. Chapter 1 The computer CPU MEMORY INPUT/OUTPUT DEVICES DATA REPRESENTATION BINARY SYSTEM OCTAL & HEXADECIMAL.
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
COMP3221 lec05-numbers-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 5: Number Systems – I
Programming The Development Environment and Your First C Program.
Main Memory Lecture 2 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
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.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Ceng 230 Programming with C
Topic 1: Introduction to Computers and Programming
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#1) By Dr. Syed Noman.
CEG 320/520: Computer Organization and Assembly Language Programming1 CEG 320/520 Computer Organization and Assembly Language Programming.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Real Numbers and the Decimal Number System
BLOCK DIAGRAM OF COMPUTER
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 18: 0xCAFEBABE (Java Byte Codes)
CSC 101 Introduction to Computing Lecture 9 Dr. Iftikhar Azim Niaz 1.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
Introduction CS 104: Applied C++ What is Programming? For some given problem: __________ a solution for it -- identify, organize & store the problem's.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Introduction to Programming Using C Introduction to Computer Programming.
Introduction to Computer Systems and the Java Programming Language.
CPU Internal memory I/O interface circuit System bus
CS161 Computer Programming Instructor: Maria Sabir Fall 2009 Lecture #1.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Introduction to Programming Instructor: Yong Tang Brookhaven National Laboratory Working on accelerator control (BNL Phone #)
Computer Science Theory & Introduction Week 1 Lecture Material – F'13 Revision Doug Hogan Penn State University CMPSC 201 – C++ Programming for Engineers.
1 ICS 51 Introductory Computer Organization Fall 2009.
Data Representation Bits, Bytes, Binary, Hexadecimal.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
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 --
1 CS1430: Programming in C++ Section 2 Instructor: Qi Yang 213 Ullrich
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
Computer Organization and Assembly Languages 2007/11/10
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,
Basic Computer Organization Rashedul Hasan.. Five basic operation No matter what shape, size, cost and speed of computer we are talking about, all computer.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
CS 125 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk drive Software.
Hardware Information Created by Nasih 1. Hardware  The physical components of a computer system, including any peripheral equipment such as printers,
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
 Human language : commonly used to express feeling and understand what other people expression.  Computer language : are a languages by which a user.
Programmable Logic Controller
Computer basics.
Assembly language.
Assembly Language (CSW 353)
EPSII 59:006 Spring 2004.
Introduction to Compilers Tim Teitelbaum
March 2006 Saeid Nooshabadi
Introduction to Computer Programming
Chapter One: Introduction
Fundamentals of Computer Organisation & Architecture
Machine-Level Programming: Introduction
Information Technology Department
Computer Programming (CS101) Lecture-02
Computer Architecture and System Programming Laboratory
Dr. Clincy Professor of CS
Presentation transcript:

COMP1070/2002/lec1/H.Melikian COMP1070 Lecture #2 Computers and Computer Languages Some terminology What is Software? Operating Systems

COMP1070/2002/lec1/H.Melikian Administrivia Class web page not much there yet, but keep your eyes on it. Almost everything from the Blackboard will be here except your grades, online staff ( exams, quizzes) and solutions

COMP1070/2002/lec1/H.Melikian Understanding computers How does a computer work? – Idiot savant – Very good with a small number of tasks – Completely clueless otherwise What can computers do well? – store and retrieve numbers – very quickly – very accurately – add, subtract, multiply, and divide – also fast and accurate – compare numbers (with 0) – follow a list of instructions and jump around in the list

COMP1070/2002/lec1/H.Melikian What about everything else? – more complex math combination of atomic operations – interaction with peripheral devices output: graphics cards and printers input: keyboards, mice, joysticks all sorts of specialized devices – everything done using numbers

COMP1070/2002/lec1/H.Melikian Computer numbers To the computer, everything is numbers. Computers use binary (base 2) – each digit is 0 or 1 – represents a power of 2 human numbers : You are familiar with decimal d n d n-1 d n-2... d 2 d 1 d 0 d n 10 n + d n-1 10 n-1 + d n-2 10 n-2... d d d      10 0

COMP1070/2002/lec1/H.Melikian binary b n b n-1 b n-2 … b 2 b 1 b 0 b n  2 n + b n-1  2 n-1 + b n-2  2 n-2 … b 2  b 1  b 0  2 0 Example:                 = 182

COMP1070/2002/lec1/H.Melikian More teminology bit: binary digit byte: a group of 8 bits word: a group of bytes that a specific computer is optimized for working with (usually 4 or 8) kilobyte (K or KB): 1,000 bytes, or sometimes 1,024 bytes (2 10 ) megabyte (M or MB): 1,000,000 bytes, or sometimes 1,028,576 bytes (2 20 )

COMP1070/2002/lec1/H.Melikian why all these powers of 2? Everything is little electronic switches – off or on, true or false, 0 or 1 Decimal is foreign to the computer – it can convert a number to decimal, but that’s really only for human convenience other numbering systems octal – base 8 – used rarely, but you should at least recognize it – digits are 0 through = 3     8 0 = 3    = = 1716

COMP1070/2002/lec1/H.Melikian hexadecimal ( base 16) – used occasionally – you can’t really avoid it – digits are 0-9, a-f 8b7e = 8     16 0 = 8    = = other numbering systems v You do not have to be fluent in either of these (octal or hex) for this class recognize them, don’t be scared of them v know how to convert if you need to but you will rarely need to

COMP1070/2002/lec1/H.Melikian inside the computer… Everything is bits Bits are always grouped – into bytes – into words Every byte is numbered – sequential – called an address – addresses are, of course, numbers themselves Computers execute computer instructions Instructions are numbers – memory access (get/put) – arithmetic (add, subtract, multiply, divide) – compare values (equal, greater than, less than) – change the order instructions are executed in often based on the result of a comparison

COMP1070/2002/lec1/H.Melikian The machine cycle

COMP1070/2002/lec1/H.Melikian what kinds of numbers do computers work with? Instructions, Addresses, Data– integers, real numbers – text – all sorts of other things What is a computer program? - A sequence of processor instructions designed to achieve a specific purpose Computers execute programs sequentially like driving directions – each instruction depends on the last one being completed

COMP1070/2002/lec1/H.Melikian What is a computer program? Each instruction has a numerical code Examples: – Get some data from memory – Add two numbers – If two numbers are equal, jump to a different part of the program Instructions are numbers This is important!

COMP1070/2002/lec1/H.Melikian Only numbers! B EC 83 EC 5C A 00 FF 15 B8 C FC 83 7D FC 00 7D 1B 68 0F B9 E E B C E8 90 FF FF FF 8D 45 EC 50 8B 0D 50 8D FF 15 C0 C FC 83 7D FC 00 7D F F B9 E E8 FD A B C8 E8 5B FF FF FF E9 9C B0 0F D B9 E E8 DD C B C8 E8 3B FF FF FF 8D 55 E D A 01 6A FF 15 C4 C E FC 83 7D FC 00 7C 1D 68 0F F0 68 B B9 E E8 A B C8 E8 FF FE FF FF EB 43 8B 45 FC E8 6A C F B 4D FC B9 E E8 6A B C8 E B C8 E C B C8 E8 BA FE FF FF FF 15 BC C2 42

COMP1070/2002/lec1/H.Melikian push ebp  mov ebp,esp  sub esp,5Ch  push ebx  push esi  push edi  push 0  B call dword ptr (0042c2b8)]  mov dword ptr [ebp-4],eax  cmp dword ptr [ebp-4],0  jge main+35h ( )  A push ( f)  F push offset string "CoInitialize failed." ( )  mov ecx,offset cout (004299e8)  call ostream::operator<< (004015a0)  E mov ecx,eax v ( ) Part 1

COMP1070/2002/lec1/H.Melikian Part 2  lea eax,[ebp-14h]  push eax  mov ecx,dword ptr [pid (00428d50)]  F push ecx  call dword ptr (0042c2c0)]  mov dword ptr [ebp-4],eax  cmp dword ptr [ebp-4],0  D jge main+6Fh (004010af)  F push ( f)  push offset string "CLSIDFromProgID failed." (004260f8)  mov ecx,offset cout (004299e8)  E call ostream::operator<< (004015a0)  A3 mov ecx,eax  A5 ( )  AA jmp main+10Bh ( b)  AF push ( f)  B4 push offset string "CLSIDFromProgID succeeded." (004260d8)

COMP1070/2002/lec1/H.Melikian machine language The one “true” computer language – …except there isn’t just one Every computer has its own machine language All other computer languages created for human convenience The computer doesn’t understand C Must be converted into machine language computer languages Assembler ;essentially just machine language with some text codes Compiled languages ;converted into machine language before use – examples: C, Pascal, Fortran Interpreted languages; converted into machine language during use – examples: Basic, Java

COMP1070/2002/lec1/H.Melikian Why more than one? Meet different needs, Tradeoffs, Different approaches Special features Application domain – programmer prefers to think about the application Computer domain – programmer is willing to think about the computer Tradeoffs Control, Ease-of-programming, Performance flexibility different approaches Procedural Object-oriented Special features There are lots of special-purpose languages

COMP1070/2002/lec1/H.Melikian HW #2 Please send the solutions via to and hand in hard copy by the beginning of the class