Intro to CS – Honors I Introduction GEORGIOS PORTOKALIDIS

Slides:



Advertisements
Similar presentations
RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address
Advertisements

Syllabus Instructor: Dr. Wesam Ashour
EEE226 MICROPROCESSORBY DR. ZAINI ABDUL HALIM School of Electrical & Electronic Engineering USM.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
COSC 120 Computer Programming
General information Course web page: html Office hours:- Prof. Eyal.
CS150 Introduction to Computer Science 1 Professor: Chadd Williams.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Computer Organization and Assembly language
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2.
Chapter Introduction to Computers and Programming 1.
Computer Architecture Lecture 01 Fasih ur Rehman.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
CMPT 300: Operating Systems
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
CS 1 •This is Computer Science 1. •Who is Professor Adams?
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510.
Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Microcode Source: Digital Computer Electronics (Malvino and Brown)
Introduction to Computer Systems and the Java Programming Language.
1 8/29/05CS150 Introduction to Computer Science 1 Professor: Shereen Khoja
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Part 1.  Intel x86/Pentium family  32-bit CISC processor  SUN SPARC and UltraSPARC  32- and 64-bit RISC processors  Java  C  C++  Java  Why Java?
Computer Engineering Rabie A. Ramadan Lecture 1. 2 Welcome Back.
Computer Organization & Assembly Language © by DR. M. Amer.
PHY 201 (Blum)1 Microcode Source: Digital Computer Electronics (Malvino and Brown)
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Introduction to Microprocessors
Computer organization Practical 1. Administrative Issues The course requirements are: –To be nice and open minded –To pass the exam (there is a boolean.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Stored Programs In today’s lesson, we will look at: what we mean by a stored program computer how computers store and run programs what we mean by the.
12/13/ _01 1 Computer Organization EEC-213 Computer Organization Electrical and Computer Engineering.
Computer Organization Instructors Course By: Lecturer: Shimaa Ibrahim Hassan TA: Eng: Moufeda Hussien Lecture: 9:45 Address:
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Page 1 Computer Architecture and Organization 55:035 Midterm Exam Review Spring 2011.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Operating Systems A Biswas, Dept. of Information Technology.
Computer Organization and Architecture Lecture 1 : Introduction
GC101 Introduction to computers and programs
CS190/295 Programming in Python for Life Sciences: Lecture 1
Mobile Development Workshop
T Computer Architecture, Autumn 2005
Introduction to Microprocessor Programming
Professor: Shereen Khoja
Presentation transcript:

Intro to CS – Honors I Introduction GEORGIOS PORTOKALIDIS

Today’s Lecture Logistics ◦Course information ◦Grading Introduction to computer architecture ◦Software and hardware ◦How do programs run Programming languages ◦From high-level languages to programs machines understand ◦Java programs 8/26/2013CS181 - INTRO TO CS - HONORS I 2

Logistics Information about the course can be found in: ◦The website ◦Moodle Schedule ◦Lectures are on Monday and Wednesday 12:00-12:50pm (E229) ◦Lab is on Thursday 12:00-1:40pm (B430) ◦Teaching assistant Sadia Akhter ◦Office hours are on Monday 1:00-2:00pm (L213) Books ◦Java: An Introduction to Problem Solving and Programming, 6/E W.Savitch Addison-Wesley, 2012 ISBN (ISBN-13: )Java: An Introduction to Problem Solving and Programming, 6/E ◦More in the course’s website 8/26/2013CS181 - INTRO TO CS - HONORS I 3

Grading Your grade will be determined by: ◦2 midterm exams (15% each) ◦The final exam (30%) ◦Assignments given approximately biweekly (40%) ◦Solutions to the assignments will be discussed in the lab ◦No late submissions No cheating ◦Stevens honor system "The Honor System at Stevens [..] insures that work submitted by students can be trusted as their own and was performed in an atmosphere of honesty and fair play." 8/26/2013CS181 - INTRO TO CS - HONORS I 4

Questions Before ing anyone search online Use the mailing list: Then ask the teaching assistant or the instructor 8/26/2013CS181 - INTRO TO CS - HONORS I 5

A Short Survey How many of you have done any programming in any language? How many of you have programmed in Java? 8/26/2013CS181 - INTRO TO CS - HONORS I 6

Picking the Right Course CS 105 ◦If you were never exposed to programming ◦Basic programming and problem solving concepts ◦Very little coding CS 115 ◦You have a bit of experience ◦Learn the basic of programming using Python CS 181 ◦You have done a little programming ◦Learn the fundamentals using Java ◦Learn object-oriented programming ◦Learn data structures and simple algorithms 8/26/2013CS181 - INTRO TO CS - HONORS I 7

Do you Like Hacking Learn how things work Break and fix software and hardware Participate in capture the flag competitions Join the hacking club next semester ◦You can also get course credit for your trouble ◦Take the CS 397 ◦Equal to one course if taken for 3 semesters ◦Informal meeting focusing on solving hacking challenges 8/26/2013CS181 - INTRO TO CS - HONORS I 8

Intro to Computer Architecture SoftwareHardware Computer Systems Physical Programs 8/26/2013CS181 - INTRO TO CS - HONORS I 9

Hardware CPU Memory Peripherals I/O Bus Executes simple instructions Stores data and instructions Input and output devices 8/26/2013CS181 - INTRO TO CS - HONORS I 10

Software Software consists of instructions and data Instructions define how a program operates ◦Example: the mathematical operations that need to be performed to calculate the circumference of a circle Data can be… ◦your documents, pictures, videos, etc. ◦but also intrinsic to the program, e.g., the pi (π) constant 8/26/2013CS181 - INTRO TO CS - HONORS I 11

Computer Representation of Data The smallest piece of information a computer can store and understand a bit ◦A bit has only two states: 0 or 1 ◦Why only two states? Bits are grouped into bytes ◦1 byte = 8 bits Bytes can also be grouped ◦word = 2 bytes ◦double word = 4 bytes ◦quad word = 8 bytes 8/26/2013CS181 - INTRO TO CS - HONORS I 12 double word (or 32-bit word) word (or 16-bit word)

Memory Almost all modern computers follow the Von Neumann architecture ◦Data and instructions share the same memory ◦Memory is RAM (Random Access Memory) Target data RAM Memory access instruction Target data Sequential Access Memory Memory access instruction RAM is also volatile, unlike ROM that is read only! 8/26/2013CS181 - INTRO TO CS - HONORS I 13

Memory Addressing Memory is split into “slots” ◦How big is each slot? ◦Typical sizes are 1, 2, 4, and 8 bytes ◦The smallest slot that can be accessed is 1 byte Each slot has its own numeric address ◦How big can the address space be? ◦Most systems can currently address up to 2 64 different memory locations Aligned memory access ◦When reading 2, 4, or 8 bytes some architectures require that the address is aligned ◦An access is aligned if the address is exactly divisible by the size of the access RAM Instructions Data Instructions Data 8/26/2013CS181 - INTRO TO CS - HONORS I 14

How Do Programs Run? Instruction 1 Instruction 2 Instruction 3 … Instruction N Data CPU RAM Our program Registers ALU FPU Arithmetic Logic Unit The brain! The CPU’s own very fast memory Floating Point Unit Other extensions PC Program Counter 8/26/2013CS181 - INTRO TO CS - HONORS I 15

How Do Programs Run? Instruction 1 Instruction 2 Instruction 3 … Instruction N Data CPU RAM Our program Registers ALU FPU PC The CPU is continuously performing (looping) the following steps: 1. Fetch instruction pointed to by PC 2. Execute the instruction 3. Increment PC 4. Go back to 1 In a sense, the CPU includes its own program! 8/26/2013CS181 - INTRO TO CS - HONORS I 16

Program Instructions What kind of instructions do you think the CPU executes? What type of instructions are required for a computer to be useful? Instructions are very simple Alan Turing showed that all calculations require only a few instructions Examples: ◦Load/store data from/to memory to/from registers ◦Perform an arithmetic or logical operation between registers Simple instructions can be made to execute really fast ◦RISC - Reduced Instruction Set Computer (ARM, SPARC) ◦Operations can only be performed with data in registers 8/26/2013CS181 - INTRO TO CS - HONORS I 17

Other Instruction Sets CISC – Complex Instruction Set Computer Do you know any models using this architecture? Intel CPUs are CISC ◦These days they are built as RISC, supporting CISC instruction sets ◦Operations using data in memory are also supported 8/26/2013CS181 - INTRO TO CS - HONORS I 18

Memory Hierarchies CPU RAM Registers ALU FPU PC Cache Cache enables fast access of frequently accessed RAM 8/26/2013CS181 - INTRO TO CS - HONORS I 19

Multi-level Caches CPU RAM Registers ALU FPU PC Cache 8/26/2013CS181 - INTRO TO CS - HONORS I 20 Level 2 Cache Can be placed in various ways

From Languages to Instructions Machine Language Basically structured numbers High-level languages Easily understandable by humans. Java, C, C++, Python, Ruby, etc. Assembly Language Symbolic form of machine language. Low-level programming language What the hardware understands What we want to use How do we make the transition? Source codeBinary code 8/26/2013CS181 - INTRO TO CS - HONORS I 21

Compilers and Interpreters Compilers “A compiler is a program that translates a program written in a high-level language, such as Java, into a program in a simpler language that the computer can more or less directly understand.” ◦Compile once, execute often ◦Program only runs on the particular architecture it was compiled for Interpreter “An interpreter is a program that alternates the translation and execution of statements in a program written in a high-level language.” ◦Program is re-translated every time it is run ◦It can run on any system with a working interpreter 8/26/2013CS181 - INTRO TO CS - HONORS I 22

Compiling Java Programs The Java compiler does not translate your program to machine language It translates it to a lower-level language called bytecode What is bytecode? “Bytecode is the machine language for a hypothetical computer known as a virtual machine.” The machine that understands bytecode is the Java Virtual Machine (JVM) ◦Essentially an interpreter for bytecode Java programs can run in any computer with a JVM The JVM needs to be ported to new architectures ◦The JVM is simpler than the compiler ◦Need to only write the compiler once 8/26/2013CS181 - INTRO TO CS - HONORS I 23

Compiling and Running a Java Program Java program Data for program Java compiler Bytecode program JVM Machine- language instructions Execution Program output Syntax errors Run-time errors 8/26/2013CS181 - INTRO TO CS - HONORS I 24

Summary Computer systems are comprised of software and hardware ◦Hardware is the physical machine ◦Software refers to all programs on system, including any applications and the operating system Programs and data are all stored in random access memory The smallest piece of information addressable in memory is a byte Each CPU can execute machine-language instructions written in its language Data need to be frequently moved to CPU registers before operating on them ◦Always on CISC architectures Compilers are the programs that transform higher-level language programs to lower-level and, eventually, machine instructions The Java compiler generates bytecode which is understood and executed by the JVM 8/26/2013CS181 - INTRO TO CS - HONORS I 25