๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐“ก๐“ธ๐“ธ๐“ถ5: ๐’ฆ๐‘œ๐“‡๐‘’๐’ถ ๐’ฐ๐“ƒ๐’พ๐“‹/Computer Architecture(COSE222)

(6)
[์ปดํ“จํ„ฐ๊ตฌ์กฐ] CH4. RISC-V & RISC-V Instruction #3 Branch ๊ณ„์‚ฐ๊ธฐ์™€ ๋‹ค๋ฅธ ์ปดํ“จํ„ฐ์˜ ์žฅ์ ์€ ์–ด๋–ค ์˜์‚ฌ๊ฒฐ์ •์„ ํ•  ์ˆ˜ ์žˆ๋Š” ๋Šฅ๋ ฅ์ด ์žˆ๋‹ค๋Š” ๊ฒƒ! ์ปดํ“จํ„ฐ๋Š” ์ƒํ™ฉ์— ๋”ฐ๋ผ์„œ ๋‹ค๋ฅธ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค. high-level language๋กœ 'if/else, case, while, for loops' ๋ฌธ๋“ค์ด ๋ฐ”๋กœ ์กฐ๊ฑด๋ถ€ ์ฝ”๋“œ(Conditionally execute code) ์ž„! ์›๋ž˜ PC(Program Counter)๋Š” instruction์„ ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด์„œ ํ•œ ๋ช…๋ น์ด ๋๋‚˜๋ฉด 4์”ฉ ์ฆ๊ฐ€ํ•œ๋‹ค (๊ฐ ๋ช…๋ น ํฌ๊ธฐ๊ฐ€ 4 byte์ž„ ใ…‡ใ…‡) Branch Instruction์€ ์ฝ”๋“œ๋ฅผ ์ค‘๊ฐ„์— ๋›ฐ์–ด ๋„˜๊ฑฐ๋‚˜, ์ด์ „ ์ฝ”๋“œ๋กœ ๋Œ์•„๊ฐˆ ์ˆ˜ ์žˆ๊ฒŒ๋” PC๋ฅผ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น! Branch Instruction์—๋Š” ๋‘ ์ข…๋ฅ˜๊ฐ€ ์žˆ์Œ Conditional branch..
[์ปดํ“จํ„ฐ๊ตฌ์กฐ] CH4. RISC-V & RISC-V Instruction #2 CPU and Memory 1. ์™œ CPU๊ฐ€ memory์— ์ ‘๊ทผํ•ด์•ผ ํ•˜๋Š”๊ฐ€! ์ฒ˜์Œ์—” ๋ชจ๋“  ์ฝ”๋“œ์™€ ๋ฐ์ดํ„ฐ๋“ค์ด ๋ฉ”์ธ ๋ฉ”๋ชจ๋ฆฌ์— ์ €์žฅ๋˜์–ด ์žˆ๋‹ค CPU๋Š” ์ด ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„œ ๋ฉ”์ธ ๋ฉ”๋ชจ๋ฆฌ์— access(read/write) ํ•ด์•ผ ํ•œ๋‹ค. ์ •๋ฆฌํ•˜์ž๋ฉด access ํ•˜๋Š” ๋ชฉ์ ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋‘ ์ด์œ ๊ฐ€ ์žˆ๋‹ค. Instruciton read : CPU๊ฐ€ memory๋กœ ๋ถ€ํ„ฐ instructions์„ ์ฝ๋Š”๋‹ค Data read/write : CPU๊ฐ€ memory๋กœ ๋ถ€ํ„ฐ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ๊ฑฐ๋‚˜, memory์— ๋ฐ์ดํ„ฐ๋ฅผ ์“ด๋‹ค. 2. Instruction Access(Read) CPU๋Š” ๋ฉ”์ธ ๋ฉ”๋ชจ๋ฆฌ์—์„œ instruction ์„ ์–ด๋–ป๊ฒŒ ์ฝ์–ด๋“ค์ด๋Š”๊ฐ€ ๋ชจ๋“  CPU๋Š” ํ˜„์žฌ ์‹คํ–‰์ค‘์ธ instruction์˜ ์œ„์น˜, ์ฃผ์†Œ๋ฅผ ๊ณ„์† ์ถ”์ ํ•˜๋Š” ํŠน..
[์ปดํ“จํ„ฐ๊ตฌ์กฐ] CH4. RISC-V & RISC-V Instruction #1 CISC VS RISC - CISC (Complex Instruction Set Computer) ํ•˜๋‚˜์˜ instruction์ด ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ณต์žกํ•œ ์ž‘์—…์„ ํ•จ ex. move in x86 instruction์˜ ๊ธธ์ด๊ฐ€ ๊ฐ€๋ณ€์  ex. x86(Intel, AMD), Motorola 68k - RISC (Reduced Instruction Set Computer) ๊ฐ instruction์ด ํ•˜๋‚˜์˜ ์ž‘์€(unit) ์ž‘์—…๋งŒ ํ•จ. ex. add, lw, sw, beq instruction์˜ ๊ธธ์ด๊ฐ€ ๊ณ ์ •๋จ Load/Store Architecture ex. RISC-V, ARM, MIPS ์‚ฌ์‹ค ์ด ๊ทธ๋ฆผ์ด ์™œ ์—ฌ๊ธฐ ๊ทธ๋ ค์ ธ ์žˆ๋Š”์ง€ ํ–ˆ๋Š”๋ฐ ์ผ๋‹จ ์žˆ์œผ๋‹ˆ๊นŒ ์„ค๋ช…์„ ํ•ด๋ณด๋„๋ก ํ•˜์ฃ  ์˜ˆ๋ฅผ ๋“ค์–ด COPY๋ผ๋Š” ๋ช…๋ น์„ ์ˆ˜ํ–‰ํ•œ๋‹ค๊ณ  ์น˜์ž. he..
[์ปดํ“จํ„ฐ๊ตฌ์กฐ] CH3. Performance
[์ปดํ“จํ„ฐ๊ตฌ์กฐ] CH2. Instructions and High-level to Machine Code Abstraction ; ์ถ”์ƒํ™” " ๋ณต์žกํ•œ ์ž๋ฃŒ, ๋ชจ๋“ˆ, ์‹œ์Šคํ…œ ๋“ฑ์œผ๋กœ๋ถ€ํ„ฐ ํ•ต์‹ฌ์ ์ธ ๊ฐœ๋… ๋˜๋Š” ๊ธฐ๋Šฅ์„ ๊ฐ„์ถ”๋ ค ๋‚ด๋Š” ๊ฒƒ " Instruction set architecture (ISA) : ํ•˜๋“œ์›จ์–ด์™€ Low-level ์†Œํ”„ํŠธ์›จ์–ด ๊ฐ„์˜ abstraction interface ํ˜„์‹ค์—์„œ ๋”ฐ์ง€๋ฉด ๊ธฐ๊ณ„๋ฅผ ์šด์ „ํ•˜๋Š” ์‚ฌ์šฉ์ž์—๊ฒŒ ์ œ๊ณตํ•˜๋Š” '์ฐจ'๋ผ๋Š” abstraction layer ๊ฐ™์€.. Abstractions in Computer Programming using APIs : API๋ฅผ ์ด์šฉํ•ด ํ”„๋กœ๊ทธ๋ž˜๋ฐ Operating Sytems : ์šด์˜์ฒด์ œ, APIs๋ฅผ ์ œ๊ณต Instruction Set Architecture (ISA) : Assembly language or Machine language Hardware Imple..
[์ปดํ“จํ„ฐ๊ตฌ์กฐ] CH1. Computer and Technology 1. Classes of Computers ; ์ปดํ“จํ„ฐ์˜ ๋ถ„๋ฅ˜ 1) Personal computers(PC) : ๊ฐœ์ธ์šฉ ํ”ผ์”จ ์ผ๋ฐ˜์ ์ธ ๋ชฉ์  ๋ฐ์Šคํฌํƒ‘, ๋…ธํŠธ๋ถ, ๋žฉํƒ‘, ๋„ท๋ถ(?) 2) Servers ์—ฌ๋Ÿฌ ์œ ์ €๋“ค๋กœ ๋ถ€ํ„ฐ ๋” ํฐ ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰์‹œํ‚ด ๋Œ€๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•ด ์ ‘๊ทผ ํฐ ์šฉ๋Ÿ‰, ์ข‹์€ ์„ฑ๋Šฅ๊ณผ ์•ˆ์ •์„ฑ ์ž‘์€ ์„œ๋ฒ„๋ถ€ํ„ฐ ๋นŒ๋”ฉ ํฌ๊ธฐ๊นŒ์ง€ ๋‹ค์–‘ํ•จ High-end : ์Šˆํผ ์ปดํ“จํ„ฐ๋‚˜ ๋ฐ์ดํ„ฐ ์„ผํ„ฐ์šฉ, ํ…Œ๋ผ๋ฐ”์ดํŠธ์˜ ๋ฉ”๋ชจ๋ฆฌ์™€ ํŽ˜ํƒ€๋ฐ”์ดํŠธ์˜ ์ €์žฅ์šฉ๋Ÿ‰์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ˆ˜๋ฐฑ ์ˆ˜์ฒœ๊ฐœ์˜ ํ”„๋กœ์„ธ์„œ๋“ค๋กœ ๊ตฌ์„ฑ๋จ Low-end : ์ž‘์€ ํšŒ์‚ฌ๋‚˜ ์›น ์„œ๋น™์šฉ 3) Embedded computers -> ํŠน๋ณ„ํ•œ ๋ชฉ์ ์œผ๋กœ ๋งŒ๋“ค์–ด์ง€๋Š”! ์–ด๋–ค ํŠน์ •ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‹คํ–‰์‹œํ‚ค๊ธฐ ์œ„ํ•œ ์ปดํ“จํ„ฐ๋ž„๊นŒ ex) GPS navigator, robots, car.... 2. ..