KangMoo
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 디지털 논리회로 디지털 논리회로는 0과 1의 두 가지 값을 가지는 디지털 신호를 처리하는 회로이며, 모든 전자 기기는 디지털 논리회로를 기반으로 동작한다. 이 디지털 논리회로로 어떻게 0과 1을 처리하고, 어떻게 전자 기기가 동작하는지 알아보자. ## 논리게이트 - 디지털 논리회로는 논리 게이트를 사용하여 디지털 신호를 처리한다. - 논리 게이트는 AND, OR, NOT, NAND, NOR, XOR, XNOR 등이 있다. - 논리 게이트는 입력 신호에 대해 논리 연산을 수행하고 출력 신호를 내보낸다. - 디지털 논리회로는 이러한 논리 게이트를 조합하여 만들어진다. ![image](https://hackmd.io/_uploads/Bk6Mq4yaa.png) ### 논리 게이트는 어떻게 만들어지나? |AND|OR| |---|---| |![108](https://hackmd.io/_uploads/BJE6-rJTT.jpg)|![111](https://hackmd.io/_uploads/SJKTbHypT.jpg)| - 위 이미지는 AND 게이트와 OR 게이트의 논리 회로를 나타낸다. 위의 회로대로라면 AND 게이트와 OR 게이트가 어떻게 동작하는지 어렵지 않게 이해할 수 있다. 하지만, 위 이미지대로라면 우리는 `스위치`를 직접 조작해야한다. 그렇다면, 이러한 논리 게이트를 어떻게 만들 수 있을까? #### 기본 원리 |![123](https://hackmd.io/_uploads/By_EfHypT.jpg)|![124](https://hackmd.io/_uploads/SJiEzrk6T.jpg)| |---|---| - 코일을 감은 전선에 전류를 흐르게 하면, 그 주변에 자기장이 생긴다. - 자기장이 생기면, 자성에 반응하여 다른 코일에 전류가 흐르게 된다. 단, 일반적으로는 전원공급은 하나만 사용한다. 즉 다음과 같은 회로로 이해하면 된다. |![128](https://hackmd.io/_uploads/HJuPfHk6T.jpg)|![129](https://hackmd.io/_uploads/SkiDGByap.jpg)|![130](https://hackmd.io/_uploads/HJpwfB166.jpg)| |---|---|---| 위의 회로를 기반으로 다시 게이트를 만들어보자. #### AND 게이트 ![139](https://hackmd.io/_uploads/B1_97Skap.jpg) |![135](https://hackmd.io/_uploads/SJa4mH166.jpg)|![136](https://hackmd.io/_uploads/B1a4Qr1Tp.jpg)| |---|---| |![137](https://hackmd.io/_uploads/rJ6VQH1ap.jpg)|![138](https://hackmd.io/_uploads/Sya47B1a6.jpg)| #### OR 게이트 ![150](https://hackmd.io/_uploads/rkCA7H1pp.jpg) |![146](https://hackmd.io/_uploads/rk7TQBJaa.jpg)|![147](https://hackmd.io/_uploads/SkmpmHy6p.jpg)| |---|---| |![148](https://hackmd.io/_uploads/SyQ6XByTa.jpg)|![149](https://hackmd.io/_uploads/rymTmSJpp.jpg)| #### NOT 게이트 ![154](https://hackmd.io/_uploads/BJ5VESkpp.jpg) |![133](https://hackmd.io/_uploads/Sy5Z4SJ6a.jpg)|![134](https://hackmd.io/_uploads/rk9WVH1pT.jpg)| |---|---| ### 논리게이트의 조합 - 논리 게이트의 기본이 되는 게이트는 AND, OR, NOT 게이트이며, 이러한 게이트를 조합하여 다양한 논리 게이트를 만들 수 있다. #### XOR 게이트 - XOR 게이트는 AND, OR, NOT 게이트를 조합하여 만들 수 있다. ![image](https://hackmd.io/_uploads/B1J9LSk6a.png) #### NOR, NAND, NXOR 게이트 - 각 게이트는 OR, AND, XOR 게이트에 NOT 게이트를 추가하여 만들 수 있다. ## 가산기 - 가산기는 두 개의 이진수를 더하는 논리회로이다. - 자리올림수(Carry)가 발생하는 경우를 고려하여 반가산기(Half Adder)와 전가산기(Full Adder)로 구분하여 구현할 수 있다. ### 반가산기(Half Adder) - 반가산기는 두 입력 A, B에 대한 합(Sum)과 자리올림수(Carry)를 출력한다. - 반가산기의 진리표는 다음과 같다. | A | B | Sum | Carry | |---|---|-----|-------| | 0 | 0 | 0 | 0 | | 0 | 1 | 1 | 0 | | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 1 | - 보다시피 XOR 게이트로 Sum을 구하고, AND 게이트로 Carry를 구할 수 있다. ![193](https://hackmd.io/_uploads/Sy1DOSyap.jpg) ![194](https://hackmd.io/_uploads/rJDMFS166.jpg) ### 전가산기(Full Adder) - 전가산기는 두 입력 A, B와 자리올림수(Carry)에 대한 합(Sum)과 자리올림수(Carry)를 출력한다. - 전가산기의 진리표는 다음과 같다. | A | B | Carry | Sum | Carry | |---|---|-------|-----|-------| | 0 | 0 | 0 | 0 | 0 | | 0 | 0 | 1 | 1 | 0 | | 0 | 1 | 0 | 1 | 0 | | 0 | 1 | 1 | 0 | 1 | | 1 | 0 | 0 | 1 | 0 | | 1 | 0 | 1 | 0 | 1 | | 1 | 1 | 0 | 0 | 1 | | 1 | 1 | 1 | 1 | 1 | - 전가산기는 반가산기 두 개와 OR 게이트로 구현할 수 있다. ![196](https://hackmd.io/_uploads/BygNYByT6.jpg) ### 8비트 덧셈기 - 위에서 배운 전가산기를 조합하면 8비트 덧셈기를 구현할 수 있다. ![202](https://hackmd.io/_uploads/ryYkcr1p6.jpg) ![203](https://hackmd.io/_uploads/S1TJ5SkTT.jpg) #### 8비트 덧셈기 사용 예 - 8비트 덧셈기를 사용하여 두 개의 8비트 이진수를 더하는 예를 살펴보자. - 8비트 덧셈기는 8개의 입력(A0, A1, A2, A3, A4, A5, A6, A7), 8개의 입력(B0, B1, B2, B3, B4, B5, B6, B7), 1개의 입력(CarryIn)과 8개의 출력(S0, S1, S2, S3, S4, S5, S6, S7), 1개의 출력(CarryOut)으로 구성된다. A가 10101010, B가 11001100일 때, 8비트 덧셈기를 사용하여 덧셈을 수행하면 다음과 같다. - 0번째 비트 | A0 | B0 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 0 | 0 | 0 | 0 | 0 | - 1번째 비트 | A1 | B1 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 1 | 0 | 0 | 1 | 0 | - 2번째 비트 | A2 | B2 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 0 | 1 | 0 | 1 | 0 | - 3번째 비트 | A3 | B3 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 1 | 1 | 0 | 0 | 1 | - 4번째 비트 | A4 | B4 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 0 | 0 | 1 | 1 | 0 | - 5번째 비트 | A5 | B5 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 1 | 0 | 0 | 1 | 0 | - 6번째 비트 | A6 | B6 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 0 | 1 | 0 | 1 | 0 | - 7번째 비트 | A7 | B7 | CarryIn | Sum | CarryOut | |----|----|---------|-----|----------| | 1 | 1 | 0 | 0 | 1 | - 따라서, A + B = 10101010 + 11001100 = 01110110이다. ### 16비트 덧셈기 - 8비트 덧셈기까지 만들었다면, 8비트 덧셈기 두 개를 조합하여 16비트 덧셈기를 만들 수 있다. ![207](https://hackmd.io/_uploads/H1EsqrJ66.jpg) ## Clock ![251](https://hackmd.io/_uploads/Bk4gkPJp6.jpg) 클록은 일정한 주기로 0과 1을 반복하는 신호이다. 이러한 클록 신호에 의해 컴퓨터의 모든 동작이 제어된다. 이러한 클록은 다음과 같이 구현할 수 있다. ![241](https://hackmd.io/_uploads/HJFH1w1a6.jpg) 위와 같이 있다고 했을 때 스위치를 누른고 있으면 다음과 같이 동작한다. ![242](https://hackmd.io/_uploads/SkKHkD16a.jpg) 전류가 흐르고 자기장이 생기면, 접점이 끊어지게 된다. ![243](https://hackmd.io/_uploads/B1tBJDJ66.jpg) 접점이 끊어지고고 나면 자기장이 사라지고, 접점이 다시 붙게 된다. ![244](https://hackmd.io/_uploads/r1YrJDkaa.jpg) 즉, 스위치를 누르고 있는 동안 0과 1이 반복되는 클록 신호를 만들 수 있다. ## 휘발성 메모리 - 휘발성 메모리는 전원이 꺼지면 저장된 데이터가 사라지는 메모리이다. - 예시로 램(RAM)이 있다. - 논리회로로 휘발성 메모리를 만들 수 있다. - 1비트의 데이터를 저장하는 회로로 래치와 플립플롭이 있다. ### 메모리 저장의 원리 아래와 같이 회로가 있다고 하자. 여기서 전구를 켜둔채 유지하고 싶다면, 위쪽 스위치를 작동시키면 된다. ![252](https://hackmd.io/_uploads/B137rI1a6.jpg) 만약 이 상태에서 위쪽 스위치를 뗀다고 해도 전구는 켜져있는 상태로 유지된다. ![253](https://hackmd.io/_uploads/S1nXBIypp.jpg) 전구를 다시 끈 채로 유지하고 싶다면 아래쪽 스위치를 작동시키면 된다. ![254](https://hackmd.io/_uploads/HynXrI1TT.jpg) 만약 이 상태에서 아래쪽 스위치를 뗀다고 해도 전구는 꺼져있는 상태로 유지된다. ![255](https://hackmd.io/_uploads/Skh7rLyTa.jpg) ![252](https://hackmd.io/_uploads/B137rI1a6.jpg) 즉, 위 회로는 다음과 같은 특성을 지닌다 - 상단 스위치를 닫으면 전구가 켜지고 상단 스위치를 열면 전구가 계속 켜져 있다. - 하단 스위치를 닫으면 전구가 꺼지고 하단 스위치를 열면 전구가 꺼진 상태로 유지된다. 이러한 특성을 이용하여 래치와 플립플롭을 만들 수 있다. ### 래치 - 래치는 데이터를 저장하는 논리회로이다. - 래치는 입력 신호에 따라 데이터를 저장하거나 삭제한다. - 래치는 SR 래치와 D 래치가 있다. - SR 래치는 설정(S)과 재설정(R) 입력을 사용한다. - D 래치는 데이터(D) 입력과 클록(Clock) 입력을 사용한다. #### SR 래치 (Set-Reset Latch) - SR 플립플롭은 기본적인 플립플롭 유형으로, 설정(S)과 재설정(R) 입력을 사용한다. ##### SR 래치 (NOR) ![](https://hackmd.io/_uploads/ByjUlDyTT.gif) - NOR 게이트로 구현된 SR 래치 | S | R | Q(T + 1) | |---|---|----------| | 0 | 0 | Q(T) | | 0 | 1 | 0 | | 1 | 0 | 1 | | 1 | 1 | 허용 안함 | ##### SR 래치 (NAND) ![image](https://hackmd.io/_uploads/ry2Cvz7p6.png) | S | R | Q(T + 1) | |---|---|----------| | 0 | 0 | Q(T) | | 0 | 1 | 1 | | 1 | 0 | 0 | | 1 | 1 | Q(T) | #### D 래치 ![image](https://hackmd.io/_uploads/rkRYIzQpT.png) - D 래치는 데이터(D) 입력과 클록(Clock) 입력을 사용한다. - D 래치는 클록 신호가 1일 때 데이터 입력을 저장하고, 클록 신호가 0일 때 데이터 입력을 삭제한다. | E | D | Q(T + 1) | |---|---|----------| | 0 | X | Q(T) | | 1 | 0 | 0 | | 1 | 1 | 1 | ### 플립플롭 - 플립플롭은 디지털 회로 설계의 핵심 요소 중 하나이다. - 플립플롭은 디지털 로직 회로에서 사용되는 휘발성 메모리 요소이다. - 이는 한 비트의 데이터를 저장할 수 있는 회로로, 두 가지 안정된 상태를 가진다: 1(높은 전압)과 0(낮은 전압). 플립플롭은 입력 신호에 따라 이 두 상태 사이를 전환한다. - 플립플롭에는 SR 플립플롭, D 플립플롭, JK 플립플롭, T 플립플롭 등이 있다. #### 래치와 플립플롭의 차이점 - 래치는 입력 신호의 레벨에 따라 상태가 결정되며, 비동기적으로 작동한다. 이는 빠른 반응 속도를 제공하지만, 노이즈에 취약하고 예기치 않은 상태 변화를 일으킬 수 있다. - 플립플롭은 클록 신호의 엣지에 반응하여 상태가 결정되며, 동기적으로 작동햔다. 이는 데이터의 안정성과 정확한 타이밍 제어를 가능하게 하지만, 반응 속도는 래치보다 느릴 수 있다. - 따라서, 플립플롭은 래치의 안정성 문제를 해결하기 위해 나왔으며, 정밀한 타이밍 제어가 필요한 논리회로에 주로 사용된다. ##### SR 플립플롭 ![image](https://hackmd.io/_uploads/S1u1tfmpa.png) - Set, Reset과 제어 입력을 사용한다 - 제어 입력의 값이 1일 때, Set, Reset 입력의 값에 따라 상태가 결정된다. - 제어 입력은 클록 신호로 사용된다. | E | S | R | Q(T + 1) | |---|---|---|----------| | 0 | 0 | 0 | Q(T) | | 1 | 0 | 0 | Q(T) | | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 1 | | 1 | 1 | 1 | 허용 안함 | #### D 플립플롭 ![image](https://hackmd.io/_uploads/SJBOjf7aT.png) - D 플립플롭은 데이터(D) 입력과 클록(Clock) 입력을 사용한다. | C | D | Q(T + 1) | |---|---|----------| | 0 -> 1 | 0 | 0 | | 0 -> 1 | 1 | 1 |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully