Description
• Addressing Mode 教學 影片: https://www.youtube.com/watch?v=NuTuCi2JEw8 hackmd 教學: https://hackmd.io/S9oYQa4NSBqPdQWdMRJpFQ?view
• 基本題(70%): 題 目 敘 述 ︰ 請在 Data Memory 位址 0x100 存入 0x01,和在 Data Memory 位址 0x101 存入 0x01。接著,請使用至少一種 indirect addressing register,使 Data Memory 位址 0x102~0x108 的值皆為前兩個位址的值相加。
例如: Data Memory 位址 0x102 的值為 Data Memory 位址 0x100 的值和
Data Memory 位址 0x101 的值相加,
Data Memory 位址 0x103 的值為 Data Memory 位址 0x101 的值和
Data Memory 位址 0x102 的值相加,
……以此類推,到 Data memory 位址 0x108 結束。
評分標準:
1. Data Memory 位址 0x100~0x108 之值依序應為 0x01, 0x01, 0x02, 0x03,
0x05, 0x08, 0x0D, 0x15, 0x22。
2. 使用至少一種 indirect addressing register。
• 進階題(30%):
題目敘述:
在 Data Memory 位址 0x010 ~ 0x018,依序存入 0x0B、 0x05、0x40、 0x07、0x0D、0x7F、0x0A、0x01、0xFE 共 9 個數值,並利用至少一種 indirect addressing register 實作任意的排序演算法,將上述 9 個數值由小到大排列後,將結果依序存入 Data Memory 位置 0x010 ~ 0x018。
評分標準:
1. 同學需在影片中呈現排序後數值的狀況(如圖)。
2. 使用至少一種 indirect addressing register。
提示:排序元素個數不變。
• 加分題(20%):
題目敘述:
在 Data Memory 位址 0x100 ~ 0x104 , 依序存入一個有 5 個數值的陣列 0xa1, 0xb2, 0xc3, 0xd4, 0xe5,以及在 Data Memory 位址 0x110 ~ 0x113,依序存入另一個有 4 個數值的陣列 0xa7, 0xb3, 0xc9, 0xf6。接著,請用 merge two sorted arrays 的方式合併這兩個陣列到 Data Memory 位址 0x120 ~ 0x128 的地方,合併後的陣列為 9 個數值且遞增的陣列。
評分標準:
1. 需在影片中開啟 File Registers,並在畫面中呈現 0x100,0x110,0x120
三列之值。
2. 0x120 列之值依序應為 0xa1, 0xa7, 0xb2, 0xb3, 0xc3, 0xc9, 0xd4, 0xe5, 0xf6。
3. 使用至少一種 indirect addressing register。
Merge two sorted arrays:
Source: Merge two sorted arrays – GeeksforGeeks 裡的 Method 3
Time complexity: O(n1 + n2)
Lab 02: Requirement Description
• Addressing Mode Guideline video: https://www.youtube.com/watch?v=NuTuCi2JEw8 hackmd: https://hackmd.io/S9oYQa4NSBqPdQWdMRJpFQ?view
• Basic (70%):
Description:
Please store 0x01 at Data Memory address 0x100, and store 0x01 at Data Memory address 0x101. Next, please use at least one indirect addressing register, so that the values of the Data Memory addresses 0x102~0x108 are the sum of the values of the previous two addresses.
For example: The value of Data Memory address 0x102 is the sum of the
value of Data Memory address 0x100 and the value of Data
Memory address 0x101,
the value of Data Memory address 0x103 is the sum of the
value of Data Memory address 0x101 and the value of Data
Memory address 0x102,
and so on, until the Data memory address 0x108.
Grading Criteria:
1. The data memory address 0x100~0x108 should be 0x01, 0x01, 0x02, 0x03, 0x05, 0x08, 0x0D, 0x15, 0x22 in sequence.
2. Please use at least one indirect addressing register.
• Advanced (30%):
Description:
Initialize the following 9 numbers (0x0B、0x05、0x40、0x07、0x0D、 0x7F、0x0A、0x01、0xFE) at 0x010 ~ 0x018 in Data Memory. Then, implement any sorting algorithm to sort the values and store the results at 0x010 ~ 0x018 in ascending order.
Standard of grading:
1. You must make sure that the values are sorted properly (as Figure).
2. You should use at least one indirect addressing register.
Hint: The number of the values is fixed. You do not have to consider the situation when the number of the values is changed.
• Bonus (20%):
Description:
In Data Memory address 0x100 ~ 0x104, store an array of 5 elements in sequence 0xa1, 0xb2, 0xc3, 0xd4, 0xe5, and in Data Memory address 0x110 ~ 0x113, store another array with 4 values in sequence 0xa7, 0xb3, 0xc9, 0xf6.
Next, please merge the two arrays into the data memory address 0x120 ~ 0x128 by means of merge two sorted arrays. The merged array is an increasing array with 9 elements.
Standard of grading:
1. You need to open File Registers in the video, and display the values in the three columns of 0x100, 0x110, and 0x120 on the screen.
2. The value of column 0x120 should be 0xa1, 0xa7, 0xb2, 0xb3, 0xc3, 0xc9, 0xd4, 0xe5, 0xf6.
3. Use at least one indirect addressing register.
Merge two sorted arrays:
Source: Method 3 in Merge two sorted arrays – GeeksforGeeks
Time complexity: O(n1 + n2)
Reviews
There are no reviews yet.