CISC105 General Computer Science Class 1 – 6/5/2006.
-
Upload
trevor-arnold -
Category
Documents
-
view
225 -
download
0
Transcript of CISC105 General Computer Science Class 1 – 6/5/2006.
![Page 1: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/1.jpg)
CISC105 General Computer Science
Class 1 – 6/5/2006
![Page 2: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/2.jpg)
Important Notes!
• The lab session has been moved from 040 Smith Hall to 009 Willard Hall. It will meet at the same day and time.
![Page 3: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/3.jpg)
Computer Hardware
![Page 4: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/4.jpg)
Main Memory
• Memory Cells• Address• Memory content
– Data– Program Instruction
• RAM vs. ROM – Random Access
Memory = volatile– Read Only Memory =
non-volatile
![Page 5: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/5.jpg)
Bits and Bytes
• Information stored in memory as bits
• 8 bits = 1 Byte• 1 b vs. 1 B• 1 KB = 1024 B • 1 GB = 1024 MB =
1,048,576 MB = 1,073,741,824 B
![Page 6: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/6.jpg)
Secondary Storage
• Secondary Storage is used for long term storage of programs and information
• Information is stored in Files, directories and subdirectories
![Page 7: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/7.jpg)
Central Processing Unit (CPU)
• “Brain” of the computer with 2 primary functions
– Coordinate all computer operations– Performing arithmetic and logical operations on data
• CPU follows instructions contained in a computer program
– Fetch Instruction -> Interpret Instruction -> retrieve data (if necessary) -> carry out instruction
– Uses Registers (high speed memory) to speed up retrieval
![Page 8: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/8.jpg)
Input Devices
• Input Devices - Any device used to enter information into a computer– Keyboard, Mouse, Digitizer etc.
![Page 9: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/9.jpg)
Output Devices
• Output Devices used to observe the results of the data manipulation
• Monitor, printer, etc.
![Page 10: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/10.jpg)
Computer Network
• Local Area Network (LAN) – computers and peripherals connected together in order to share resources. Usually contained in a building.– Network Printers, Scanners, secondary storage (file
servers) etc.
![Page 11: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/11.jpg)
Computer Network (WAN)
• Wide Area Network (WAN) – a network that attaches a large number of computers over a large geographic area.
• The Internet is the most well know WAN (WWW and GUI via Browser)
![Page 12: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/12.jpg)
How to connect to Networks
• Modem - Use a telephone line (modulator / demodulator) - transmit up to 50,000 bps
• Digital Subscriber Line (DSL) – uses telephone line but can have simultaneous voice communication. (~1.5 Mbps)
• Cable Internet access – uses the coax cable that is used to deliver TV to your house
![Page 13: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/13.jpg)
Computer Software
• Operating System
• Application Software
• Computer Languages
• Software Development Method
![Page 14: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/14.jpg)
Operating System
• Operating System (OS) - Collection of programs that control the interaction of the user and computer hardware
• Booting a computer – loading the OS into memory
![Page 15: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/15.jpg)
OS Responsibilities
• Communicating with the computer users
• Managing memory allocation, processor time and other resources
• Collecting input from Input devices
• Conveying output to screen, printer, etc
• Fetch data from secondary storage
• Write data to secondary storage
![Page 16: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/16.jpg)
Application Software
• Application – software used for a specific task – word processing, email, accounting, etc
• Applications are made available by installing them.
• Must be compatible with the Hardware and operating system you are using.
![Page 17: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/17.jpg)
Computer Languages
• Machine language – collection of binary numbers – Only understood by a specific CPU– Not very readable– Not standardized
• Assembly Language – mnemonic codes that correspond to machine language– Suffers from same problems as Machine
Language
![Page 18: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/18.jpg)
Computer Languages
• High-Level language– CPU independent– Combine algebraic expressions
• A compiler will translate a high-level source file into machine code
• Syntax is very important!
• Some developers use an IDE to
![Page 19: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/19.jpg)
Entering, Translating, and Running
a High-Level Language Program
![Page 20: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/20.jpg)
Flow of information during program execution
![Page 21: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/21.jpg)
Software Development Method
• PAD IT Man!– Problem Definition– Analyze the Problem– Design Algorithm– Implement the Algorithm– Test and verify the program– Maintain and Update the program
![Page 22: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/22.jpg)
Software Development Method (example)
• Problem definition: Your job requires you to convert miles to kilometers.
• Analysis: – Program input: distance in miles– Program output: distance in kilometers– Relevant Formula: 1 mile = 1.609 kilometers
![Page 23: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/23.jpg)
Software Development Method (example)
Design
1. Get the distance in miles
2. Convert the distance to kilometers1. Distance in kilometers is 1.609 times the
distance in miles
3. Display the distance in kilometersCheck the algorithm = 10 miles
times 1.609 = 16.09km
![Page 24: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/24.jpg)
Software Development Method (example)
• Implement and test
![Page 25: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/25.jpg)
Chapter 2
• C Language Elements• Variable Declaration and Data Types• Executable Statements• General Form of a C program• Formatting Numbers in Output• Interactive Mode, Batch Mode, and Data
Files• Common Programming Errors
![Page 26: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/26.jpg)
![Page 27: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/27.jpg)
Variable Declaration and Data Types
• Variable – a name associated with a memory cell whose value can change
• Variable Declaration – statements that communicate to the compiler the names of the variables in the program and the kind of information it stores.
• Data Types – a set of values and operations that can be performed on those values
![Page 28: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/28.jpg)
Executable Statements• Assignment Statements – an instruction that
stores a value or a computational result in a variable
![Page 29: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/29.jpg)
Executable Statements
![Page 30: CISC105 General Computer Science Class 1 – 6/5/2006.](https://reader034.fdocuments.net/reader034/viewer/2022052701/56649e7b5503460f94b7bb26/html5/thumbnails/30.jpg)
I/O Statements - printf
• printf is an output statement supplied by the stdio.h library
• printf is executed by running a function call– printf(“That equals %f kilometers.\n”, kms);
• Function arguments• Format String (placeholders – multiple
placeholders)• Print list• \n and the cursor