1 / 31

GCSE Computing

GCSE Computing. Sample Assessment Material Write Up Mr Travi Royal Grammar School No 1 Introduction to the Little Man Computer. Introduction.

gaura
Download Presentation

GCSE Computing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GCSE Computing Sample Assessment Material Write Up Mr Travi Royal Grammar School No 1 Introduction to the Little Man Computer

  2. Introduction In this practical investigation I am going to look at the Littleman Computer Simulation. The software for this is provided at www.atkinson.yorku.ca/~sychen/research/LMC/LMCHome.html The Littleman Computer Simulation simulates simple microprocessor and contains the following elements Program counter – this tells the program where the next instruction is going to be executed from Accumulator is a register in which intermediate arithmetic and logic results are stored whilst the program is being assembled Inbox – this is where the user enters data that the program is going to execute Outbox – this is where the data that is processed and produced by the program is going to be displayed

  3. Using the Little Man Computer Simulation The LMC responds to commands in the same as any high level programming language and has its own instruction set.

  4. Instruction set Continued Task 1 • As part of this assessment I am going to look at the working of 2 of the sample programs / tutorials which came with the LMC software and explain how these operate. The two programs I have chosen are • Produce a program using the LMC to input 2 integer values and output the add output the largest then the smallest • Produce a program using the LMC to input 2 integer values and add them together • I am going to illustrate how the LMC with a further 3 programs as well • Produce a program which use the LMC instruction set to write a program to add the first 2 values together and subtract the third integer value and store the results into the accumulator and display it in the out box together 2 integer values and then terminate • Produce a program using the LMC that will output the values from 1 to 10 I am going to modify this program so that the user can chose what number to input between 1 and 10. I will then change the program so that it counts down • Produce a program which will give the user a chance of a range of numbers and output odd and even numbers between these totals • These programs will demonstrate the use of branching statements within the LMC

  5. Program 1 Using selection to find out which number is the largest of 2 numbers entered 1) This represents the flowchart / algorithm for the program to be entered into the littleman ting 2) This shows the instructions being loaded into the computer simulators memory location now click on run

  6. Program 1 Coded example

  7. INPSTA FIRSTINPSTA SECONDSUB FIRSTBRP SECONDBIGLDA FIRSTOUTBRA PROGRAMENDSECONDBIG LDA SECONDOUT PROGRAMEND HLTFIRST DATSECOND DAT The first number is loaded and then stored in memory location first The second number is loaded and then stored in memory location second The second number is subtracted from the first and the result stored in the accumulator Are the results in the accumulator greater than or equal to zero? If so load the results of storage location first and load then into the accumulator and output them – end that part of the program Else Load the contents of storage location second and load then into the accumulator and output them – end that part of the program

  8. Program 1 Using selection to find out which number is the largest of 2 numbers entered In this video (called largestof2numbers.avi) I tested this program.

  9. Program 1 Using selection to find out which number is the largest of 2 numbers entered test plan and table The program loads the instruction set 64 is entered - stored in the first memory location 65 is entered – stored in the second memory location INP opcode 901 stored in 0 STA opcode 312 result stored in 12 on the LMC stored in 1 INP opcode 901 stored in 2 STA opcode 313 result stored in 13 on the LMC stored in 3 Sub FIRST opcode 212 stored in 4 BRP SECONDBIG opcode 809 – branch if positive stored in 5

  10. LDA FIRST – load the result of first and place into accumulator stored at 6 Out – display results of accumulator to output box stored at 7 Branchalways if value in accumulator is not postive stored at 8 LDA second load the result off first and place into accumulator stored at 9 Out – display results of accumulator to output box stored at 10 End program

  11. Produce a program using the LMC to input 2 integer values and add them together

  12. 2) Produce a program using the LMC to input 2 integer values and add them together In this video (called adding2nos.avi) I tested this program. I have enclosed the video as a standalone file in case this does not load and shows the test mentioned above

  13. 3) Produce a program using the LMC that will output the values from 1 to 10 counting up I am going to modify this program so that the user can chose what number to input between 1 and 10. I will then change the program so that it counts down Start INP STA COUNT OUT LOOPTOP LDA COUNT ADD ONE OUT STA COUNT SUB TWENTY BRP ENDLOOP BRA LOOPTOP ENDLOOP HLT ONE DAT 001 TWENTY DAT 020 COUNT DAT Is the result positive? Input a number and store in count Load the result into the accumulator Yes No Add the contents of memory location 1 to the accumulator End Subtract the contents of memory location 1 to the accumulator (20) Output the results to the accumulator

  14. 3) Produce a program using the LMC that will output the values from 1 to 10 counting up I am going to modify this program so that the user can chose what number to input between 1 and 10. I will then change the program so that it counts down test plan In this video (called countingprog1to10) I tested this program. I have enclosed the video as a standalone file in case this does not load and shows the test mentioned above

  15. Video Counting prog and testing counting up 1 to 10

  16. 3) I am going to modify the program in 3a so that it counts down. I will then change the program so that it counts down test plan

  17. Video Counting prog and testing counting down 20 to 1 I have saved this as countprog20to1.avi and this will show the program working counting back from 19 in increments of 1 to 0 and from 2 in increments of 1 to 0

  18. Produce a program which will give the user a chance of a range of numbers and output odd and even numbers between these totals

  19. Video Counting prog and testing counting up from a user defined no to 99 in increments of 2 I have produced a video called countprog1TO99ODDNOS which I have embedded here and have included with this portfoilio

  20. For the second task I have been given a number of programming tasks to tackle 1) Write programs to run in LMC: a) Produce a multiplication table from 1 to 10 for any number input by the user b) Modify this program so that a user can enter a value and it produces the square of that number for example if the user entered 5 it would produce 25 c) Modify the program so that a can user can enter a value and it produces the cube of that number for example if the user entered 2 it would produce the number 8 (which is 2*2*2) (d) Produce evidence to show that you have planned, written and tested your code. (e) Produce an evaluation of your solutions. 2) Write a conclusion about the possibility of writing effective and complex programs with only a limited instruction set.

  21. a) Produce a multiplication table from 1 to 10 for any number input by the user Start Add the contents of number1 into the accumulator Is the result positive? Input a first number and store in Number1 yes Store the result into memory location RESULT Load the contents of result into the accumulator and display in the output boc Input a number Load the contents of memory location TWO and load this into the accumulator Subtract the contents of the accumulator by the contents in memory location ONE End subtract the contents of this by the contents in memory location ONE Store the result of this in memory location number2 Load the contents of storage location RESULTS into the accumulator Store the result into memory location Number2

  22. a) Produce a multiplication table from 1 to 10 for any number input by the user I have produced a video called mulplicationof2nos. which I have embedded here and have included with this portfoilio

  23. b) Modify this program so that a user can enter a value and it produces the square of that number for example if the user entered 5 it would produce 25

  24. b) Modify this program so that a user can enter a value and it produces the square of that number for example if the user entered 5 it would produce 25 I have produced a video called squareof2nos. which I have embedded here and have included with this portfoilio

  25. c) Modify the program so that a can user can enter a value and it produces the cube of that number for example if the user entered 2 it would produce the number 8 (which is 2*2*2)

  26. Prog C continued

  27. Testing stage

  28. Modify the program so that a can user can enter a value and it produces the cube of that number for example if the user entered 2 it would produce the number 8 (which is 2*2*2) I have embedded a video which shows the results of the program being run testing 2 * 2 * 2 and 9 * 9 * 9. This is also available as a standalone video called cubeof1nos

  29. Produce an evaluation of your solutions and (f) Write a conclusion about the possibility of writing effective and complex programs with only a limited instruction set. . • For each of the programs I have as produced detailed code and shown my solution through the videos which are attached to this presentation and have been submitted as standalone products. In each case I have tested the programs at the extreme ends of what the LMC simulator is capable of doing. • The LMC is limited in its functionality as this will support numbers upto a 1000, will not accept decimal or real numbers or data types and can only perform limited arithmetic operations namely addition and division. This is a severely limiting factor on the use of the LMC but this does highlight the basic principles of machine architecture in that it shows the fetch execute cycle in action and the respective role of the registers. • If the LMC or programs like it were to be used for the calculations then a lot of processing is going to be undertaken by the program and the result will not be as accurate owing to its (the LMC’s) operation when compared to modern software applications and high level programming compilers

  30. Bibliography Slide 2 Definitions and ideas taken from Wikipedia and adapted Slide 3 Instruction set taken from http://www.atkinson.yorku.ca/~sychen/research/LMC/LMCHome.html

More Related