Introduction to Electrical and Computer Engineering II

Slides:



Advertisements
Similar presentations
Chapter 1: Computer Systems
Advertisements

Programming Languages
Programming with Java. Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: –Understand the.
CS 151 DIGITAL Systems Design Lecture 34 Datapath Analysis.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
1 Kursusform  13 uger med: Undervisning i klassen 1,5-2 timer Opgave ”regning” i databar (løsninger på hjemmeside) En midtvejsopgave der afleveres og.
The Java Programming Language
ENGIN112 L34: Datapath Analysis November 24, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 34 Datapath Analysis.
Outline Java program structure Basic program elements
Chapter 1 Introduction. © 2004 Pearson Addison-Wesley. All rights reserved1-2 Outline Computer Processing Hardware Components Networks The Java Programming.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Chapter 1 Introduction.
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Java: Chapter 1 Computer Systems Computer Programming II Aug
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
Chapter 1 Programming Languages. Application Development: Top 10 Programming Languages to Keep You Employed 1. Java 2. C# 3. C++ 4. JavaScript 5. Visual.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley John Lewis, Peter DePasquale, and Joseph Chase Chapter 1: Introduction.
© 2006 Pearson Education Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition.
Java: Chapter 1 Computer Systems Computer Programming II.
Java Language and SW Dev’t
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
The Java Programming Language
CSC204 – Programming I Lecture 4 August 28, 2002.
Introduction. Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Chapter 2: Java Fundamentals
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Lecture 2 Software Concepts Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
1 Problem Solving b The purpose of writing a program is to solve a problem b The general steps in problem solving are: Understand the problemUnderstand.
Intro to Programming  Chapter 1 Part 2  Problem Solving.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
Copyright 2010 by Pearson Education APCS Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Working with Java.
Adapted by Dr. Adel Ammar
Lecture 2: Data Types, Variables, Operators, and Expressions
CSE 190D, Winter 2013 Building Java Programs Chapter 1
Number Systems Give qualifications of instructors:
1.3 Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: Understand the problem Dissect the.
Give qualifications of instructors: DAP
null, true, and false are also reserved.
Introduction to Java Programming
An overview of Java, Data types and variables
Instructor: Alexander Stoytchev
Chapter 1: Computer Systems
ساختمان داده ها پشته ها Give qualifications of instructors: DAP
ساختمان داده ها لیستهای پیوندی
Units with – James tedder
Units with – James tedder
Instructor: Alexander Stoytchev
Java Software Solutions Foundations of Program Design 9th Edition
Focus of the Course Object-Oriented Software Development
CSE 142, Spring 2012 Building Java Programs Chapter 1
Instructor: Alexander Stoytchev
NAND and XOR Implementation
Zorah Fung University of Washington, Spring 2015
March 2006 Saeid Nooshabadi
Chap 2. Identifiers, Keywords, and Types
CSE 142, Winter 2014 Building Java Programs Chapter 1
Circuit Analysis Procedure by Dr. M
Dept of Electronics Engineering
Zorah Fung University of Washington, Winter 2016
CS 151 Digital Systems Design Lecture 1 Course Overview
Presentation transcript:

ECE 122 Engineering Problem Solving with Java Lecture 1 Course Overview Introduction to Electrical and Computer Engineering II Give qualifications of instructors: DAP teaching computer architecture at Berkeley since 1977 Co-athor of textbook used in class Best known for being one of pioneers of RISC currently author of article on future of microprocessors in SciAm Sept 1995 RY took 152 as student, TAed 152,instructor in 152 undergrad and grad work at Berkeley joined NextGen to design fact 80x86 microprocessors one of architects of UltraSPARC fastest SPARC mper shipping this Fall

What is this class about? Welcome! What is this class about? Java programming ← somewhat “software” ← somewhat Solving engineering problems with programming ← our main focus! What will I get out of this class A better understanding of specifying engineering problems Techniques for specifying engineering problems in Java A good understanding of the fundamentals of Java credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

Course resources The course web site contains important information associated with the course. Check the site frequently for homework info, assignments, tips, lectures slides, etc. Course web site: http://www.ecs.umass.edu/ece/ece122/ Course text: Java Software Solutions, fourth or fifth edition, Lewis and Loftus, Addison-Wesley You will only be responsible for material discussed in lecture and in discussion When in doubt refer to the lecture slides. Course software: DrJava – Its free from drjava.org! 5th edition 4th edition credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

Course staff Prof. Russell Tessier – lecturer and discussion leader Graduate TAs Sailaja Madduri Samant Saurabh Aparna Venkataramani Undergraduate TAs Michael Haines Michael Shusta credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs. The TAs are here to help you.

Grade Composition 3 exams. 20%, 20%, 24% 6 homeworks 2% each 6 labs. 4% each Assignments must be turned in on time! Excuse 1: The server was down – not likely Excuse 2: I “accidently” uploaded the wrong files – check programs immediately before submission Excuse 3: My network connection went down – make sure assignment is uploaded early

ENGIN112/ECE122 Comparison ENGIN112 ECE122 No late assignments Arrive to lecture on time Most information from lecture slides Older Taller

Brief Rehash of ENGIN112: Digital Systems Information can be represented by binary digits 0 and 1 We can build digital systems with logic gates Groups of gates can perform computation A B Y ALU Function Conditions DataA DataB DataOut credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

How do we often solve task-based problems? Example: A trip to the store Get out of bed Get dressed Make list of items Get into car Drive to store Pick items off shelf Go to register Drive home Observations Activities take place sequentially, one at a time The order of the operations matter If the “data” is the same. I should get the same result every time. Question: How does a computer solve problems? credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

A wire can be driven by only one tri-state at a time Datapath I/O A wire can be driven by only one tri-state at a time If InPass is active, AluPass must be inactive If AluPass is active, InPass must be inactive InPass OutPass Out X LoadX Y LoadY ALU credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs. Function AluPass

Two values enter from the left (A and B) Datapath I/O Two values enter from the left (A and B) Need to perform (A+B)+A In -> X (Load A) In -> Y (Load B) A+B -> Y (A+B)+A -> Out Four steps and then repeat InPass OutPass In Out LoadX X Y LoadY credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs. ALU Function AluPass

Implementing the Control ROM Two values enter from the left (A and B) Need to perform (A+B)+A In -> X (Load A) - State 00 In -> Y (Load B) - State 01 A+B -> Y - State 10 (A+B)+A -> Out - State 11 ROM 0100010100 00 Addr 1000001100 01 1101101010 10 11 0001100011 PS THIS IS SOFTWARE! NS Control outputs credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs. PS NS Function LoadX LoadY InPass AluPass OutPass 00 01 000 1 0 1 0 0 01 10 000 0 1 1 0 0 11 011 0 1 0 1 0 00 011 0 0 0 1 1

Datapath and Control ROM Control of data path with ROM ROM contains “program” Engin112 –

What is Programming Language? A programming language allows programmers to specify tasks for the computer one task at a time. Just like most things in life The computer then “executes” this sequence of tasks on hardware to generate a result For the same data, the computer should get the same result every time. To solve engineering problems we need to: Specify the problem as a series of simple tasks Know how to specify these tasks (syntax, rules, format, tools, etc). Programming language for this semester: Java!

Java Program Structure // comments about the class public class MyProgram { } class header class body Comments can be placed almost anywhere

Java Program Structure // comments about the class public class MyProgram { } // comments about the method public static void main (String[] args) { } method header method body

Java Program Structure In the Java programming language: A program is made up of one or more classes A class contains one or more methods A method contains program statements These terms will be explored in detail throughout the course A Java application always contains a method called main

A Java Program /* Lewis/Loftus 6/11/2003 Lincoln.java demonstrates the basic structure of a Java Application. */ public class Lincoln { // starts the class definition These are ‘single line’ comments // Prints a presidential quote. public static void main (String[] args) // this is a method name { System.out.println (“A quote by Abraham Lincoln:“); // invokes another method System.out.println (“Whatever you are, be a good one.”); } } // ends the class definition

What to Notice in Lincoln.java The first few lines between /* and */ are comments. Comments don’t affect what the program does but are included to make the program easier to understand. Comments included in a program are called inline documentation. The comment symbols /* and */ can surround a multiline comment. The comment symbol // can be used at the beginning of a single-line comment.

Comments Comments are notes in the text of a program to assist that/any programmer who must later modify or simply understand the code. The original programmer often will not remember later the details of the program he or she has written. Comments within the text of a program are referred to as internal documentation. Good internal and external documentation are essential.

A single-line comment in Java takes the form: Two Types of Comments A single-line comment in Java takes the form: // This is a comment. A multi-line comment takes the form: /* This is one comment that spans several lines. */ It is also permissible to use the above notation for a single-line comment. /* This is a comment */

Good Programming Practices Appendix F of our text presents guidelines for good programming practices Specific techniques for documenting programs. Be Verbose You can assume the reader is computer literate and familiar with Java. Assume the reader knows almost nothing about what the program is supposed to do. You won’t be able to recognize what your program does after (at most) one week.

Identifiers and Reserved Words The words used when writing programs are called identifiers. There are three categories of identifiers: Words that we make up (Lincoln and args) Words that another programmer chose (String, System, out, println, and main). Often these are words that were chosen by a programmer for code that became part of a Java library; Now available for use by all Java programmers. Words that are reserved for special purposes in the language (class, public, static, and void). The designers of the Java language chose these words.

The Reserved Words Reserved words are identifiers that have special meaning in a programming language. In the Lincoln program, they are class, public, static, and void. //******************************************************************** // Lincoln.java Author: Lewis/Loftus // // Demonstrates the basic structure of a Java application. public class Lincoln { //----------------------------------------------------------------- // Prints a presidential quote. public static void main (String[] args) System.out.println ("A quote by Abraham Lincoln:"); System.out.println ("Whatever you are, be a good one."); }

Reserved Words The Java reserved words – these words cannot be used for any other purpose, such as naming a class or method. abstract boolean break byte case catch char class const continue default do double else extends false final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true try void volatile while

White Space Spaces, blank lines, and tabs are called white space White space is used to separate words and symbols in a program Extra white space is ignored A valid Java program can be formatted many ways Programs should be formatted to enhance readability, using consistent indentation

Programs are a series of tasks for a computer to perform. Summary Programs are a series of tasks for a computer to perform. A programming language defines how we specify the tasks Important to use many comments and to understand identifiers Reading: L+L: 1.1 – 1.4, Download and play with DrJava credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.