{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
2
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
Image of page 3

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

View Full Document Right 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
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
Image of page 5

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

View Full Document Right 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
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
Image of page 7

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

View Full Document Right 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
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
Image of page 9

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

View Full Document Right Arrow Icon
An example assembly language program 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.
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern