Dydaktyka
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • Make a copy
    • Transfer ownership
    • Delete this note
    • 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 Help
Menu
Options
Engagement control Make a copy 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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    # Ćwiczenia 6, grupa cz. 10-12, 4 kwietnia 2024 ###### tags: `SYK24` `ćwiczenia` `pwit` ## Deklaracje Gotowość rozwiązania zadania należy wyrazić poprzez postawienie X w odpowiedniej kolumnie! Jeśli pożądasz zreferować dane zadanie (co najwyżej jedno!) w trakcie dyskusji oznacz je znakiem ==X== na żółtym tle. **UWAGA: Tabelkę wolno edytować tylko wtedy, gdy jest na zielonym tle!** :::danger | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | | ----------------------:| -----| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | Borys Adamiak | X | X | X | X | | | X | | | | | Michał Chawar | X | X | X | X | X | X | X | X | | X | | Julia Cygan | X | X | X | X | X | X | ==X== | X | X | X | | Maciej Dengusiak | ==X== | X | X | X | X | X | X | X | X | X | | Patryk Flama | X | X | X | ==X== | X | X | X | X | X | X | | Szymon Fluder | X | X | X | X | X | X | X | X | | X | X | Aleksandra Jędrzejak | X | X | X | X | | | | | | | | Mikołaj Karapka | X | X | ==X== | X | X | X | X | X | | | | Viktoriia Kashpruk | X | X | X | X | X | X | X | X | | X | | Wiktor Małek | | | | | | | | | | | | Błażej Molik | X | ==X== | X | X | X | X | X | X | X | X | | Andrzej Morawski | | | | | | | | | | | | Konrad Oleksy | | | | | | | | | | | | Lucjan Pucelak | X | X | X | X | | | | | | | | Aleksandra Sęk | X | X | X | X | X | X | X | X | | | | Radosław Śliwiński | | | | | | | | | | | | Piotr Traczyński | | | | | | | | | | | | ~~Katarzyna Trzos (deklaracja wykreślona) | X | X | X | X | | | | | | | |~~ Piotr Warząchowski | X | X | X | X | | X | X | | | | | Olga Zaborska | X | X | X | X | | X | X | X | | | | ::: Poniżej można zadeklarować zadania **3** i **4** z **listy 5**. :::danger | | 5.3 | 5.4 | | ----------------------:| -----| --- | Borys Adamiak | | | Michał Chawar | | | Julia Cygan | | | Maciej Dengusiak | | | Patryk Flama | | | Szymon Fluder | | | Aleksandra Jędrzejak | | | Mikołaj Karapka | | | Viktoriia Kashpruk | X | | Wiktor Małek | | | Błażej Molik | | | Andrzej Morawski | | | Konrad Oleksy | | | Lucjan Pucelak | | | Aleksandra Sęk | | | Radosław Śliwiński | | | Piotr Traczyński | | | Katarzyna Trzos | | | Piotr Warząchowski | | | Olga Zaborska | | | ::: :::info **Uwaga:** Po rozwiązaniu zadania należy zmienić kolor nagłówka na zielony. ::: ## Zadanie 1 :::success Autor: Maciej Dengusiak ![image](https://hackmd.io/_uploads/r1vHrRqyC.png) ![image](https://hackmd.io/_uploads/BJgowyi1A.png) ![image](https://hackmd.io/_uploads/SkjEiJ2JA.png) INSTRUKCJA: **LW x =*(y+imm)** 1. Pobranie instrukcji z licznika rozkazów (Faza fetch) 2. Pobieramy wartości zmiennej y w A1 (Ustalamy wartości zmiennych w register file) 3. Wartość **imm** jest zapisana na bitach 0-15 i rozszerzamy ją do 32 bitów w **Sign Extend** 4. Dodajemy w **ALU** (jednostka arytmetyczno-logiczna) wartość **y** oraz **imm** 5. Z ALUResult Przekazujemy do DataMemory 6. Stamtąd do RegisterFile spowrotem dajemy wartość **y + imm** i referencje do **x** oraz ustawiamy **RegWrite** na 1 (bo zapisujemy wartość) 7. Dodaj do licznika rozkazów + 4bajty (każda instrukcja ma 32 bity) - przejdz do kolejnej instrukcji ::: ## Zadanie 2 :::danger Autor: Katarzyna Trzos ::: ## Zadanie 3 :::success Autor: Mikołaj Karapka ![image](https://hackmd.io/_uploads/B1Rdwy2J0.png) ![image](https://hackmd.io/_uploads/HJ1qCkn1A.png) Tak jak w poprzednich zadaniach musimy pokazać ścieżke przepływu danych, ale tym razem dla $x = y \ binop \ z$ **Lista kroków:** 1. Pobranie instrukcji. Przekazanie $y$ i $z$ do **RegisterFile** w celu odczytania ich wartości. 2. Przejście do **Control Unit** i ustawienie następujących wartości: - **MemtoReg** na 0 - **ALUControl** na daną kombinację $\{{a,b,c \ | \ a,b,c \in { \{ 0,1} \} \} }$ - **ALUSrc** na 0 - **RegDst** na 1 - **RegWrite** na 1 3. Przekazanie $x$ do multiplexera i zajęcie przez niego **A3** 4. Operacja binarna (binop) na $y$ (SrcA) i $z$ (ScrB) w **ALU** 5. Przejście wyniku operacji przez multiplexer 6. Przypisanie wyniku operacji do **WD3** 7. Przypisanie **WD3** do **A3** i zapisanie wartości $x$ do **RegisterFile** ::: ## Zadanie 4 :::success Autor: Borys Adamiak ::: ![image](https://hackmd.io/_uploads/BySD7y21A.png) INSTRUKCJA: **if x relop y goto L, dla instrukcji ==** Możemy jednocześnie tylko odczytanie 2 wartości, dlatego fragment adresu skoku zapiszemy w instrukcji. Przechowamy **stałą ze znakiem** i następnie z niej obliczymy kolejną instrukcję. **BTA = (sign-extended immediate << 2) + (PC+4)** ![image](https://hackmd.io/_uploads/Skpq413y0.png) ![image](https://hackmd.io/_uploads/rJR4nJ3JC.png) 1. Bierzemy 16 bitów, gdzie zakodowana nasza stała (sign-extended immediate) oraz aktualne PC - nr instrukcji 2. Rozszerzamy stałą do 32 bitów i **obliczamy wartość BTA** (skoku) w PCBranch 3. Sprawdzamy czy wyjście **zero w ALU jest true**, jeśli tak to **x == y** zachodzi 4. Jeśli w - **Zero jest true** (warunek zachodzi) - **Branch jest true** (mamy operację beq) To przekazujemy, że należy wykonać skok, a doką liczymy **BTA** ReqWrite oraz MemWrite będą zerami stąd nie będziemy niepotrzebnie zapisywali danych w DataMemory lub RegisterFile ## Zadanie 5 :::success Autor: Aleksandra Sęk ::: ![image](https://hackmd.io/_uploads/SkQMQk2JC.png) ![image](https://hackmd.io/_uploads/S12Q7J2yA.png) ![image](https://hackmd.io/_uploads/SJYLXk21A.png) ## Zadanie 6 :::success Autor: Olga Zaborska ::: ![image](https://hackmd.io/_uploads/ryLatf5JA.png) ![image](https://hackmd.io/_uploads/rkdM3GqkA.png) #### a) $T_{pcq\_PC} + T_{mem} + max(T_{RFread}, T_{sext} + T_{mux}) + T_{ALU} + T_{mem} + T_{mux} + T_{RFsetup} = [50 + 250 + 150 + 200 + 250 + 25 + 150]ps = 1075ps$ #### b) $T_{pcq\_PC} + T_{mem} + max(T_{RFread}, T_{sext} + T_{mux}) + T_{ALU} + T_{mem} = [50 + 250 + 150 + 200 + 250]ps = 900ps$ #### c) $T_{pcq\_PC} + T_{mem} + T_{RFread} + T_{mux} + T_{ALU} + T_{mux} + T_{RFsetup}= [50 + 250 + 150 + 25 + 200 + 25 + 150]ps = 850ps$ #### d) $T_{pcq\_PC} + T_{mem} + max(T_{RFread} + T_{mux} + T_{ALU}, T_{sext} + T_{add}) + T_{mux}= [50 + 250 + (150 + 25 + 200) + 25]ps = 700ps$ #### e) $T_{pcq\_PC} + T_{mem} + T_{RFread} + T_{ALU} + T_{mux} + T_{RFsetup} = [50 + 250 + 150 + 200 + 25 + 150]ps = 825ps$ #### f) $T_{pcq\_PC} + T_{mem} + T_{ctrl} + T_{mux}= [50 + 250 + 50 + 25]ps = 375ps$ ## Zadanie 7 :::success Autor: Piotr Warząchowski Czas dzialania poszczegolnych operacji: Czas dzialania procesora z zad 6 : 1075ps, Czasy poszczeolnych operacji mozna znalezc w zad 6. Podsumowywujac: 0.25 * 1075 + 0.11 * 900 + 0.12 * 675 + 0.52 *825 ps = 878 ps (1075 - 878) / 1075 = 0.18. Czyli nasze przyspiszenie jest rzedu 18% ::: ## Zadanie 8 :::success Autor: Szymon Fluder ![image](https://hackmd.io/_uploads/H1QqS1ikC.png) ![image](https://hackmd.io/_uploads/H1KQ4h9kC.png) Nie trzeba dodawać nowych komponentów ani modyfikować istniejących. Musimy wprowadzić nową instrukcję - to samo, co w zadaniu nr.3, tylko ustawiamy MemToReg na 1. ::: ## Zadanie 9 :::success Autor: Błażej Molik ::: ![image](https://hackmd.io/_uploads/BJYSLJ21C.png) Rozszerzamy układ o wejścia A4, WD4, WE4, ponieważ chcemy móc zapisywać wartości do dwóch zmiennych w jednym cyklu. Potem łączymy RD1 z nowym multiplekserem, który dostaje wartość 0 i przepinamy do WD3. Dodatkowo łączymy RD2 bezpośrednio z WD4. Teraz "x" pójdzie do A1 i A4, a "y" do A2 i A3, a wartości x i y odpowiednio do WD3, WD4 ## Zadanie 10 :::success Autor: Viktoriia Kashpruk ![image](https://hackmd.io/_uploads/HkmYCkhJC.png) ::: ## Zadanie 11 :::success Autor: Szymon Fluder ![image](https://hackmd.io/_uploads/By-Jfgi1C.png) ![image](https://hackmd.io/_uploads/Hyz5FxjJA.png) a) `t = y + imm`: PC + MEM + REG + ALU + REG = 50 + 250 + 150 + 200 + 150 = 800ps b) `x = *t`: PC + MEM + REG + MEM + REG = 50 + 250 + 150 + 250 + 150 = 850ps *poprawka:* IM + RF + MUX + DM + MUX + RF = 850ps c) `*t = x`: to samo co powyżej, czyli 850ps *poprawka:* IM + RF + MUX + DM = 675ps > [name=Piotr Witkowski] Najcięższa ścieżka dla instrukcji ``x=*y``: IM + RF + MUX + DM + MUX + RF. Uwaga: implementacja tej funkcji wymaga dodania mulitpleksera pomijającego ALU! (800ps). Czas ``*t = x`` wynosi 625ps. **Poprzednie czasy instrukcji**: A) `x = *(y + imm)` PC + MEM + REG + ALU + MEM + REG = 50 + 250 + 150 + 200 + 250 + 150 = 1050ps B) `*(x + imm) = y` PC + MEM + REG + ALU + MEM = 50 + 250 + 150 + 200 + 250 = 900ps **Zmienione czasy instrukcji**: A) zmieniamy na instrukcje a oraz b = 800ps + 850ps = 1650ps B) zmieniamy na instrukcje a oraz c = 800ps + 675ps = 1475ps **Konkluzja**: Zmniejszyliśmy czas cyklu procesora, lecz zwiększyliśmy jednocześnie czas wykonywania się bardzo popularnych instrukcji. W konsekwencji program będzie się wykonywał dłużej na zmodyfikowanym procesorze. *poprawka* Zmodyfikowany procesor nie zawsze będzie działał wolniej od poprzedniego (n.p. gdy wykonuje on programy, gdzie jest dużo obliczeń, a mało dostępów do pamięci). Są jednak programy (takie, gdzie dostępów do pamięci jest dużo), które będą działać wolniej. :::

    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