1장 CPU는 무슨 일을 하는가?
모든 정보를 컴퓨터로 처리할 수 있다
- The word 'computer' comes from compute(계산하다) -> 초기 컴퓨터는 계산기였다.
- 현대의 컴퓨터는 디지털화 된 정보들(음성, 화상 등)을 계산할 수 있다.
컴퓨터의 중심은 CPU
- CPU: Central Processing Unit
- 0과 1을 이용해 주로 연산을 한다. -> 논리연산, 산술연산
-산술연산: +, - (최근의 CPU는 FPU의 기능도 있어 곱셈과 나눗셈도 가능)
-논리연산: And, or, not
컴퓨터의 5대 장치
- 입력장치: 외부에서 데이터를 입력받는 장치.
- 출력장치: 데이터를 외부로 출력하는 장치.
- 연산장치(Part of CPU): 연산, 계산을 하는 장치. 연산할 때 메모리(기억장치)와 데이터를 주고받음.
- 기억장치: Stores data&programs.
- 제어장치(Part of CPU): 프로그램나머지 장치들에 지시를 내리는 장치.
CPU의 중심은 ALU
- ALU(Arithmetic Logic Unit): 산술논리장치, 산술연산, 논리연산을 한다.
- 스테터스에 따라 CPU가 이후의 행동을 판단한다. (CPU는 판단도 할 줄 알아요! 똑똑한 친구.)
-What's status? Let's say you're using an ATM machine to withdraw money from your bank account. When you try to withdraw $3 and you have $10 in your account, CPU will compute 10 - 3 = ? where 10 and 3 are input A and B and subtraction is command F. Status in this case will be positive number. What if you want to withdraw $15? 10 - 15 = ? and the status will be negative and the machine will not dispense any money.