1 / 51

COMS 161 Introduction to Computing

COMS 161 Introduction to Computing. Title: Computing Basics Date: September 10, 2004 Lecture Number: 8. Announcements. Research paper proposals due 9/17/04, next friday. Review. Number Systems Binary Coded Decimal (BCD) ASCII. Outline. Hexadecimal Numbers Digitization

yin
Download Presentation

COMS 161 Introduction to Computing

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. COMS 161Introduction to Computing Title: Computing Basics Date: September 10, 2004 Lecture Number: 8

  2. Announcements • Research paper proposals due • 9/17/04, next friday

  3. Review • Number Systems • Binary Coded Decimal (BCD) • ASCII

  4. Outline • Hexadecimal Numbers • Digitization • Computer System Basics

  5. Binary Number System • Precision • The number of bits used to represent an item • Letter: precision of 8 bits • Integer (whole number): precision of 32 or 64 bits • Letters and integer numbers are very precise • Known bit pattern corresponds to a letter or number • Always finite • Computers have finite precision • Presents some limitations

  6. Hexadecimal Number System • Sometimes called hex • Positional,base-16 system • Each digit is multiplied by a power of 16 • Sixteen unique symbols (digits) • 0, 1, 2, …, 15 • Symbol a or A for 10 • Symbol b or B for 11 Symbol e or E for 14 • Symbol c or C for 12 Symbol f or F for 15 • Symbol d or D for 13

  7. Hexadecimal Number System • A hex number can represent 16 different items • Represent one hex number with 4-bits • Easy to convert between binary and hex representations • Group bits by 4’s from the right end • Substitute the hex symbol for each nibble • 9010 = 0101 10102 = 5A16 • Is the base 16 really needed? • 6610 = 0100 00102 = 4216

  8. Hexadecimal Number System • Use the backwards conversion to convert hex to binary • One hex digit represents 4-bits • Substitute the binary nibble • Always start at the right end • Add zeros to the left end as necessary to fill in 4 bits

  9. Hexadecimal Number System

  10. Digitization • The process of converting information into a binary form • Two classes of information to digitize • Discrete • Analog

  11. Digitization • Discrete forms are easier to digitize • Discrete information is unambiguous • Text and numbers are discrete values • Conversion of discrete to digital • Come up with a mapping • As we did with the letters • ASCII encoding • Two’s complement

  12. Binary Coded Decimal • Integers (whole numbers) • One mapping is to use each digits binary equivalent • Binary Coded Decimal (BCD) • 010 = 00002 • 110 = 00012 • … • 910 = 10012 • Need a minimum of 4 bits to represent 10 different values • Some 4 bit quantities are wasted

  13. Binary Coded Decimal • String of decimal digits • Each decimal digit is represented by 4 bits • The number of bits needed to represent different numbers vary • Performing arithmetic is complicated • Numbers must be converted into another form to computer the correct answer • BCD is a possible mapping between (all) integers and a binary representation

  14. Digitizing Analog Information • Two steps • Sampling the information • Select discrete samples that represents the information • Quantizing the samples • Discrete samples are measured • Encoded into a binary representation

  15. Digitizing Analog Information • Sampling • In time or space (picture) • Quantizing • Approximating the measured value • Placing all continuous values within a range into a bin • Binning

  16. Digitizing Images • Images are digitized using a two step process • Sampling the continuous tone image • Quantizing the samples

  17. Sampling Images Sample image by pixel resolution Spatial Sampling Sample two- dimensional space

  18. Quantizing Images All gray values in each sample are averaged

  19. Quantizing Images Different amount of sampling

  20. Quantizing Images Different amount of sampling

  21. Quantizing Images Different amount of sampling

  22. Computer Systems • A dime a dozen!! • They are everywhere and their uses continue to expand • Microwaves • Clocks • Cars • Watches • What’s next • Shoes??

  23. 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

  24. Computer System • 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

  25. 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

  26. Computer Systems • 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

  27. DWIM • The notorious instruction • Prof P’s grand challenge • $1000.00 reward • Make a machine the executes the DWIM instruction • Do • What • I • Mean

  28. 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!!!

  29. 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!!

  30. Computer Systems • The fetch-execute cycle • This is not your fathers Orange County Chopper!!

  31. 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

  32. 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

  33. 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

  34. 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

  35. Computer Systems • Slight variant of the add instruction • add val1, val2, val3 • Fetch the value referred to by val1 • Read the memory at the location of val1 • Put the value on one of the adder inputs • Read the memory at the location of val2 • Put the value on the other adder inputs • Execute the add • Put result in memory at location val3

  36. Computer Systems • Seemingly simple instruction like add • Require several simpler steps to execute • As complex as computers seem, they still do simple things • Moving data from one place to another • Simple arithmetic operations • Illusion of complexity • Perpetuated by the speed of simple operations

  37. Computer Systems • Composed of two major items • Hardware • Electronic devices that perform specific tasks • Two basic groups • Processing unit • The heart of the computer • Peripherals • Software • Programs the hardware executes

  38. Computer Systems • Processing unit • Central processing unit (CPU) • Controls the instruction-execution cycle • Main memory • Stores both data and instructions • Bus • Connection between main memory and the CPU • Data and address bus

  39. CPU Computer Systems Bus Main memory

  40. 0x3550 Data Bus 0x3554 Memory Control Unit 0x3558 0x355c 0x3560 Address Bus 0x3564 0x3568 0x356c Computer Systems • Main memory • Composed of individual memory cells • Cells are grouped into words • Words are accessed via a unique address unique memory address

  41. Computer Systems • Bidirectional bus • Data flows to and from memory • Into and out of memory

  42. Computer Systems • Read memory (read from memory) • Memory controller access word at specified address for a read operation • Data in the memory is put on the data bus • Write memory (write to memory) • Data to write into memory is on the data bus • Memory controller access word at specified address for a write operation

  43. Computer Systems • Peripheral devices • Components added to the basic computer system • Increase the systems functionality • Secondary memory • Input/output devices

  44. Software • Programs • Written using programming languages (symbolic codes for expressing computer instructions) • Programs ≠ processes • Conditional processing • The ability to alternative actions based on the recognition of changing conditions

  45. Conditional Processing • Program execution depends on certain conditions If (ProfP) { Print(“A one of a kind”); Print(“Y’all gonna miss me”); } else { Print(“We are the happy idiots”); Print(“The mediocre”); Print(“Those who fear excellence”); }

  46. Operating Systems • Continuous control of system • Supervises processes • Creates useful abstractions for users • Defines computing experience An operating system is a collection of resident programs that manage the computer’s resources, supervise the execution of processes, and provides useful services and security.

  47. Managing Files • A file is a sequence of items treated as a unit and identified with a unique name • filenames are composed of • identifier + ‘ .’ + extension • identifier (Windows) = up to 255 symbols excluding special characters • extension (Windows) = 1 - 4 characters that are used to classify file

  48. tree--special type of graph nodes, edges (links) parent(s) child(ren) ancestor(s) descendant(s) directory structure--series of levels based on a tree files, folders path--list of all ancestors of a file/folder from root pathname--conventional listing of path Hierarchical File System

  49. Windows Example

  50. TEXT-BASED Command line interpreters Terse, but powerful Steeper learning curves Burden of communication on user GRAPHIC USER INTERFACES (GUI) Manipulate visual elements User-friendly More tedious User Interface

More Related