Business programming i
Download
1 / 24

Business Programming I - PowerPoint PPT Presentation


  • 62 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Business Programming I' - brandi


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Business programming i

Business Programming I

Fall – 2000

By

Jim Payne


Babbage to billy o
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


Tabulating machine
Tabulating Machine

Link to biography of Herman Hollerith

Jim Payne - University of Tulsa


Links early history of computers
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


Assembler language
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


Instructions i o memory movement
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


Instructions arithmetic operators
Instructions: Arithmetic Operators

  • ADD Add to Accumulator

  • SUB Subtract from Accumulator

  • MPY Multiply Accumulator

  • DIV Divide Accumulator

Jim Payne - University of Tulsa


Instructions branching commands
Instructions: Branching Commands

  • BRU Branch Unconditionally

  • BPA Branch + Accumulator

  • BNA Branch - Accumulator

  • BZA Branch Zero Accumulator

Jim Payne - University of Tulsa


Instructions data and ending
Instructions: Data and Ending

  • HLT End of Procedure

  • NUM Initializing Variables

  • END Last Instruction

Jim Payne - University of Tulsa


Billy o language complete instruction set
BILLY-O LANGUAGEComplete Instruction Set

Jim Payne - University of Tulsa


Memory

INP

ADC LDC LDA

OUT

BRU

BPA

BNA

BZA

ADD

SUB

MPY

DIV

Accumulator

STA

Arithmetic Logic Unit


Problem input 2 numbers a b compute c a b then output c
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


FLOWCHART OF PROBLEM

START

INP A

INP B

LDA A

MPY B

STA C

C = A * B

OUT C

STOP


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


Problem
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


Introduction of Bertha’s DP World

Typewriter

Calculator

Paper & Pencil

IN

OUT


How would bertha do this
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


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


Variable Naming

SCR = Individual Score

SOS = Sum of Scores

COS = Counter of Scores

COP = Counter of Passing

AVG = Average Score = SOS / COS


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


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


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


Go TU !!!

Jim Payne - University of Tulsa


ad