1 / 80

INTRODUCTION TO COMPUTER SCIENCE

INTRODUCTION TO COMPUTER SCIENCE. CONCEPTS AND PROGRAMMING CPSC 206. Outline. Part I: an overview of computer science. Part II: computer hardware and software. Part III: computer languages. Part I: An Overview of Computer Science. What is Computer Science?.

daw
Download Presentation

INTRODUCTION TO COMPUTER SCIENCE

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. INTRODUCTION TO COMPUTER SCIENCE CONCEPTS AND PROGRAMMING CPSC 206

  2. Outline • Part I: an overview of computer science. • Part II: computer hardware and software. • Part III: computer languages.

  3. Part I: An Overview of Computer Science

  4. What is Computer Science? The study of how to solve problems with computers: • design and build a computer - architecture, electrical engineering • use and share the computer efficiently - operating systems • know if your problem is solvable - computability theory

  5. Computability Theory Motivated by 2 fundamental questions. 1) What is an Algorithm? 2) What are the capabilities & limitations of algorithmic computation? Area of research for mathematicians & logicians since the 1930’s.

  6. communicate a solution to a computer: - programming languages, compilers, semantics

  7. Semantics of a programming language. Associates a meaning with each syntactically valid construct. Describes the actions that will occur when the program associated with any valid construct in the language which is executed by a computer.

  8. analyze your solution for correctness and efficiency • know if your solution is optimal - complexity theory

  9. Complexity Theory • From computability to complexity, attention shifts from exhibiting the existence of algorithms to analyzing their efficiency . • The performance is measured by the resources required by a computation. “How much question”. • A solvable problem may have No practical solution: every solution may require an unacceptable amount of resources.

  10. find a solution automatically -artificial intelligence (make your solution easier for people to use) - computer-human interaction • solve BIG problems - software engineering • exploit multiple computers -parallel and distributed systems, networking

  11. Software Engineering Real-life programs are usually • large (thousands of lines of code) • created by teams of people • modified over the course of years Rules and methods are needed to cope with this complexity. Computer Science is more than Programming!

  12. Part II: Computer Hardware and Software

  13. Outline • The development of modern computer systems. • Computer organization. • Solving problems on computers. • Programming and software engineering.

  14. The Development of Modern Computer Systems Early electronic computers Mainframes Time sharing Microcomputers Networked computing

  15. Early electronic computers • ENIAC (1946) - Electronic Numerical Integrator and Calculator: • First general purpose purely electronic digital computer. • Built for US Army to make calculations for weather predictions & ballistics tables. • 18, 000 vacuum tubes, space 50 X 30 ft, weighed 30 tons. • Numbers are entered by manually setting its 6000 switches.

  16. EDVAC - Electronic Discrete Variable Calculator • A general instruction set and a stored program. • Both numbers and program instructions were stored electronically in the computer’s memory. • UNIVAC - Universal Automatic Computer • First commercially built computer. • Delivered to the U.S. Census Bureau in 1951 to tabulate the results of the previous year’s census.

  17. John von Neumann (1903-1957) • “von Neumann machine”. • Binary number computation. • Memory for data storage. • Input and output devices. • Overall logical control.

  18. Mainframes • Generation • The development of modern computers is often described in terms of the “generation”, in which a particular technology was used. • Architecture • The overall design of a computer’s electronic circuitry and its logical functionality is called its architecture.

  19. First generation – 1950s • Architecture • Electronic circuitry: vacuum tubes. • Memory: magnetic cores. • Stored program • Program: machine language. • Processing: a single program at a time. • Peripheral devices • Input and output: punched cards. • Data storage: magnetic tapes.

  20. Second and third generations – 1960s • Architecture • Electronic circuitry: transistors to integrated circuits (ICs). • Symbolic languages • Assembly language. • FORTRAN - FORmula TRANslation, first high-level language. • COBOL - Common Business-Oriented Language. • LISP - LISt Processing.

  21. Translators: translating high-level language to machine-understandable form: • Assemblers: converting program instructions from assembly languages into the machine language. • Compilers: translating program statements from FORTRAN and COBOL to machine language. • Interpreter: translating and executing each program statement dynamically.

  22. Operating Systems (OS): a program to control the overall processing of the machine. • Batch processing: jobs that were similar in their requirements were grouped together into batches and run sequentially. • JCL (Job Control Language): to minimize operator intervention, JCL cards were inserted between the card decks of each job to direct how each job was to be processed. • Mass storage: disk drives provided permanent storage and fast access to large quantities of data.

  23. Time Sharing • Time sharing controls computer operations in such a way that input and output activity (I/O) would not slow down the primary computation. • Multiprocessing (mid-1960s) • A program was broken into tasks (processes). • Each process was allow a interval of time for execution before control was passed to another one. • Interactive computing (early 1970s) • User could sit at a remote terminal and communicate directly with the computer. • Allow multiple users at the same time.

  24. Microcomputers • Fourth generation – 1970s • Chip circuitry: VLSI - Very Large Scale Integration, which could contain all logic circuits on a single chip. These chips were known as microprocessors. • Minicomputers – 1970s • Lower cost and more accessible computing power. • Architecture is based on the 16-bits (vs. the 32-bits in use for larger computers) representation of data in computer memory.

  25. PC - Personal Computer – 1970s-1980s • Low cost computers intended for personal use. • Input: keyboard. • Output: screen. • Data storage: removable floppy disks. • Examples: Apple, IBM PC. • DOS - Disk Operation System • DOS was developed by Microsoft for the IBM PC. • DOS provides the basic functions for a single user to handle data storage and to control input and output devices and program execution.

  26. GUI – Graphical User Interface: • With the introduction of the Mac (Macintosh) computer by Apple in 1984. • Information was presented to the user via pictures, known as icons. • A new hand-held input device, called a mouse, was available for selecting choices from the screen. • Mac utilized a bit-mapped display which is able to display both graphics and text. • Each graphical image is composed of small dots called pixels which must be manipulated individually by the computer ‘s programs.

  27. PC software: • Software are programs directing a computer’s operations and solving problems. • Hardware are the physical devices that form the computer itself. • The popularity of PCs grew rapidly in the 1980s as innovative application programs were developed to enable nontechnical users to do useful tasks on the computer.

  28. Word processors allow a user to write and edit text. • Spreadsheet programs provider convenient computational power for data stored in tables. • Business graphics programs are able to display data in the form of graphs and charts.

  29. Workstations – 1980s For complex number crunching scientific and engineering programs. • For a single user. • Using multiprocessing systems. • Well suited for networking use.

  30. Networked Computing • Computer networks – 1980s-present • Users access computers which are at a distance. • Users share data. • Users transmit messages between computers. • Telephone lines • An electronic device called a modem allows computers to transmit data over telephone lines,

  31. LAN – Local Area Network • A LAN allows computers in reasonable proximity of each other to be connected by cabling over which data can be transmitted from one machine to another without the use of telephone lines. • Distributed computing • Techniques of shared processing over networks are generally called distributed computing. • A computer that provides the core of the services is called a server. • Any computer requesting a service is known as a client.

  32. Computer Organization Data representation Main Memory Central Processing Unit

  33. Data Representation • The information which a computer processes is generally known as data. • Individual data values may represent numbers, alphabetic characters, or other coded information. • The computer programs are also data, because the instructions which they contain must be stored in the computer’s memory before they are able to be processed.

  34. All data is stored and processed in binary form, that is, as a series of 0s and 1s. • Each binary digit, called a bit, represents the smallest unit of information which can be stored in the computer. • Bits are grouped into longer units known as bytes to hold more meaningful data. • 1 byte = 8 bits

  35. Two standard coding systems for representing a byte. • ASCII– American Standard Code for Information Interchange • Hello  1001000 1000101 1001100 1001111 H – 72 128 64 32 16 8 4 2 1 27 26 25 24 23 22 21 20 0 1 0 0 1 0 0 0 • EBCDIC – Extended Binary Coded Decimal Interchange Code: • Hello  11001000 11000101 11010011 11010011 11010110

  36. Main Memory • Main memory is that part of a computer’s electronic circuitry which holds the binary data which the computer’s program will process. • Memory is divided into cells. • Each cell is assigned a specific address, from 0 to the maximum size of the computer’s memory capacity.

  37. The size of a computer’s memory is the number of the addressable cells it contains. Bit 1 Byte 8 bits Kilobyte 210 bytes 1,000 Megabyte 210 kilobytes 1,000,000 Gigabyte 210 megabytes 1,000,000,000 Terrabyte 210 Gigabytes 1 trillion e.g. A 256K bytes of memory have 256*1024=262,144 bytes.

  38. ROM – Read-Only Memory, is a specialized part of main memory which is designed to prevent data loss when the power to the computer is turned off. • Read-Only. • Permanence. • Typical use: ROM is reserved for critical program instructions which must be immediately available when a computer is first turned on.

  39. Central Processing Unit • CPU is the heart of a computer. • Control unit has the overall task of controlling and coordinating the computer’s operations. • Arithmetic/Logic Unit (ALU) performs all arithmetic computations and logic operations.

  40. Control unit: • Program execution: • Each computer has a unique instruction set determined by the designers of its architecture. Each instruction includes a code that specifies the operation to be performed, and the memory address of the data value to be acted on. • All the operations of a computer are directed by a set of instructions, known as a program, which is stored in the computer’s main memory. • The control unit locates the appropriate instructions, controls their sequencing, and executes them by activating appropriate circuitry.

  41. Program Counter (PC) is a special-purpose memory location which always contains the memory address of the instruction that is currently being executed. • Instruction counter (IC) is another special-purpose memory cell which contains the instruction currently being processed.

  42. Hardware characteristics • CPU synchronizes its operations by the regular pulses emitted by an electronic device called a clock. • The speed of a computer can be quoted as: • Clock speed, e.g. 100MHz means 100 million cycles per second. • MIPS, a million instructions per second

  43. Arithmetic/Logical Unit (ALU) performs all arithmetic computations and logical operations. Arithmetic - Add, subtract, multiply, divide exponentiation etc. Logical - Testing for relationships. A<B; Name = ‘mary’; c>=10; possible Answers? True or False The ALU contains special memory cells, known as registers, in which the arithmetic is carried out.

  44. CPU reads the individual program instructions from main memory. Executes the instructions 1 at a time until completion Fetch - Decode - Execute The machine cycle algorithm is continuously repeated until program termination. Machine Cycle

  45. Fetch: • Retrieve the next instruction from memory [where the command is located (address) is stored in a register called the program counter] • update the program counter to the address of the next instruction. • The instruction just Fetched is placed in the instruction register

  46. Decode the Bit pattern in the instruction register Having decoded the instruction, the control unit enters the execute phase. It activates the correct circuitry to perform the requested task. Decode: Execute:

  47. If the instruction is a load from memory, the Control unit causes the load to occur. • If the instruction is for an arithmetic operation, the control unit activates the appropriate circuitry in the ALU with the correct input stored in registers. • When the instruction has been executed, the control unit again begins the machine cycle with the Fetch cmd (the address of the next cmd is in the program counter)

  48. Diagram of Architecture CPU R1 PC R2 IC R3 R4 control unit ALU bus

  49. Diagram of Architecture (cont.) First second third Instr. Instr. Instr. 0 1 2 3 4 … 95 96 97 98 99 …… .. data memory

  50. Solving Problems on Computers

More Related