Presentation is loading. Please wait.

Presentation is loading. Please wait.

Snick  snack A Working Computer Slides based on work by Bob Woodham and others.

Similar presentations


Presentation on theme: "Snick  snack A Working Computer Slides based on work by Bob Woodham and others."— Presentation transcript:

1 snick  snack A Working Computer Slides based on work by Bob Woodham and others

2 Learning Goals To specify the overall architecture of a (Von Neumann) stored program computer – an architecture that instantiates the principle that both program and data are bits (i.e., state) loaded and stored in (common) memory. To trace execution of an instruction through our computer in TkGate: the basic fetch-decode-execute instruction cycle and the data flow to/from the arithmetic logic unit (ALU), the main memory, the Instruction Register (IR) and the Program Counter (PC) under control of the microController. To establish the sequence of theoretical and practical constructs that connect algorithm design down to an algorithm’s execution on physical devices.

3 Computer Strategy We can now design a circuit to implement any DFA we like, but that circuit will only implement that DFA. Can we do better? Strategy: instead of designing a new circuit for each new problem, we will: 1.Implement a DFA that executes a sequence of instructions which are its input. 2.Design a relatively small number of instructions that we can combine to solve many, many problems 3.Solve different tasks by changing the sequence of input instructions, not the circuit. With this, we achieve “universality”: a single computer that can perform any conceivable computation (although we won’t formally prove that we have achieved this).

4 A “Normal” DFA as a Sequential Circuit DFA with a bunch of states and with output on arcs Sequence of inputs Sequence of outputs clk

5 Ultra-High-Level CPU View: Fetch, Decode, Execute Cycle, as DFA DFA with LOTS of states and output on arcs Sequence of outputs clk A stored-program computer includes data and code in its memory. Load memory with code/data and start the machine, and it “acts out” its program. Load new code/data, and restart, and it “acts out” a totally different program! A stored-program computer can simulate any other computer that we can now practically or theoretically envision!

6 Ultra-High-Level CPU View: Fetch, Decode, Execute Cycle Memory: code and data Program Counter (PC) Accumulator (ACC) Next instruction and data Address of next instruction Data to store back in memory Data to use in next instruction Updates to address and new data ACC and PC are “registers”: extra little pieces of fast memory. Combinational Circuitry, esp. ALU and controller

7 Brief Overview of Lab #7 Main components of cpu.v A small program on our computer

8 CPSC 121’s “circuits story” From the bottom up... we can build digital logic in physical devices (remember the water computers and switches?) we can use logic gates to organize our digital circuits we can organize logic gates into combinational circuits that calculate any logical function of their inputs (any truth table) we can use feedback to create sequential circuits that remember values and act on events we can implement any DFA using a sequential circuit we can build a working computer: a DFA with configurable memory that determines its own next instruction, which can perform any conceivable computation Wow! Too bad it’s a pain in the butt to program in our computer’s language! If only...

9 CPSC 111’s “programming story” From the top down: we can design algorithms to solve an enormous variety of computational problems we can encode those algorithms into programs in high-level programming languages compilers and interpreters can automatically transform those programs into low-level programming languages Any guesses what those low-level programming languages might look like? Here’s one we already saw...

10 Java Byte Code Part of our Java code: // Let's do something a hundred times. int i = 100; do { // Make i one smaller. i--; } while (i > 0); Here’s a typical “hex” view of ~1/5 th of the program’s byte code. 10

11 CPSC 111’s + 121’s Story... High-level languages all the way down to physical devices that compute. What’s left? HUGE TREMENDOUS AMAZING AMOUNTS OF STUFF: Software engineering: implementing incredibly complex systems as programs and helping programmers manage that complexity. Human-computer interaction: understanding how people work with computers and designing interfaces that are effective for them. Systems: building structures on top of the machine that knit computers together and let people and programs communicate and collaborate effectively. Artificial intelligence: recognizing, extracting, and acting on high-level patterns in complex and meaningful ways. Theory: analyzing the capabilities and limitations of computing systems to accomplish all of these tasks. Computer engineering: redesigning the machine to more efficiently (in terms of speed, power consumption, size, memory usage, etc.) execute programs. (And so on...)

12 Learning Goals To specify the overall architecture of a (Von Neumann) stored program computer – an architecture that instantiates the principle that both program and data are bits (i.e., state) loaded and stored in (common) memory. To trace execution of an instruction through our computer in TkGate: the basic fetch-decode-execute instruction cycle and the data flow to/from the arithmetic logic unit (ALU), the main memory, the Instruction Register (IR) and the Program Counter (PC) under control of the microController. To establish the sequence of theoretical and practical constructs that connect algorithm design down to an algorithm’s execution on physical devices.

13 Next Lecture Learning Goals: Pre- Class By the start of class, you should be able to: –Define the set operations union, intersection, complement, and set difference and the logical operations subset and set equality in terms of predicate logic and set membership (  ). –Translate between sets represented explicitly (possibly using ellipses “…”, e.g., {4, 6, 8, …}) and using “set builder” notation (e.g., {x  Z + | x 2 > 10  x is even}). –Execute the union, intersection, complement, set difference, subset, and set equality operations on sets expressed explicitly, using set builder notation, or a combination of these and set operators. –Interpret the empty set symbol , including the fact that the empty set has no members and that it is a subset of any set.

14 Next Lecture Prerequisites Read Section 5.1. Solve problems like Exercise Set 5.1, #1-21. (Note: the notion of a “partition” is important in CS, but we won’t discuss it in CPSC 121. We’ll talk more about “power sets” very soon.) Complete the open-book, untimed quiz on WebCT that will be due Tuesday evening March 17 th.


Download ppt "Snick  snack A Working Computer Slides based on work by Bob Woodham and others."

Similar presentations


Ads by Google