1 / 24

Business Programming I

Business Programming I. Fall – 2000 By Jim Payne. Babbage to Billy-O.

brandi
Download Presentation

Business Programming I

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. Business Programming I Fall – 2000 By Jim Payne

  2. Babbage to Billy-O Between 1833 and the mid-1940’s, there were very few new developments in the field of programming languages. We did see a major contribution to the future of computing with the development of the keypunch machine and punch cards by Herman Hollerith in the 1880’s. Jim Payne - University of Tulsa

  3. Tabulating Machine Link to biography of Herman Hollerith Jim Payne - University of Tulsa

  4. Links: Early History of Computers • Virginia Tech – History of Computing • Virtual Museum of the United Kingdom • Smithsonian Museum - Computers Check out these sites to learn more about the Turing Machine, the ABC machine, the ENIAC, and then in 1951, the UNIVAC. All of these machines were either hard wired for each instruction or began the use of assembler language instructions. Jim Payne - University of Tulsa

  5. Assembler Language In the slides that follow, I will be using an “assembler like” computer programming language named BILLY-O. The language was developed at Iowa State University and then used by Dr. Roger Wainwright – TU, for several years in the early 1980’s to support the teaching of programming concepts and to help students understand at least the basics of what actually happens inside the computer. My thanks to Dr. Wainwright for supporting its continued use some twenty years later.  Jim Payne - University of Tulsa

  6. Instructions: I/O & Memory Movement • INP Input • OUT Output • LDA Load Accumulator • STA Store Accumulator • LDC Load a Constant • ADC Add a Constant Jim Payne - University of Tulsa

  7. Instructions: Arithmetic Operators • ADD Add to Accumulator • SUB Subtract from Accumulator • MPY Multiply Accumulator • DIV Divide Accumulator Jim Payne - University of Tulsa

  8. Instructions: Branching Commands • BRU Branch Unconditionally • BPA Branch + Accumulator • BNA Branch - Accumulator • BZA Branch Zero Accumulator Jim Payne - University of Tulsa

  9. Instructions: Data and Ending • HLT End of Procedure • NUM Initializing Variables • END Last Instruction Jim Payne - University of Tulsa

  10. BILLY-O LANGUAGEComplete Instruction Set Jim Payne - University of Tulsa

  11. Memory INP ADC LDC LDA OUT BRU BPA BNA BZA ADD SUB MPY DIV Accumulator STA Arithmetic Logic Unit

  12. Problem: Input 2 numbers, A & B. Compute C = A * B.Then Output C. A = 5 B = 6 Answer: C = 30 Jim Payne - University of Tulsa

  13. FLOWCHART OF PROBLEM START INP A INP B LDA A MPY B STA C C = A * B OUT C STOP

  14. INP Memory 5,6 A ADC LDC LDA B C OUT BRU BPA BNA BZA ADD SUB MPY DIV INP A INP B LDA A MPY B STA C OUT C HLT END Accumulator STA Arithmetic Logic Unit 5 6 30 30 5 30

  15. Problem: Input a series of exam scores between 0 and 100 until a trip value of 999 is entered. Then print out the number of scores processed, the average exam score, and the number of students that passed the exam (score of 60 or better). Jim Payne - University of Tulsa

  16. Introduction of Bertha’s DP World Typewriter Calculator Paper & Pencil IN OUT

  17. How Would Bertha Do This? Pick Up from the in basket a series of exam scores between 0 and 100 until a trip value of 999 is encountered. Then type up a report that provides the number of scores processed, the average exam score, and the number of students that passed the exam (score of 60 or better). Then put the typed report in the out basket. Jim Payne - University of Tulsa

  18. Sum of Scores Counter of Scores Counter of Passing 0 0 0 IN Basket 70 80 100 40 10 999 Bertha Method STEPS: (In Pseudocode Form) Pick up a card from the in basket. If score = 999, do what? Else do what? NOT EQUAL 999: Add score to Sum of Scores, Add 1 to Counter of Scores. If score >= 60, Add 1 to Counter of Passing. Then go read next score. EQUAL 999: Compute Average Score = Sum of Scores / Counter of Scores. Print out report answers. Quit Processing

  19. Variable Naming SCR = Individual Score SOS = Sum of Scores COS = Counter of Scores COP = Counter of Passing AVG = Average Score = SOS / COS

  20. Start Stop Pseudocode Revised Flowchart of Logic Input a value for SCR If SCR = 999 Compute AVG = SOS / COS Print Results and Quit Else Compute SOS = SOS + SCR Compute COS = COS + 1 If SCR >= 60 Compute COP = COP + 1 EndIf Endif Go to Top of Program

  21. Billy-O Program TOP INP SCR LDA SCR ADC -999 BZA MID LDA SOS ADD SCR STA SOS LDA COS ADC 1 STA COS LDA SCR ADC -60 BNA TOP LDA COP ADC 1 STA COP BRU TOP MID LDA SOS DIV COS STA AVG OUT AVG OUT COS OUT COP HLT SOS NUM 0 COS NUM 0 COP NUM 0 END

  22. IN Basket 70 80 100 40 10 999 Billy-O Program TOP INP SCR LDA SCR ADC -999 BZA MID LDA SOS ADD SCR STA SOS LDA COS ADC 1 STA COS LDA SCR ADC -60 BNA TOP LDA COP ADC 1 STA COP BRU TOP MID LDA SOS DIV COS STA AVG OUT AVG OUT COS OUT COP HLT SOS NUM 0 COS NUM 0 COP NUM 0 END

  23. Go TU !!! Jim Payne - University of Tulsa

More Related