Newest Viewed Downloaded

Programming: The “WHAT” and the “WHY”Anthony Tung School of Computing National U. of Singapore

Programming: The “WHAT” and the “WHY”

Anthony Tung School of Computing National U. of Singapore ‹#›

Objectives

Explain what exactly is programming by Designing increasingly more complex machines which can solve increasingly complex problems through increasingly complex programming concepts Through this process, you should be able to appreciate NOT only WHAT programming is but is also able to appreciate WHY certain programming concepts are designed in certain way. ‹#›

COMPUTING MACHINE A(Calculator): Manual InPUT

Consider a simple machine A, with a very simple architecture and a very simple instruction set Register A Register B Command Processor Output A Input B Manual input of command one at a time Instruction Effect InputB Read a number into Register B OutputA Output the number in Register A A <- v Set Register A to value v B <- v Set Register B to value v A <- A + B Sum the values of Register A and B and put the result into A A <- A/B Divide the values of Register A and by the value in Register B and put the result into A ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

Register A Register B Command Processor Output A Input B Manual input of command one at a time 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

Register A Register B Command Processor Output A Input B A <- 0 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

0 Register B Command Processor Output A Input B A <- 0 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

0 Register B Command Processor Output A Input B Input B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

0 Register B Command Processor Output A Input B Input B 5, 3, 7, 2, 10 5 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

0 5 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

0 5 Command Processor Output A Input B A<-A+B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

5 5 Command Processor Output A Input B A<-A+B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

5 5 Command Processor Output A Input B A<-A+B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

5 5 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

5 5 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 3 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

5 3 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

5 3 Command Processor Output A Input B A<- A + B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

8 3 Command Processor Output A Input B A<- A + B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

8 3 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

8 3 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 7 ‹#›

P1: Can we USE MACHINE A TO FIND the average of 5 numbers?

8 7 Command Processor Output A Input B Input B 5, 3, 7, 2, 10 ‹#›

Showing 1 - 20 of 56 items Details

Name: 
What_is_programming
Author: 
dcstunga
Company: 
National University of...
Description: 
Programming: The “WHAT” and the “WHY”Anthony Tung School of Computing National U. of Singapore
Tags: 
2012 | input | output | machin | command | number | regist | processor | averag
Created: 
8/5/2011 2:55:08 AM
Slides: 
56
Views: 
0
Downloads: 
0
Rating: 
0


> Comment



Share this presentation
|

Comments

Share this presentation:

|
Sitemap