컴퓨터 구조 01 : 개요

LeeWonjin·2022년 10월 22일

[학부]컴퓨터구조

목록 보기
1/5

개요

MIPS

means

  • Unit : Millions instruction per second
  • Company name
  • Name of CPU family (like Intel, AMD)

Level of Code, Language

application software
System software
Hardware
  • Code
    • assembly language : Textual representation of machine instructions. (It is used because humans can't recognize the machine language)
    • Hardware representation : bits ( instructions , data )
  • compiler
    • high-level lang ---> assembly lang
    • Different CPU has the different compiler.
  • assembler
    • assembly lang ---> machine lang
    • Different CPU has own machine instructions, assembler

Class

  • Personal computers
  • Server computers
  • Super computers : Type of server. very small portion.
  • Embedded computers

PostPC Era

  • The number of devices
    • 2007 : cell phone, PC, smart phone, tablet
    • 2018 : smart phone, cell phone, PC, tablet
  • PMD : Persnal Mobile Divice
  • Cloud computing (WSC, SaaS)

Sizes

  • Decimal Term : KB(10^3), MB(10^6), GB(10^9), TB, PE, ZE, ..., QB(10^30)
  • Binary term : KiB(2^10), MiB(2^20), GiB(2^30), TiB, PiB, ZiB, ..., QiB(2^100)
    ** KiB = kibibyte = ki - binary - byte

구성요소

CPU

  • Datapath (다른 책의 표현으로 ALU) : 데이터에 대해 작업
  • Control
  • Cache memory : 데이터에 즉시 접근가능한 작고 빠른 SRAM

Memory

  • Volatile main memory (primary memory) : 비싸고 빠름 e.g., DRAM
  • Non-volatile secondary memory : 싸고 느림
    • magnetic disk
    • flash memory
    • optical disk

Network

LAN(Ethernet), WAN(Internet), wireless network(WiFi, Bluetooth)

Semiconductor

die는 chip과 유사한 말. (웨이퍼에 난 패턴을 따라 조각낸 것)
300mm wafer = 12inch wafer

  • Tech : Vaccum tube - Transistor - IC - VLSI - ULSI
  • Manufacturing ICs
    1. Silicon ingot --- (slicer) ---> Blank wafers
    2. Blank wafers --- (여러 공정) ---> Patterned wafers
    3. Patterned wafers --- (테스트) ---> Tested wafers
    4. Tested wafers --- (dicer) ---> Tested dies
    5. Tested dies --- (패키지에 다이 붙이기/테스트) ---> Tested packaged dies
  • IC Cost
    • Cost per die = Cost per waferDies per wafer×Yield\frac{Cost\ per\ wafer}{Dies\ per\ wafer \times Yield}
    • Dies per wafer ≒ Wafer areaDie area\frac{Wafer\ area}{Die\ area}
    • Yield = 1/(1+(Defects per area×Die area2))21 / (1+(Defects\ per\ area\times\frac{Die\ area}{2}))^2
      → Yield(수율)는 한 웨이퍼에서 몇퍼센트의 Die가 테스트를 통과했는지 의미 (전부 정상이면 1)

ISA

ISA : Instruction set architecture

instruction set determines Computer Architecture

  • 만약 Intel instruction set을 갖고있다면 Intel CPU만 쓸 수 있다.
  • (다른 제품군에서는 안돌아가니까)

ISA는 하드웨어-소프트웨어의 인터페이스이다.

Performance

성능은 실행 시간(Execution Time)으로 측정한다. 실행 시간이 작을 수록 성능이 좋다고 평가한다.
기술적으로(엄밀히) 말하는 '시간'은 CPU time으로, I/O 등은 제외한 순수한 작업 시간이다.

Clock

클럭은 컴퓨터에서 시간의 표현 방법이다.

  • Clock Cycle : 반복되는 Clock의 단위 (5사이클 : 클럭의 5번 반복)
  • Cycle Time(Clock period) : 한 사이클 도는 시간
  • Clock rate(Clock frequency) : 초당 클럭 사이클 횟수

Cycle Time과 Clock rate는 아래와 같은 관계이다.

  • Cycle Time=1Clock rateCycle\ Time = \frac{1}{Clock\ rate}
  • 예시 : Cycle Time=250ps이면 Clock rate = 1250×1012\frac{1}{250\times{10^{12}}} = 1000250×109\frac{1000}{250\times{10}^{9}} = 4GHz

음의 지수승 단위는 다음과 같다.

  • 1 s = 10310^{3} ms = 10610^6 ㎲ = 10910^9 ns = 101210^{12} ps

CPU Time

= Cycles×Cycle Time{Cycles} \times {Cycle\ Time} = (싸이클 몇 번 돌았냐) x (한 싸이클 몇 초 걸리냐)
= Cycles/Clock rate{Cycles} / {Clock\ rate} = (싸이클 몇 번 돌았냐) / (초당 사이클 몇 번 도냐)

이 때, Cycles=Instruction Count×(CPI:Cycles per instruction){Cycles = {Instruction\ Count}\times{(CPI:Cycles\ per\ instruction)}} 이므로
= (Instruction Count×CPI)×Cycle Time({Instruction\ Count}\times{CPI})\times{Cycle\ Time}
= (Instruction Count×CPI)/Clock rate({Instruction\ Count}\times{CPI})/{Clock\ rate}

정리하면 아래와 같다. 성능을 결정하는 세 개의 요인이 있다.
CPU Time=SecondsProgram=InstructionsProgram×CyclesInstructions×SecondsCyclesCPU\ Time = \frac{Seconds}{Program} = \frac{Instructions}{Program}\times\frac{Cycles}{Instructions}\times\frac{Seconds}{Cycles}

그 외 요소

  • Power = Capacity load×Voltage2×FrequencyCapacity\ load \times Voltage^2 \times Frequency
  • Uniprocessor (Multiprocessors)
    • require explicitly paralell programming : 한 번에 여러 instruction실행

Pitfalls

Amdahl's Law

프로그램의 일부를 N만큼 개선했다고 해서 전체 프로그램이 N만큼 개선되는 것은 아니다.

Timproved=Taffectedimprovement factor+TunaffectedT_{improved} = \frac{T_{affected}}{improvement\ factor}+T_{unaffected}

예를 들어 전체 성능의 20%를 좌우할 수 있는 코드 실행시간을 10초에서 5초로 단축시켰다고 하자.

  • 이 때 전체적으로 얼마나 시간이 단축되는지 보면
    → (5초/10초)*(20%) + 80% = 10%+80% = 90%
  • 따라서 특정 부분에서는 50% 단축되었지만, 전체로 보면 10%만 단축되었다.

그러므로 common case를 개선하는 것이 그 밖의 것보다 중요하다.

MIPS as a Performance Metric

MIPS는 '초당 백만 개의 인스트럭션 실행'이라는 단위이다.
이 단위는 각 인스트럭션이 얼마나 복잡한가를 고려하지 않았기에 다른 ISA를 비교하는 척도가 될 수 없다.

(예시)
아래 예시를 살펴보면 10초동안 A는 5개, B는 10개를 실행한다. 단순 MIPS로 비교하면 A가 월등한 성능이지만, 결과물과 소요시간은 같을 수 있다.

  • A CPU의 한 개 인스트럭션은 2초가 걸리고 많은 일을 한다.
  • B CPU의 한 개 인스트럭션은 1초가 걸리고 적은 일을 한다.

(MIPS의 실체 검증하기)
MIPS = instrunction count×106Execution time\frac{instrunction\ count\times{10^{-6}}}{Execution\ time}
여기서 Execution Time = CPU Time = instrunction count×CPIClock rate\frac{instrunction\ count\times CPI}{Clock\ rate} 이므로

MIPS=Clock rateCPI×106MIPS = \frac{Clock\ rate}{CPI} \times 10^{-6}

CPI는 CPU마다 다르다. 따라서 MIPS는 만능 척도가 아니다.
진정한 척도는 '실행시간'이다.

Fallacy

cpu load정도에 따라 파워 소모량이 꼭 비례하지는 않는다.
100% load일 때 500W를 소모한다고 해도
50% load일 때 250W가 아닌 400W일 수도 있다.

profile
노는게 제일 좋습니다.

0개의 댓글