Download presentation
Presentation is loading. Please wait.
Published byAdelia Spencer Modified over 9 years ago
1
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic
2
2 Definitions Computer Computer Machine that processes data to produce a desired result (output). Machine that processes data to produce a desired result (output). Very rapid execution of very simple instructions. Very rapid execution of very simple instructions. Computer program Computer program The instructions required to achieve a desired end result. The instructions required to achieve a desired end result.
3
3 Computer Hardware The physical components of a computer The physical components of a computer Electronic, Magnetic or Mechanical Electronic, Magnetic or Mechanical System - a set of hardware devices connected to make a functional computer. System - a set of hardware devices connected to make a functional computer. Computers are a set of switches Computers are a set of switches Mechanical Mechanical Electro-mechanical Electro-mechanical Electronic (transistors) Electronic (transistors) Integrated Circuits Integrated Circuits
4
4 Binary Encoding Binary is base 2 Binary is base 2 Switches can easily encode binary data Switches can easily encode binary data eg on=1, off=0 eg on=1, off=0 Binary Counting Binary Counting DecimalBinary 0 0 1 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000
5
5 Bits & Bytes 1 binary digit is a bit 1 binary digit is a bit Bits are physically arranged in groups of 8 called Bytes This is the basic unit of computer memory. Bits are physically arranged in groups of 8 called Bytes This is the basic unit of computer memory. 00010000100000000000100011111111 1 8 128 255
6
6 Bits & Bytes (cont.) One byte can encode an integer from 0-255 One byte can encode an integer from 0-255 1024 Bytes = 1 Kilobyte 1024 Bytes = 1 Kilobyte 1024 Kilobytes = 1 Megabyte 1024 Kilobytes = 1 Megabyte 00010000 10000000 00001000 11111111 1 8 128 255
7
7 Hardware Components Central Processing Unit (CPU) Central Processing Unit (CPU) Memory (RAM) Memory (RAM) Random Access Random Access Volatile Volatile Data stoarage devices Data stoarage devices Hard disk, floppy disk, tape, CD-ROM etc. Hard disk, floppy disk, tape, CD-ROM etc. Input devices Input devices Keyboard, mouse, etc. Keyboard, mouse, etc. Output devices Output devices Monitor, printer, speakers etc. Monitor, printer, speakers etc.
8
8 Hardware System RAM CPU Storage Input Device Output Device
9
9 Computer Program Set of instructions for CPU Set of instructions for CPU "Switch Settings" "Switch Settings" Machine language Machine language Assembly language Assembly language Mmnemonics representing binary code Mmnemonics representing binary code Assembler Assembler 3rd Generation Languages 3rd Generation Languages "High Level" "High Level" Compiled or Interpreted Compiled or Interpreted
10
10 High Level Languages (3GL) Examples FORTRAN FORTRAN COBOL COBOL Pascal Pascal C C++ C++ Java Java
11
11 Interpreted Language Source Code Interpreter Machine Code Storage CPU/memory Program Execution
12
12 Compiled Language Source Code Compiler Storage CPU/memory Machine Code (executable binaries) Program Execution
13
13 Interpreted vs Compiled Interpreted Interpreted Easy to develop (can be modified and executed in one stage). Easy to develop (can be modified and executed in one stage). Distribution requirements (distribution of interpreter may be cumbersome and/or expensive). Distribution requirements (distribution of interpreter may be cumbersome and/or expensive). Machine code generated at runtime - processing overhead. Machine code generated at runtime - processing overhead. Compiled Compiled Development more cumbersome (compilation required when modified) Development more cumbersome (compilation required when modified) Easy to distribute (ie machine code is distributed) Easy to distribute (ie machine code is distributed) Machine code generated at compile time - much more efficient. Machine code generated at compile time - much more efficient.
14
14 Layers of Software Hardware Operating System Application eg Word, Excel, Netscape etc. eg Windows, Unix, MacOS etc. eg PC, Macintosh etc.
15
15 Operating System Provide basic services that access hardware Provide basic services that access hardware Input and Display Input and Display i/o - eg disk filing system, communications etc i/o - eg disk filing system, communications etc User administration, security etc User administration, security etc Provide user interface Provide user interface Provide programmers with an API (Application Programming Interface) Provide programmers with an API (Application Programming Interface) Examples: Examples: MS Windows 95/98/ME MS Windows 95/98/ME MS Windows NT/2000/XP MS Windows NT/2000/XP Macintosh OS X Macintosh OS X Linux (Unix) Linux (Unix) Solaris (Unix) Solaris (Unix)
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.