Introductionx - Kutztown University

Download Report

Transcript Introductionx - Kutztown University

Computer Science I
CSC 135
Professor John Carelli
Kutztown University
Computer Science Department
Computer Basics
Hardware
• CPU (central processing unit) – the “brains”
• Memory – where information is stored
• IO – input/output devices – for human interaction
Software
• Computer Instructions – “programs”
• OS (operating system)
• Handles required “low level” tasks, provides a convenient interface for humans
• Application programs
• Human accessible - written for specific tasks
Professor John Carelli
Kutztown University
Computer Science Department
Modern computer, basic architecture
Inputs
Central Processing Unit (CPU)
Outputs
Internal Memory
Registers
Control Unit (CU)
Main Memory*
Program
Data
Inputs
Keyboard, mouse, ...
Outputs
Monitor, printer, ...
Secondary Storage
Disk drive, USB stick, ...
(permanent/long term)
Arithmetic/Logic Unit (ALU)
Secondary Storage
Professor John Carelli
Kutztown University
* shared program/data memory
(Von Neumann)
Computer Science Department
Modern Computer
H
DRAM
Hard Drive
CPU
Professor John Carelli
Kutztown University
Computer Science Department
Binary Coding
Counting in Binary
0
0
1
1
2
10
3
11
4
100
5
101
6
110
• It’s easier to make electronic circuits with 2 states rather
than 10
7
111
8
1000
• Circuit only has to be “off” for zero or “on” for one – basically, a
switch!
• Works well with transistors (also with vacuum tubes or relays)
9
1001
10
1010
• Binary is base 2 coding (vs. Decimal, which is base 10)
• Base 10 has 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
• Base 2 has only 2 “bits”: 0, 1
• Bits is short for “binary digits”
• Why?
Professor John Carelli
Kutztown University
Computer Science Department
Memory
Address
Contents
00000000 (0)
00000101 (5)
• Stores instructions and data
• Every memory location has a
numerical address
• Contents are coded and stored
in Binary format (ex: ascii)
00000001 (1)
00000011 (3)
00000010 (2)
01110100 (J)
00000011 (3)
00111101 (=)
00000100 (4)
10010111 (a)
00000101 (5)
00000111 (7)
00000110 (6)
01100111 (C)
• Binary: “base 2” (next slide)
00000111 (7)
00001001 (9)
00001000 (8)
00110101 (#)
00101101 … 10110110
Bit
Byte
Word
Professor John Carelli
Kutztown University
Computer Science Department
High Level Languages
• Binary coded instructions/programs
• Called “machine code”
• Low level (many steps to accomplish simple tasks)
• Arcane – difficult to work with
• Led to development of higher level languages
•
•
•
•
•
C, C++, FORTRAN, Basic, Java, …
Portable (same on any machine architecture)
User friendly, intuitive -> A=A+B
But, needs to be translated or “compiled” into machine code
Used extensively for application software development
Professor John Carelli
Kutztown University
Computer Science Department
Operating Systems
• Designed for high level operation – two primary goals…
• Handles general computer management tasks
• Provides a friendly interface for human interaction
• Built-in OS programs
• Allow a user to perform useful tasks like:
• Open, save, move, copy a file
• Print information
• OS Examples
• Windows, Mac OS, Android, Unix/Linux, …
Professor John Carelli
Kutztown University
Computer Science Department
Operating Systems, Windows and Unix
• Microsoft™ Windows
• Standard OS for PC’s
• GUI based, (originally built on DOS)
• GUI: Graphical User Interface
• Unix (used in this course)
•
•
•
•
Command based
Originally developed at Bell Labs™, written in C
Used extensively in science, engineering, networking
Linux is an open-source variant
Professor John Carelli
Kutztown University
Computer Science Department
Application programs
• Special programs installed on the computer to accomplish specific
tasks
• Developed independently (not part of OS)
• Examples:
• Word processors, spreadsheets, presentations
• This course will focus on developing programs using Unix and C++
Professor John Carelli
Kutztown University
Computer Science Department
Software development method
• Specify the problem requirements
• Analyze the problem
• develop a strategy to address it
• Design an algorithm (recipe) to solve the problem
• Implement the algorithm
• Write/develop the program!
• Test and verify the completed program
• Maintain and update the program
Professor John Carelli
Kutztown University
Computer Science Department
Steps in programming
1. Write the program
• Create a text file (Source File) in the programming language (emacs)
2. “compile” the program
• Translate the source file into machine recognizable object code in an Object File
• Using a “Compiler” (g++)
3. “link” the object code together with any other necessary Object Files
• Other Object Files may come from other Source Files or generic libraries
• Using a linker (g++)
• Creates an Executable File (can be run, or executed, on the computer)
4. “load” (run) the Executable File
• Uses a Loader to actually load and run the program
Professor John Carelli
Kutztown University
Computer Science Department
Program Development
1. Write the program
• Create Source File
2. “compile” the program
• Generate an Object File
3. “link” Object Files, as needed
• Create an Executable File
4. “load” (run) the Executable File
Professor John Carelli
Kutztown University
Computer Science Department
Professional Ethics
• Privacy and Misuse of Data
• Computer Hacking
• Plagiarism and Software Piracy
• Misuse of a Computer Resource
CSIT Academic Integrity Policy document
• Located on the Computer Science and Information Technology Department
home page at:
https://www.kutztown.edu/csit
Professor John Carelli
Kutztown University
14
Computer Science Department