APCO 1P00 - Week 10 Lecture Slides

APCO 1P00 - Week 10 Lecture Slides - Week 10 Advanced...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
  1 Week 10 Advanced Concepts (Parts of Chapters 13 and 14)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  2 Speed Why does a program we write in JES execute slower than an equivalent task in a program such as Photoshop? To be able to answer this, we have to understand a bit about what computers understand.
Background image of page 2
  3 What do computers understand? We have already seen that computers understand 0’s and 1’s (representing the absence or presence of voltage on a wire). We have also seen how these collections of 0’s and 1’s in to bytes can be encoded for different meanings. Deep inside the hardware of the computer, there are a number of switch settings that respond to certain encodings of binary. These encodings correspond to individual program instructions that your computer can execute.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  4 These simple instructions are referred to as machine language. Instructions include adding, subtracting, loading a piece of information, saving a piece of information, etc. In the past, programmers would write their programs as series of 0’s and 1’s corresponding to the machine code instructions they desired. Each kind of computer has it’s own machine language.
Background image of page 4
  5 Machine Code Assembly Language
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  6 Machine code runs VERY fast! The reason being, the instructions are already encoded to 0’s and 1’s, so the switches simply set to those values in the hardware. The problem though, is that programming in machine code is very tedious and challenging! Thus, the idea was conceived, to make up an easier to write language (one software instruction per hardware instruction), and have another program translate that language in to machine code. This language was called Assembler Language, and the process of converting it in to machine code was called compiling (the program that does the compiling is called a compiler).
Background image of page 6
  7 Programming Steps for a compiled language 1. Write a program in assembler language. 2. Execute your compiler program to convert your assembler language program in to machine code. 3. After compiling, your new executable machine code program is now ready to run; and will do so at high speeds!
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  8 Interpreted vs. Compiled Some languages do not compile directly to machine code. Instead, they are interpreted by a host program. In JES, the code we write, is interpreted in to another language called Java. Java is ALSO an interpreted language! This code is then interpreted by the Java Virtual Machine on your computer and sends the appropriate machine code instructions to your hardware. Thus, a JES program has to go through multiple translation stages when executing, that a machine code program wouldn’t have to.
Background image of page 8
  9 So why use an interpreted language?? 1. The main advantage, is that each computer company
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 32

APCO 1P00 - Week 10 Lecture Slides - Week 10 Advanced...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online