180 likes | 275 Vues
CSE115: Introduction to Computer Science I. Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu. Announcements. Cell phones off Name signs out and. An apology. I dropped the ball on coverage for the A7 recitation.
E N D
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu
Announcements • Cell phones off • Name signs out • and . . .
An apology I dropped the ball on coverage for the A7 recitation. You can complete the first-week exercises during the week, or during recitation next week. If you need any help completing them, just let me know.
Last class • Instructions are encoded as bit strings • Machine languages • Fetch-Decode-Execute cycle
Computer Organization • Central Processing Unit (CPU) • Registers • General purpose (e.g. R1 – R16) • Special purpose (e.g. Program Counter and Instruction Register) • Arithmetic Logic Unit (ALU) • Memory
Roadmap(where we’re headed) • Low-level languages • High-level languages • Requirements for a programming language
Low-level languages • Machine language • 1101000001000010 • Assembly language • ADD R1 R2
Translation • LLL LLL is called assembly • there is a 1:1 translation from assembly to machine language • fairly simple process
High level languages • Java (this is the language we will be using) • We can write “x + y” instead of “ADD R1 R2” (in addition to several MOV instructions) • Others: C#, Erlang, Python, ML, Prolog, Lisp, etc.
Translation • LLL LLL is called assembly • there is a 1:1 translation from assembly to machine language • fairly simple process • HLL LLL is called compilation • there is no 1:1 translation • translation is quite complex • optimizations can be applied to make low level code more efficient
Requirements of a PL • Sequencing • Selection • Repetition
Equivalences • Computation models • Turing Machine • Lambda calculus • Programming languages • Java • C# • Prolog • Python
High-level languages • Richer syntax than • Machine language (bit strings) • Assembly language (mnemonic) • Improved readability/writeability • Must be translated (compiled) to machine language
Java • A modern high-level language • Object-oriented • Large libraries • (Relatively) simple core language
Moving on… • We will return to low-level issues later in the semester, and also in later courses. • This brief low-level discussion gives context for upcoming topics. • Now we turn to some higher-level issues.
I have a question for you! • What did you have for breakfast today?
Activity The goal of this short activity is to demonstrate two things: • objects have behaviors • sending message to objects can trigger those behaviors