240 likes | 373 Views
COMS 161 Introduction to Computing. Title: Computing Basics Date: September 13, 2004 Lecture Number: 9. Announcements. May miss later part of office hours today and Wednesday. Review. Hexadecimal Numbers Digitization. Outline. Digitization Computer System Basics. Digitizing Images.
E N D
COMS 161Introduction to Computing Title: Computing Basics Date: September 13, 2004 Lecture Number: 9
Announcements • May miss later part of office hours today and Wednesday
Review • Hexadecimal Numbers • Digitization
Outline • Digitization • Computer System Basics
Digitizing Images • Images are digitized using a two step process • Sampling the continuous tone image • Quantizing the samples
Sampling Images Sample image by pixel resolution Spatial Sampling Sample two- dimensional space
Quantizing Images All gray values in each sample are averaged
Quantizing Images Different amount of sampling
Quantizing Images Different amount of sampling
Quantizing Images Different amount of sampling
Computer Systems • A dime a dozen!! • They are everywhere and their uses continue to expand • Microwaves • Clocks • Cars • Watches • What’s next • Shoes??
Computer System • Electronic digital data processing machines • Data: symbolic representation of information • Digital: numeric codes • Computers are discrete state machines • Finite number of states • All are distinct and different • Always in a state
Computer System • Programs, Applications, or Process • Set of actions • Traversing certain states • Sequence of distinct states • Fast to go from one state to another • Billionths of a second • So fast, a process appears continuous • As do light bulbs • Your TV screen
Computer System • Mechanical computers • Mechanical and electrical • Electromechanical • Electronic • Fastest, but still performs simple steps • One of the great illusion of the computer: • Lots of simple steps performed quickly enough make the computer appear complicated
Computer Systems Evolution • State transitions are simple • Baby steps • States are independent • Does not matter on state before or after • Instructions cause state transitions • Going from one state to the next • Must be precise and unambiguous • Causing the desired state transition • Instructions are executed
DWIM • The notorious instruction • Prof P’s grand challenge • $1000.00 reward • Make a machine the executes the DWIM instruction • Do • What • I • Mean
Computer Systems • Unlike students (and my daughters) • Computers do what they are told to do • Nothing more, nothing less • Computer Programs (applications) • Consist of a sequence of instructions • Running a program • Executing one instruction after another • This is the primary job of the computer!!!
Fetch the next instruction Decode the instruction Execute the instruction Repeat Computer Systems • Think of the computer as a dogg! • Here boy, here boy, … • Fetch-decode-execute cycle • No good boy or treats are necessary!!
Computer Systems • The fetch-execute cycle • This is not your fathers Orange County Chopper!!
3 + 5 Computer Systems • Data instructions • Instructions that perform an operation on specified data • add 3, 5 • Instruction refers to the values to be added directly • Instruction has direct access to the values to be added
Computer Systems • Indirection • Advantageous to refer to data indirectly • Makes programs more general • Instruction tells where the data is, not what the data is • Other values can be stored and processed • add val1, val2 • val1 and val2 refer to locations that contain the values to add
val1 val2 + val1 and val2 could refer to any other place which contains other values Computer Systems • Indirection 3 7 12 1 5 234 2 3 45 135 5
Computer Systems • Instructions that refer to data • Put the values in special places • Get the values from where they are • Save them in a place where the adder looks for its input • Execute the add instruction • Place the result someplace
Computer Systems • Slight variant of the add instruction • add val1, val2, val3 • Fetch the values (operands) to be added • Read the memory at the location of val2 • Put the value on one of the adder inputs • Read the memory at the location of val3 • Put the value on the other adder inputs • Execute the add • Put result in memory at location val1