CS 54

Programming Exercise: Lab #1

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Encoding errors▶ 운영체제별로 줄 바꿈 문자를 채택한 게 다르다.CR (Carriage Return, \r): 커서가 해당 라인의 젤 앞쪽으로 이동 e.g., Mac OS (클래식 버전)LF (Line Feed, \n): 커서는 그대로 있으면서 줄만 바꿈 e.g., Unix, Linux, Mac OS (현대 버전)CRLF (CR + LF, ENTER): 줄도 바꾸면서 커서도 제일 앞쪽으로 이동 e.g, Windows간혹 협업을 하다 보면 어떤 사람이 Mac OS에서 작업한 코드를 Windows에서 받아 실행 시키려고 하면 에러가 나는 경우가 있다.따라서, Mac에서 작성된 파일을 Windows에서 사용할 경우, “LF” or..

CS/자료구조 2025.03.25

Chapter 2: Unsorted/Sorted Lists

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.List DefinitionsLinear relationship:Each element except the first has a unique predecessor(전임자), and each element except the last has a unique successor(후임자).Length:The number of items in a list; the length can vary over time. (e.g., append, remove)Unsorted list vs Sorted list ※ 배열(Array) vs 리스트(List)C 같은 언어에서 사용하는 배열(Array)은 크기가 고정되어 있어서 한 번 선언하면 크기를 바꿀 수 없..

CS/자료구조 2025.03.23

Chapter 1: Software, Data Structure, and C++

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.What is abstraction?▶ Too abstract.▶ Too concrete(명확한).▶ Between too abstract and too concrete.AbstractionA model of a complex system that includes only the details essential to the perspective of the viewer of the system. Programs are abstractions.Tells what the program must do, but not how the program does it.Abstraction Data Type (ADT)▶ ADT A data type wh..

CS/자료구조 2025.03.22

Chapter 0: Introduction

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.What do we learn?Data StructureDataThe way to represent information in a suitable format for communication or analysis by humans or maachines. Data StructureWe should be able to properly manage a collection of data elements.Why should we learn data structure?to develop a high-quality programIt works.It can be modified without excessive time and effort.It is ..

CS/자료구조 2025.03.21

Computer Network Lecture.03 DLC

경희대학교 이성원 교수님의 컴퓨터 네트워크 수업을 기반으로 정리한 글입니다.ContentsDLC BasicSimple ProtocolStop-and-Wait ProtocolGo-Back-N ProtocolSelective Repeat ProtocolDLC Example - HDLCDLC Example - PPPDLC BasicData Link Control LayerConceptData Link layer2계층 하단부 - MAC Layer: physical한 medium을 여러명이 공유할 때 어떤식으로 효율적으로 공유할 것인가에 대한 방법2계층 상단부 - DLC Layer: physical한 layer에서 error가 발생했을 때 어떤 방법으로 검출 및 복구할 것인가에 대한 방법으로 2계층 역할에 충실D..

Lecture 20: Additional Lecture

경희대학교 김정욱 교수님의 컴퓨터 구조 수업을 기반으로 정리한 글입니다.Program vs. Process vs. Thread1. Program실행 가능한 파일들의 집합으로, 정적인 개념이다.Program은 disk에 일반적으로 저장되어 있어, 수명에는 제한이 없다.▶ Program2. Process실행중인 Program으로, 동적인 개념이다.Process는 main memory에 일반적으로 저장되어 있어, 수명에는 제한이 있다. (Process 종료 or 컴퓨터 off)▶ Process3. ThreadProcess의 가장 작은 실행 가능한 unit으로,Process 안에서 할당받은 자원을 이용하고, 실제로 작업을 수행하는 주체이다. (일꾼)Process는 일반적으로, mutiple threads를 가진..

CS/컴퓨터 구조 2024.12.15

Lecture 19: Memory Hierarchy - 3

경희대학교 김정욱 교수님의 컴퓨터 구조 수업을 기반으로 정리한 글입니다.Common Framework for Memory Hierarchy▶ cache / main memory TLB는 address를 mapping하는 정보밖에 없기 때문에, data를 포함한 캐시보다 작다. 용량이 클수록 miss rate가 낮다. 때문에 miss rate은 L1 > L2 > main memory ※ 용량 - L1: layer 1 cache Block Placement of Memory HierarchyQ1. Block이 어디에 위치할 수 있는가?▶ Direct mapped / Set associative / Fully associative ▶ Miss rate 확률 cache size가 증가할수록 miss rate 감..

CS/컴퓨터 구조 2024.12.15

Lecture 18: Memory Hierarchy - 2

경희대학교 김정욱 교수님의 컴퓨터 구조 수업을 기반으로 정리한 글입니다.Misses in Direct-Mapped Cache (Problem)Example▶ 0, 8, 0, 6, 8 address를 cache(size: 4)에 저장하는 상황0 -> cache memory의 index 0 위치에 Memory[0]에 대응되는 data 저장8 -> cache memory의 index 0 위치(switch)에 Memory[8에 대응되는 data 저장 0 -> cache memory의 index 0 위치(switch)에 Memory[0]에 대응되는 data 저장6 -> cache memory의 index 2 위치에 Memory[6]에 대응되는 data 저장8 -> cache memory의 index 0 위치(sw..

CS/컴퓨터 구조 2024.12.15

Lecture 17: Memory Hierarchy - 1

경희대학교 김정욱 교수님의 컴퓨터 구조 수업을 기반으로 정리한 글입니다.ROM vs. RAMROM (Read Only Memory)Write는 못하고 (저장 불가) Read만 할 있는 MemoryNon-volatile memory (비휘발성 메모리): 전원이 꺼져도 데이터가 없어지지 않음※ Mask ROM: 반도체 생산 공정인 마스킹 단계에서 고정된 데이터 회로 패턴으로 생산하는 방식 (책을 대량 인쇄하는 것처럼) ※ ROM은 공장에서 애초에 0과 1의 패턴들이 다 만들어져 나오기에 Write 할 수 없다.▶ ROM RAM (Random Access Memory)temporary MemoryRead-write memory: 읽고, 쓰기 둘 다 가능Volatile memory (휘발성 메모리): 컴퓨터가 ..

CS/컴퓨터 구조 2024.12.07

Lecture 16: The Processor - 5

경희대학교 김정욱 교수님의 컴퓨터 구조 수업을 기반으로 정리한 글입니다.3. Control HazardsProblemControl Hazard는 branch hazard라고도 하며, Data Hazard와 마찬가지로 pipeline시 발생하는 문제이다.즉, branch할 때 pipeline에서 발생하는 hazard가 control hazard이다.▶ Control hazard beq 조건 만족시 44, 48, 52줄의 instruction은 필요없게 된다.하지만, 이때 pipeline시 조건을 만족하면 문제가 발생한다. (조건을 만족하지 않으면 문제가 발생하지 않는다.) EX/MEM의 Zero signal에 기반하여, MEM/WB의 결과값인 branch or not (PC + 4)로 branch 여부가 ..

CS/컴퓨터 구조 2024.12.06