Terminology
Algorithm: A set of steps that defines how a task is performed
Program: A representation of an algorithm
Programming: The process of developing a program
Software: Programs and algorithms
Hardware: Equipment
J. G. Brookshear, Computer Science An Overview, Slides © 2007 Pearson Addison-Wesley. All rights reserved
소프트웨어 개발 방법
1. 문제의 정의
2. 문제의 요구 사항 분석 (Requirement)
3. 문제 해결 알고리즘 고안 (Analysis)
4. 알고리즘 구현 (Algorithm)
5. 프로그램 테스트 (Test)
6. 프로그램 유지 보수 (Maintenance)
Kern Koh, Computer Basics, Slides © Kern Koh 2006
소프트웨어 개발 예제
Kern Koh, Computer Basics, Slides © Kern Koh 2006
1. 정의 “마일(mile)을 킬로미터(km)로 변환하라.”
2. 요구 사항 분석 입력은 마일(mile), 출력은 킬로미터(km) 1 mile = 1.609 kilometers
3. 알고리즘 고안 마일 단위로 거리 입력 연산을 통해 마일 거리를 킬로미터로 변경 킬로미터 단위의 거리 출력
소프트웨어 개발 예제 (Cont’d)
Kern Koh, Computer Basics, Slides © Kern Koh 2006
4. 구현
5. 프로그램 테스트
/* Converts distance in miles to kilometers */#include <stdio.h> /* printf, scanf definitions */#define KMS_PER_MILE 1.609 /* conversion constant */int main(void){
double miles, kms; /* input and output */
printf(“Enter the distance in miles >”);scanf(“%lf”, &miles); /* get the distance in miles */
kms = KMS_PER_MILE * miles; /* convert the dist. to kilometers */
printf(“That equals %f kilometers.\n”, kms); /* display the results */return 0;
}
컴퓨터 소프트웨어
Kern Koh, Computer Basics, Slides © Kern Koh 2006
응용 소프트웨어사용자의 특정 목적을 달성하게 하는 소프트웨어
워드프로세서 게임 소프트웨어 데이터베이스 관리 소프트웨어 등
소프트웨어 설치 (Software Installation)CD or Internet onto Hard DiskOS or Hardware Dependency Check
컴퓨터 소프트웨어 (Cont’d)
Kern Koh, Computer Basics, Slides © Kern Koh 2006
프로그래밍 언어기계어 (Machine Language): 컴퓨터가 바로 실행 가능
이진(Binary) 코드(Code) – “Code: 암호, 규약”
CPU의 종류에 따라 다름 (Pentium, Motorolla, …)
어셈블리어 (Assembly Language) 기계어 명령어와 1:1 대응
어셈블러 (Assembler)
고급 언어 (High-Level Language) 하나의 명령문이 어셈블리어 명령문 여러 개에 해당 (예: Sin(x))
컴파일러(Compiler) 또는 인터프리터(Interpreter)
Code=(암호, 규약) 예: “Operation Code” for “+” = 001100110 (Binary Code)= ADD (Assembly Code)
ADD A B
01100110 11110011 10010111
예: “operation code”
sin(x)
a/b….
add shiftsubshift….
001 010101010….
High levelLanguage
AssemblerLanguage
MachineLanguage
SourceFile eg, my.c
Object File eg, my.obj
printf()
….
AND shiftsubadd….
111 110101010….
SourceFile
Object File
001 010101010----111 110101010
….
Executable BinaryFileeg, my.exe
cross-reference
eg, printf()
Kern Koh, Computer Basics, Slides © Kern Koh 2006
Compilation Process
Word processor
Compiler
Linker
Loader
Source File
Error Msg
Object File
Other Object File(s)
Executable File
Input Data Results
Kern Koh, Computer Basics, Slides © Kern Koh 2006
IDE (Integrated Development Environment) Editor, Compiler, Linker, Loader,
Debugger …
Kern Koh, Computer Basics, Slides © Kern Koh 2006
컴퓨터 소프트웨어 (Cont’d)
OS (Operating System)S/W That Controls the Computer or Manages
Its Resources Control User Programs
CPU(s)
Memory
Devices
Act as the Interface between the Users and the Computer
Provide Services for Programs It Runs
컴퓨터 소프트웨어 (Cont’d) 운영체제 (OS)
Hardware 자원을 관리 및 여러 작업 사이에 배분 주요 역할
사용자의 명령을 받아서 하드웨어에 전달 메모리, CPU (Central Processing Unit) 시간 등의 자원을 관리하고, 다양
한 작업에 배분 입출력 장치로부터 데이터를 읽거나 내보냄
Booting ROM 내의 소형 프로그램으로서 Disk 내의 나머지 OS를 메모리로 올림
Command Line Interface (Shell in Unix) Prompt as a short OS message: “OS is ready for input
command”
Graphical User Interface (GUI) (Icon, menu)
Kern Koh, Computer Basics, Slides © Kern Koh 2006
Multi-User vs. Single-User Linux
Protection - Yes
Resource – 最大 節約 Text mode (CUI)*
Total silent
eg, vi
Windows Protection - Little Resource – 最大 使用
Window, GUI Show everything
History State Command Option
eg, word, …
* CUI: Character User Interface - cf, GUI: Graphical User Interface
Kern Koh, Computer Basics, Slides © Kern Koh 2006
User Interface (OS)
Kern Koh, Computer Basics, Slides © Kern Koh 2006
$ _
GUI - Windows CUI - Linux
active processes(loaded into memory)
menu (Programs in disk)
manCommand
psCommand
컴퓨터 하드웨어
Input device
Output device
CPU
Main memory
Secondary storage
Kern Koh, Computer Basics, Slides © Kern Koh 2006
컴퓨터 하드웨어 (Cont’d) 메인 메모리 (Main Memory)
ROM(Non-volatile)와 RAM(Volatile) RAM이 대부분임 (both store & retrieval)
비트(bit) 정보 저장의 최소단위 (0/1) Binary digit
바이트(byte) Cell을 구성함 One character per byte (8 bit) Cell 당 byte 수 – 기계에 따라 다름
Cell Address와 Content Content: data & “stored program”
Program’s instruction main memory (실행을 위하여)
address:
cell
byte byte
bit
Kern Koh, Computer Basics, Slides © Kern Koh 2006
컴퓨터 하드웨어 (Cont’d) 2nd 저장 장치 (2nd storage device)
비휘발성, Disk drive, floppy disk, USB(flash memory) – 자성체 CD-ROM drive – read-only, read-wrtie CD - optics 기술
“File” - 디스크에 정보가 저장되는 단위 File 의 내용: program file, data file Directory (folder), subdirectory – 수많은 file 들을 디스크에 저장
Main Memory 와 2nd Storage 의 다른점 CPU 는 main memory 안의 정보만 실행 할 수 있음
디스크내 file 은 먼저 main memory 로 불러와야 CPU가 access 가능 Main memory 차별성
속도가 빠름 크기가 작음 (bit 당 가격이 디스크보다 비쌈) Volatile
Kern Koh, Computer Basics, Slides © Kern Koh 2006
컴퓨터 하드웨어 (Cont’d)
중앙 처리 장치 CPU: Central Processing Unit
대부분 연산용 회로 산술연산: 11+63
논리연산: (apple is fruit?) AND (banana is red?)
CPU 내 기억용 공간 – 빠르고 적은수 레지스터 (register)
레지스터 (register) main memory 해야 실행 Both data & instruction
Instruction fetch, Data fetch
Kern Koh, Computer Basics, Slides © Kern Koh 2006
컴퓨터 하드웨어 (Cont’d)
중앙 처리 장치
ADD A B --- instruction
1234 --- data
12 --- data
ADD A B
1234 12
연산기
registercell
Kern Koh, Computer Basics, Slides © Kern Koh 2006
컴퓨터 하드웨어 (Cont’d) 입력 장치 (Input device): 키보드, 마우스
출력 장치 (Output device): 모니터, 프린터
function keys space characters
caps lock key
shiftkey
controlkey
numeric keypad
cursorcontrol keys
enter(return) key
Kern Koh, Computer Basics, Slides © Kern Koh 2006