ch14 - Chapter 14: Topics in Computer Science: Speed 1 2...

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

View Full Document Right Arrow Icon
Chapter 14: Topics in Computer Science: Speed 1
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
Background image of page 2
Big speed differences Many of the techniques we’ve learned take no time at all in other applications Select a figure in Word. It’s automatically inverted as fast as you can wipe. Color changes in Photoshop happen as you change the slider Increase or decrease red? Play with it and see it happen live. 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Where does the speed go? Is it that Photoshop is so fast? Or that Python/Jython is so slow? It’s some of both—it’s not a simple problem with an obvious answer. We’ll consider two issues: How fast can computers get What’s not computable, no matter how fast you go 4
Background image of page 4
What a computer really understands Computers really do not understand Python, nor Java, nor any other language. The basic computer only understands one kind of language: machine language. Machine language consists of instructions to the computer expressed in terms of values in bytes. These instructions tell the computer to do very low-level activities. 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
Machine language trips the right switches The computer doesn’t really understand machine language. The computer is just a machine, with lots of switches that make data flow this way or that way. Machine language is just a bunch of switch settings that cause the computer to do a bunch of other switch settings. We interpret those switchings to be addition, subtraction, loading, and storing. In the end, it’s all about encoding. A byte of switches 6
Background image of page 6
Assembler and machine language Machine language looks just like a bunch of numbers. Assembler language is a set of words that corresponds to the machine language. It’s a one-to-one relationship. A word of assembler equals one machine language instruction, typically. (Often, just a single byte.) 7
Background image of page 7

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

View Full DocumentRight Arrow Icon
Each kind of processor has its own machine language Older Apple computers typically used CPU ( processor) chips called G3 or G4. Computers running Microsoft Windows use Pentium-compatible processors. There are other processors called Alpha, LSI-11, and on and on. Each processor understands only its own machine language 8
Background image of page 8
Assembler instructions Assembler instructions tell the computer to do things like: Store numbers into particular memory locations or into special locations (variables) in the computer. Test numbers for equality, greater-than, or less-than. Add numbers together, or subtract them. 9
Background image of page 9

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

View Full DocumentRight Arrow Icon
LOAD 10,R0 ; Load special variable R0 with 10 LOAD 12,R1 ; Load special variable R1 with 12 SUM R0,R1 ; Add R0 and R1, Put the result in R1 STOR R1,#45 ; Store the result into memory location #45 Recall that we talked about memory as a long series of mailboxes in a mailroom. Each one has a location (number) (like #45).
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/22/2012 for the course CS 177 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 70

ch14 - Chapter 14: Topics in Computer Science: Speed 1 2...

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

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