General Concepts Carleton University Department of Systems and Computer Engineering 91.166 - Problem Solving and Computers...
Outline <ul><li>Computer Components </li></ul><ul><ul><li>Central Processing Unit (CPU) </li></ul></ul><ul><ul><li>Memory ...
Hardware Computer Components Central Processing Unit Arithmetic and Logic Unit (ALU) Control Unit (CU) Input devices Outpu...
Central Processing Unit (CPU) <ul><li>CPU is the “brain” of the computer, which understands and executes  computer program...
Memory <ul><li>Memory is the component that stores computer programs to be executed and their data. </li></ul><ul><li>Comp...
Secondary Storage <ul><li>provide storage capacity in addition to the main memory  </li></ul><ul><ul><li>common secondary ...
Computer Networks <ul><li>Local Area Networks (LAN) </li></ul><ul><ul><li>LAN connects computers and other devices closely...
Input /Output Devices <ul><li>Allow for communication between computers and the outside world, transforming information fr...
Computer Software <ul><li>Two main types of components of a computer system: </li></ul><ul><ul><li>Hardware : physical dev...
Operating Systems <ul><li>Example of OS responsibilities: </li></ul><ul><ul><li>Communicating with the computer user: rece...
Computer Languages <ul><li>Machine language </li></ul><ul><ul><li>A collection of  binary instructions  understood by a gi...
Example: Adding two numbers together <ul><li>Suppose the two numbers we want to add are stored in </li></ul><ul><li>memory...
Example: Adding two numbers together <ul><li>The machine language code to do this is: </li></ul><ul><ul><li>00110101 10001...
Example: Adding two numbers together <ul><li>The assembly language code to do this is: </li></ul><ul><ul><li>LOAD $137, R1...
Example: Adding two numbers together <ul><li>High-level languages were developed to simplify programming. </li></ul><ul><l...
High-Level Languages
Upcoming SlideShare
Loading in …5
×

Introduction

481 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
481
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction

  1. 1. General Concepts Carleton University Department of Systems and Computer Engineering 91.166 - Problem Solving and Computers from the Lecture Notes of Ian Marsland 91.166 Problem Solving and Computers Fall 2001/02
  2. 2. Outline <ul><li>Computer Components </li></ul><ul><ul><li>Central Processing Unit (CPU) </li></ul></ul><ul><ul><li>Memory </li></ul></ul><ul><ul><li>Input/Output Devices </li></ul></ul><ul><ul><li>Computer Networks </li></ul></ul><ul><li>Computer Software </li></ul><ul><ul><li>Operating Systems </li></ul></ul><ul><ul><li>Application Software </li></ul></ul><ul><ul><li>Computer Languages </li></ul></ul>
  3. 3. Hardware Computer Components Central Processing Unit Arithmetic and Logic Unit (ALU) Control Unit (CU) Input devices Output devices Secondary storage Main Memory Keyboard Mouse Screen Printer Speaker Scanner Floppy disk Hard disk Magnetic Tape
  4. 4. Central Processing Unit (CPU) <ul><li>CPU is the “brain” of the computer, which understands and executes computer programs written in machine language (a.k.a. machine code ) </li></ul><ul><li>Components of a CPU: </li></ul><ul><ul><li>Control Unit (CU): decodes machine instructions and sends control signals to the other components to carry out the instructions. </li></ul></ul><ul><ul><li>Arithmetic and Logic Unit (ALU): performs arithmetic (addition, subtraction, etc.) and logical operations (and, or, comparisons, etc.) </li></ul></ul><ul><ul><li>Registers : high speed memory locations inside the CPU, used to store temporarily the current instructions and data values. </li></ul></ul><ul><li>The circuitry of a modern CPU consists of millions of miniature circuits manufactured in a sliver of silicon known as Integrated Circuit (IC) or chip . </li></ul><ul><li>Microprocessor = an entire CPU on a single chip. </li></ul>
  5. 5. Memory <ul><li>Memory is the component that stores computer programs to be executed and their data. </li></ul><ul><li>Computer memory is comparable to a collection of numbered mailboxes. Each memory cell has two important attributes: </li></ul><ul><ul><li>address or location </li></ul></ul><ul><ul><li>contents or value, which is represented digitally as a binary number </li></ul></ul><ul><li>Main memory is referred to as random-access memory (RAM) because its cells can be accessed in any order. </li></ul><ul><li>RAM is housed in integrated circuits which require power to retain its contents, thus RAM is volatile. </li></ul>00101001 0010011010 Address Contents Conversion from base 2 to base 10: 101001 2 = 1x2 5 + 0x2 4 + 1x2 3 + 0x2 2 + 0x2 1 + 1x2 0 = 32 + 0 + 8 + 0 + 0 + 1 = 41 10
  6. 6. Secondary Storage <ul><li>provide storage capacity in addition to the main memory </li></ul><ul><ul><li>common secondary storage devices: hard disk, floppy disk, compact disk, magnetic tape, CD-ROM, etc. </li></ul></ul><ul><ul><li>advantages: much larger capacity, non-volatile memory </li></ul></ul><ul><ul><li>disadvantages: slower access time (due to mechanical movement) </li></ul></ul>
  7. 7. Computer Networks <ul><li>Local Area Networks (LAN) </li></ul><ul><ul><li>LAN connects computers and other devices closely located together (in a building) by cable </li></ul></ul><ul><ul><li>Advantage: sharing of information and resources, such as files, secondary storage devices, printers, scanners, etc. </li></ul></ul><ul><ul><li>91.166 lab use PC's connected in a LAN that share printers and a file server with all system software. </li></ul></ul><ul><li>Wide Area Networks (WAN) </li></ul><ul><ul><li>WAN connects many individual computers and LAN’s over a large geographic area </li></ul></ul><ul><ul><ul><li>communications over intermediate distances use phone lines </li></ul></ul></ul><ul><ul><ul><li>long-range communications use either phone lines or microwave signals that can be relayed by satellite </li></ul></ul></ul><ul><ul><li>the best known WAN is the INTERNET, which connects many university, corporate, government and public-access network. INTERNET is the descendant of the computer network designed by the U.S. Defense Department’s 1969 ARPAnet project. </li></ul></ul>
  8. 8. Input /Output Devices <ul><li>Allow for communication between computers and the outside world, transforming information from different non-digital forms into digital form, and vice-versa. </li></ul><ul><li>Examples of common input devices : </li></ul><ul><ul><li>keyboard: converts each key or key combinations to digital codes </li></ul></ul><ul><ul><li>pointing devices: mouse, track balls, touch pads, etc. </li></ul></ul><ul><ul><li>scanner: converts an image to a grid of pixels. </li></ul></ul><ul><li>Examples of common output devices : </li></ul><ul><ul><li>monitors </li></ul></ul><ul><ul><li>printers </li></ul></ul><ul><ul><li>speakers for audio output. </li></ul></ul>
  9. 9. Computer Software <ul><li>Two main types of components of a computer system: </li></ul><ul><ul><li>Hardware : physical devices </li></ul></ul><ul><ul><li>Software : computer programs </li></ul></ul><ul><li>Software classification according to its role and purpose: </li></ul><ul><ul><li>Operating system (OS) : software responsible for directing all computer operations and managing all computer resources (hardware and software). OS works closely with the computer hardware. </li></ul></ul><ul><ul><li>Application software : software used for a specific task such as word processing, database management, environments for developing user programs, spreadsheets, etc. The applications are running on top of the OS using its services, and therefore must be compatible with it. </li></ul></ul><ul><ul><li>User Programs : developed by the users with the help of specialized application software. Run on top of the OS. </li></ul></ul>
  10. 10. Operating Systems <ul><li>Example of OS responsibilities: </li></ul><ul><ul><li>Communicating with the computer user: receiving commands and carrying them out or rejecting them with an error message </li></ul></ul><ul><ul><li>Managing allocation of memory, of processor time, and of other resources for various tasks </li></ul></ul><ul><ul><li>Collecting input from the input devices and providing this information to the currently running program </li></ul></ul><ul><ul><li>Conveying program output to the screen, printer or other output devices </li></ul></ul><ul><ul><li>Reading/writing data from/to secondary storage. </li></ul></ul><ul><li>Widely used Operating Systems </li></ul><ul><ul><li>Unix, Linux, MS-DOS, OS/2, VMS, Macintosh OS, Windows 98, Windows NT </li></ul></ul>
  11. 11. Computer Languages <ul><li>Machine language </li></ul><ul><ul><li>A collection of binary instructions understood by a given type of CPU </li></ul></ul><ul><ul><li>Non-standard; low-level of detail related to the given hardware </li></ul></ul><ul><ul><li>Very hard to understand by human programmers </li></ul></ul><ul><ul><li>In order to be executed, any program must have been previously translated into machine language. </li></ul></ul><ul><li>Assembly language </li></ul><ul><ul><li>Mirrors closely a given machine language, only more readable by humans: uses mnemonics for instruction codes and names for variables </li></ul></ul><ul><li>High-level languages </li></ul><ul><ul><li>Closer to the human way of expression, using higher-level of abstraction concepts from the application area for which it is intended </li></ul></ul><ul><ul><li>Mostly standardized, thus independent of a given hardware. </li></ul></ul><ul><ul><li>The downside: computers do not understand high-level languages. </li></ul></ul><ul><ul><li>Need a compiler to convert programs written in high-level languages into machine language. </li></ul></ul>
  12. 12. Example: Adding two numbers together <ul><li>Suppose the two numbers we want to add are stored in </li></ul><ul><li>memory locations 137 and 138, and we want to store the </li></ul><ul><li>result in memory location 139. </li></ul><ul><li>The following instructions need to be executed by the CPU: </li></ul><ul><li>Fetch the contents of memory location 137 and store it in a register in the ALU </li></ul><ul><li>Fetch the contents of memory location 138 and add it to the contents of the register </li></ul><ul><li>Store the contents of the register in memory location 139 </li></ul>
  13. 13. Example: Adding two numbers together <ul><li>The machine language code to do this is: </li></ul><ul><ul><li>00110101 10001001 00000001 </li></ul></ul><ul><ul><li>10010101 10001010 00000001 </li></ul></ul><ul><ul><li>01000010 00000001 10001011 </li></ul></ul>opcodes operands
  14. 14. Example: Adding two numbers together <ul><li>The assembly language code to do this is: </li></ul><ul><ul><li>LOAD $137, R1 </li></ul></ul><ul><ul><li>ADD $138, R1 </li></ul></ul><ul><ul><li>STORE R1, $139 </li></ul></ul><ul><li>With assembly language it is also possible to assign labels </li></ul><ul><li>to memory locations. If A is a label for location 137, B is </li></ul><ul><li>a label for location 138, and C is a label for location 139, the </li></ul><ul><li>assembly language code can be written as </li></ul><ul><ul><li>LOAD A, R1 </li></ul></ul><ul><ul><li>ADD B, R1 </li></ul></ul><ul><ul><li>STORE R1, C </li></ul></ul>
  15. 15. Example: Adding two numbers together <ul><li>High-level languages were developed to simplify programming. </li></ul><ul><li>To add two numbers in C++, the programmer uses the expression </li></ul><ul><ul><li>c = a + b; </li></ul></ul><ul><li>Similar expressions are used in other programming languages </li></ul><ul><ul><li>FORTRAN </li></ul></ul><ul><ul><ul><li>C = A + B </li></ul></ul></ul><ul><ul><li>APL </li></ul></ul><ul><ul><ul><li>C  A + B </li></ul></ul></ul><ul><ul><li>COBOL </li></ul></ul><ul><ul><ul><li>ADD A TO B GIVING C. </li></ul></ul></ul>
  16. 16. High-Level Languages

×