목록Computer Science/System Programming (7)
엔지니어가 되고 싶은 공돌이
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/JRcT2/btsL9u2s2Ja/jN1gJX3misiqVR5pAdfj4k/img.jpg)
7. 1. Flag Bit Register - Flag Bit Register는 Arithmetic Operations로 Implicit하게 설정되고, Compare Operations로 Explicit하게 설정됩니다. - t = a + b. CF: Carry O -> 1, ZF: t == 0 -> 1, SF: t 1, OF: (a > 0 && b > 0 && t 0) -> 1. - cmpl b, a ( a == b ) : a – b , 이 연산의 결과값은 저장되지 않으며, 오직 Flag Bit 세팅에만 사용됩니다. - testl b, a : a & b , CF와 OF는 0으로 두고, 나머지 2개에만 관심을 갖습니다. 7. 2. Jumping - jX instructions:..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bn2tqg/btsL8no28Ux/d4JcxrzbJQZXTRN7RxtRoK/img.jpg)
6. 1. Assembly Instruction - Moving Data Instruction: movl(source, destination) - Operand Types: Constant Integer Data / Register(주로 변수) / Memory(주로 포인터) Mem와 Mem사이의 데이터 교환은 one clock에 two instruction이기 때문에 불가능합니다. - ex) movl 12(%ebp), %ecx : %ebp +12 -> %ecx. movl (%edx, %ecx), %ebx : %edx + %ecx -> %ebx. movl (%edx, %ecx, 4), %ebx : %edx + %ecx X 4 -> %ebx. - ( )는 레지스터 내부..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/Nch6C/btsL98RnXiu/snpcdtB8jVYfyDE9ie0Tr1/img.jpg)
5. 1. Program - Program: Data와 Instructions의 집합. - CPU(Central Processing Unit) 1) PC(Program Counter): 다음 실행할 명령어의 주소를 저장. IA-32: EIP , x86-64: RIP. 2) Register File: 많은 Program Data를 저장. 3) Condition Codes: 최근에 수행한 산술연산의 Status Information을 저장. - ISA(Instruction Set Architecture): 명령어 집합으로, 명령어를 구성하는 필드의 수, 필드당 비트를 지정. ISA는 software와 hardware 사이에서 interface역할을 수행하며, ISA에 따라서 명..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/YqQaf/btsL7d7j36i/bjKDWUkKSBPS39MekFZYwK/img.jpg)
4. 1. 32bit vs 64bit - 컴퓨터에서 기본 데이터 처리 단위를 word라 부릅니다. 과거에는 32bit 컴퓨터를 썼기에 word size는 32bit 였지만, 오늘날 컴퓨터는 대부분 64bit 컴퓨터를 쓰기에, 오늘날 word size는 64bit 입니다. - Virtual Memory도 32bit 컴퓨터에서는 4GB이지만, 64bit 컴퓨터에서는 16TB로 확장됩니다. 이론적 크기는 264 = 16EB이지만 실제로는 이것보다 더 작은 크기를 사용합니다. - Memory는 접근의 편의성을 위해 Address를 가지고 있습니다. 32bit 컴퓨터는 4Byte 이므로 연속되는 word의 Address는 4씩 차이가 나고, 64bit 컴퓨터는 8Byte 이므로 연속되는 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ZchDD/btsL6JdG97D/hP8f7ZZ6kciHKZ0eLCt2w0/img.jpg)
3. 1. Fixed Point Number - sign, integer, fractional 3개의 part로 나누어서 수를 저장합니다. - sign bit가 0이면 양수를, 1이면 음수를 표현하고, integer part로 소수점 앞부분의 수를 2진수로 표현하며, fractional part로 소수점 뒷부분의 수를 2진수로 표현합니다. ex) sign 1 bit / interger 3 bit / fractional 4 bit 라고 가정하면, 5.625 -> 0 101 1010 로 표현합니다. - Pros: 간단하고, Floating Point Hardware가 필요없고, Low cost Embedded Processors에서 사용. - Cons: Cannot represent wi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/CZgQT/btsL4oumcNN/ku55KVYieO1tjxqHnuyNsK/img.jpg)
2. 1. Integer 1) Signed Integer - Encoding Positive Number is the same as unsigned numbers. - Encoding Negative Number is 2’s complement. 2) Numeric Ranges - Unsigned Values: MIN = 0 [00 … 00], MAX = 2n – 1 [11 … 11]. - Signed Values: MIN = - 2n - 1 [100 … 00], MAX = 2n - 1 - 1 [011 … 11]. 3) Sign Extension - Fill with sign bits. - if A + B bits -> A bits Truncate it to lower A bits. 4) Uns..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dFipzv/btsL4RbFeTH/z8rb0kKGuKpkq7SQA6ihpk/img.jpg)
1. 1. Digital Systems - 컴퓨터에서는 Binary Number(0, 1)를 사용합니다. - Easy to store with bistable elements and Reliably transmitted on noisy. - Boolean Algebra is a mathematical foundation for modern digital systems. - Computer: 입출력이 있으며, 방대한 정보를 저장, 검색, 처리하며, 다른 기계장치들을 제어하는 프로그래밍이 가능한 전자기기. - Function: 특정한 목적의 작업을 수행하기 위해 설계된 코드의 집합. - Algorithm: 문제해결방법을 정의한 일련의 단계적 절차.