business programming i
Download
Skip this Video
Download Presentation
Business Programming I

Loading in 2 Seconds...

play fullscreen
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

slide11

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

slide13

FLOWCHART OF PROBLEM

START

INP A

INP B

LDA A

MPY B

STA C

C = A * B

OUT C

STOP

slide15

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

slide17

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

slide19

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

slide20

Variable Naming

SCR = Individual Score

SOS = Sum of Scores

COS = Counter of Scores

COP = Counter of Passing

AVG = Average Score = SOS / COS

slide21

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

slide22

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

slide23

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

slide24

Go TU !!!

Jim Payne - University of Tulsa

ad