Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 20041R. Smith - University of St Thomas - Minnesota Extending the Spreadsheet to Illustrate Basic CPU Operations in a Computer Literacy Course Richard.

Similar presentations


Presentation on theme: "Fall 20041R. Smith - University of St Thomas - Minnesota Extending the Spreadsheet to Illustrate Basic CPU Operations in a Computer Literacy Course Richard."— Presentation transcript:

1 Fall 20041R. Smith - University of St Thomas - Minnesota Extending the Spreadsheet to Illustrate Basic CPU Operations in a Computer Literacy Course Richard E. Smith, Ph.D. Department of Quantitative Methods and Computer Science University of St. Thomas This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit

2 Fall R. Smith - University of St Thomas - Minnesota The Problem How do we teach non-experts about the internals of the computers central processing unit (CPU)?How do we teach non-experts about the internals of the computers central processing unit (CPU)? Option: Dont botherOption: Dont bother Option: Use a software simulation programOption: Use a software simulation program Option: use the Excel-based Simple CPUOption: use the Excel-based Simple CPU

3 Fall R. Smith - University of St Thomas - Minnesota The Simple CPU Display

4 Fall R. Smith - University of St Thomas - Minnesota Operating Features RAM appears in Column A on the leftRAM appears in Column A on the left One-address instruction setOne-address instruction set –Some instructions refer to a single memory location –Calculations use a single accumulator register Each instruction requires two cyclesEach instruction requires two cycles –Fetch cycle – get the instruction thats to be executed –Execute cycle – perform the calculation or other action This cycle may fetch or store data in RAMThis cycle may fetch or store data in RAM Very Simple Instruction setVery Simple Instruction set –Three instructions refer to memory locations: Add, Store, Jump –Based on the TX-0 computer built in the 1950s

5 Fall R. Smith - University of St Thomas - Minnesota The TX-0 Not your grandfathers laptop.Not your grandfathers laptop. Transistor Experiment computer, version 0 –Built in by MITs Lincoln Laboratory Absurdly simple instruction set –Focus on testing the transistorized computer circuits –Easier to build, easier to test, easier to fix

6 Fall R. Smith - University of St Thomas - Minnesota A Simple CPU program In Assembly Language (text) format: 1.Clear 2.Add 5 3.Store 5 4.Jump (data) In Machine Language (numeric) format:

7 Fall R. Smith - University of St Thomas - Minnesota Concepts to Convey A program as a sequence of instructionsA program as a sequence of instructions Instructions in a highly coded formInstructions in a highly coded form Processor cyclesProcessor cycles CPU is separate from its RAMCPU is separate from its RAM

8 Fall R. Smith - University of St Thomas - Minnesota Use in Class Demonstrate on a projection display.Demonstrate on a projection display. Explain the notion of the processor cycle.Explain the notion of the processor cycle. Demonstrate a simple program.Demonstrate a simple program. Explain how to translate simple add-and- subtract calculations into the right sequence of add-invert-add, etc.Explain how to translate simple add-and- subtract calculations into the right sequence of add-invert-add, etc. Assignment to write their own programs in numeric form.Assignment to write their own programs in numeric form.

9 Fall R. Smith - University of St Thomas - Minnesota Final Points Integration into the spreadsheetIntegration into the spreadsheet –Relies on concepts the students learned in Excel training –Seems like a follow-on to Excel, not a major topic change –Easy to modify and extend for other classes, like computer architecture Simulator conveys concepts more effectivelySimulator conveys concepts more effectively –Pre-simulator training relied on rote learning of concepts with discussion but no hands-on work or live demonstrations –Simulator lets students demonstrate an understanding of machine level instructions by doing homework assignments –Success on CPU-oriented exam questions went from (estimate) 1 out of 3 to 7 out of 8.

10 Fall R. Smith - University of St Thomas - Minnesota Thank You! Questions? My contact information:My contact information: –Dr. Rick Smith –University of St. Thomas Getting the SimpleCPU Simulator:Getting the SimpleCPU Simulator: –Go to Google –Search for smith simple cpu demo

11 Fall R. Smith - University of St Thomas - Minnesota The Simple CPU Display

12 Fall R. Smith - University of St Thomas - Minnesota Future Work Extensions to simplify programmingExtensions to simplify programming –Add conditional jumps –Add an index register Make easier to modify and maintainMake easier to modify and maintain –Rearrange calculations to minimize reliance on memorized cell identities –Move critical functions into VBasic modules to improve readability Try using to teach computer architectureTry using to teach computer architecture –Extension to multiple cycles, multiple address modes –Modifications by students to prototype their own processors, instruction sets

13 Fall R. Smith - University of St Thomas - Minnesota Executing a Program First, reset the CPUFirst, reset the CPU –Program address (PC) starts at 1 –AC register starts at 0 Next, perform the Fetch cycleNext, perform the Fetch cycle –Calculate new values for the AC, PC, and IR in locations E3-E5, based on the contents of D5-E5 and data fetched from memory –At the end of the cycle, copy the new values of the AC, PC, and IR from cells E3-E5 to D3-D5. Finally, perform the Execute cycleFinally, perform the Execute cycle –Use the IR, Instruction, and Address cells (D5, D10, D11) to identify and execute the instruction –At the end of the cycle, copy the new values of the AC, PC, and IR from cells E3-E5 to D3-D5. –If storing a result in memory, do that, too. Start next instruction at the Fetch Cycle aboveStart next instruction at the Fetch Cycle above

14 Fall R. Smith - University of St Thomas - Minnesota Example: part of the ADD calculation Calculates the contents of the AC at the end of the Execute cycle (D4):Calculates the contents of the AC at the end of the Execute cycle (D4): =IF(D2,D3,=IF(D2,D3, –IF(D10=1,D3+D9, IF(D5=1,-D3,IF(D5=1,-D3, –IF(D5=2,0, D3))))D3)))) If its the Fetch cycle (D2 is TRUE), –leave the AC (D3) unchanged. Else if its an ADD instruction (D10=1) –Add the data from memory to the AC Else if its a Negate instruction (D5=1) –Negate the data in the AC Else if it a Clear instruction (D5=2) –Clear the data in the AC


Download ppt "Fall 20041R. Smith - University of St Thomas - Minnesota Extending the Spreadsheet to Illustrate Basic CPU Operations in a Computer Literacy Course Richard."

Similar presentations


Ads by Google