> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/programming/cs_basics/data_representation/encoding-and-formats/ascii.md).

# ASCII

컴퓨터는 0과 1만을 이용하여 정보를 처리하고 표현합니다. 우리가 입력하는 모든 글자가 0과 1로 변환되려면 숫자로 표현되어야 합니다. 이를 위한 것이 아스키 코드입니다.

**아스키 코드(American Standard Code for Information Interchange, ASCII)** 는 정보 교환을 위한 미국 표준 코드로, 문자를 숫자로 변환하는 문자 인코딩(character encoding)의 표준입니다. 아스키 코드를 사용하여 문자를 숫자로 인코딩하면 서로 다른 장치 간 데이터 전송을 더 쉽게 수행할 수 있습니다.

아스키 문자 1개는 1 바이트 크기로, 7 비트로 문자를 표현하고 1 비트는 오류 체크를 위해 사용합니다. 따라서 2^7 = 128가지의 문자 표현이 가능하며, 각 문자는 0\~127까지의 10진수 값을 가집니다. 이 값을 문자의 아스키 값(ASCII value)이라고 합니다. 하단의 아스키 테이블을 보면 아스키 값에 해당하는 문자를 알 수 있습니다. 더 많은 문자가 포함된 아스키 테이블은 [링크](https://www.asciitable.com/)를 참고해 주세요.

## 아스키 테이블

| **10진수** | **16진수** | **문자**     | **Placeholder** | **10진수** | **16진수** | **문자** |
| -------- | -------- | ---------- | --------------- | -------- | -------- | ------ |
| 32       | 0x20     | 공백 (space) |                 | 80       | 0x50     | **P**  |
| 33       | 0x21     | !          |                 | 81       | 0x51     | **Q**  |
| 34       | 0x22     | “          |                 | 82       | 0x52     | **R**  |
| 35       | 0x23     | #          |                 | 83       | 0x53     | **S**  |
| 36       | 0x24     | $          |                 | 84       | 0x54     | **T**  |
| 37       | 0x25     | %          |                 | 85       | 0x55     | **U**  |
| 38       | 0x26     | &          |                 | 86       | 0x56     | **V**  |
| 39       | 0x27     | '          |                 | 87       | 0x57     | **W**  |
| 40       | 0x28     | (          |                 | 88       | 0x58     | **X**  |
| 41       | 0x29     | )          |                 | 89       | 0x59     | **Y**  |
| 42       | 0x2A     | \*         |                 | 90       | 0x5A     | **Z**  |
| 43       | 0x2B     | +          |                 | 91       | 0x5B     | \[     |
| 44       | 0x2C     | ,          |                 | 92       | 0x5C     | \|     |
| 45       | 0x2D     | -          |                 | 93       | 0x5D     | ]      |
| 46       | 0x2E     | .          |                 | 94       | 0x5E     | ^      |
| 47       | 0x2F     | /          |                 | 95       | 0x5F     | \_     |
| 48       | 0x30     | **0**      |                 | 96       | 0x60     | \`     |
| 49       | 0x31     | **1**      |                 | 97       | 0x61     | **a**  |
| 50       | 0x32     | **2**      |                 | 98       | 0x62     | **b**  |
| 51       | 0x33     | **3**      |                 | 99       | 0x63     | **c**  |
| 52       | 0x34     | **4**      |                 | 100      | 0x64     | **d**  |
| 53       | 0x35     | **5**      |                 | 101      | 0x65     | **e**  |
| 54       | 0x36     | **6**      |                 | 102      | 0x66     | **f**  |
| 55       | 0x37     | **7**      |                 | 103      | 0x67     | **g**  |
| 56       | 0x38     | **8**      |                 | 104      | 0x68     | **h**  |
| 57       | 0x39     | **9**      |                 | 105      | 0x69     | **i**  |
| 58       | 0x3A     | :          |                 | 106      | 0x6A     | **j**  |
| 59       | 0x3B     | ;          |                 | 107      | 0x6B     | **k**  |
| 60       | 0x3C     | <          |                 | 108      | 0x6C     | **l**  |
| 61       | 0x3D     | =          |                 | 109      | 0x6D     | **m**  |
| 62       | 0x3E     | >          |                 | 110      | 0x6E     | **n**  |
| 63       | 0x3F     | ?          |                 | 111      | 0x6F     | **o**  |
| 64       | 0x40     | @          |                 | 112      | 0x70     | **p**  |
| 65       | 0x41     | **A**      |                 | 113      | 0x71     | **q**  |
| 66       | 0x42     | **B**      |                 | 114      | 0x72     | **r**  |
| 67       | 0x43     | **C**      |                 | 115      | 0x73     | **s**  |
| 68       | 0x44     | **D**      |                 | 116      | 0x74     | **t**  |
| 69       | 0x45     | **E**      |                 | 117      | 0x75     | **u**  |
| 70       | 0x46     | **F**      |                 | 118      | 0x76     | **v**  |
| 71       | 0x47     | **G**      |                 | 119      | 0x77     | **w**  |
| 72       | 0x48     | **H**      |                 | 120      | 0x78     | **x**  |
| 73       | 0x49     | **I**      |                 | 121      | 0x79     | **y**  |
| 74       | 0x4A     | **J**      |                 | 122      | 0x7A     | **z**  |
| 75       | 0x4B     | **K**      |                 | 123      | 0x7B     | {      |
| 76       | 0x4C     | **L**      |                 | 124      | 0x7C     | \|     |
| 77       | 0x4D     | **M**      |                 | 125      | 0x7D     | }      |
| 78       | 0x4E     | **N**      |                 | 126      | 0x7E     | \~     |
| 79       | 0x4F     | **O**      |                 |          |          |        |

아래 표는 아스키 값이 문자로 표현되는 예시입니다.\
일련의 비트 값 0b011000110110000101110100는 총 24 비트(3 바이트)이므로 아스키 문자 3개로 표현할 수 있습니다. 8 비트(1 바이트)씩 보면, 각각 10진수로 99, 97, 116입니다.\
아스키 테이블에서 각 10진수에 해당하는 문자는 99=**c**, 97=**a**, 116=**t** 입니다. 즉, 해당 비트 값을 아스키 문자열로 나타내면 **cat**입니다.

## 예시

| **01100011** | **01100001** | **01110100** |
| ------------ | ------------ | ------------ |
| 99           | 97           | 116          |
| **c**        | **a**        | **t**        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/programming/cs_basics/data_representation/encoding-and-formats/ascii.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
