haas/spring2026/comporg/projects/dap2.md
... ...
@@ -0,0 +1,97 @@
1
+# CSCS2650 Computer Organization
2
+
3
+# PROJECT: DEBUG A PROGRAM (dap2)
4
+
5
+## OBJECTIVE
6
+
7
+Extend our debugging infrastructure with the creation of a
8
+**`debugregs`** subroutine.
9
+
10
+## TASK
11
+
12
+Implement a Vircon32 assembly subroutine that uses your dap0 routine.
13
+subroutine. Your task is to display the set of CPU registers (R0-R13),
14
+along with their hexadecimal contents.
15
+
16
+No parameters need to be given to this debugging subroutine, since it
17
+will always be displaying this same range of registers.
18
+
19
+Specifically, be sure to:
20
+
21
+... call the subroutine **`debugregs`** or **`_debugregisters`**, and
22
+place it in your existing **debug.s** file so that both (and also
23
+**_debugmemory** from dap1) can be **%include**'ed as needed in debugging
24
+efforts.
25
+
26
+Make sure it that it calls and makes use of your original **_debug**
27
+in the process of operation (let **_debug** handle the display of
28
+information).
29
+
30
+That it is written entirely in Vircon32 assembly language, using no
31
+compiler-generated routines from the Vircon32 API (no **print**, no
32
+**itoa**)
33
+
34
+As stated above: no parameters need to be passed in to use this routine.
35
+
36
+Pertaining to the registers, make sure your routine preserves existing
37
+register states, so that whatever was going on before the call to debug
38
+is saved, so you can restore it upon completion).
39
+
40
+Display registers R0-R7 in the left column, starting at or near the top
41
+left of the screen, with R8-R13 in the right column, separated by an
42
+appropriate distance.
43
+
44
+## SUBMISSION
45
+
46
+To be successful in this project, the following criteria (or their
47
+equivalent) must be met:
48
+
49
+ * Project must be submit on time, by the deadline.
50
+ * Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
51
+ * Processing must be correct based on input given and output requested
52
+ * Output, if applicable, must be correct based on values input
53
+ * Code must be nicely and consistently indented and aligned
54
+ * Code must be consistently written, to strive for readability from having a consistent style throughout
55
+ * Code must be commented
56
+ * Sufficient comments explaining the point of provided logic **MUST** be present
57
+ * Track/version the source code in your private semester repository
58
+ * Submit a copy of your source code to me using the **submit** tool by the deadline.
59
+
60
+## SUBMIT TOOL USAGE
61
+
62
+Let's say you have completed work on the project, and are ready to
63
+submit, you would do the following (once on LAB46, with all your data
64
+present):
65
+
66
+```
67
+lab46:~/src/SEMESTER/comporg/dap1$ make submit
68
+```
69
+
70
+You should get some sort of confirmation indicating successful submission
71
+if all went according to plan. If not, check for typos and or locational
72
+mismatches.
73
+
74
+### RUBRIC
75
+
76
+I'll be evaluating the project based on the following criteria:
77
+
78
+```
79
+286:dap2:final tally of results (286/286)
80
+*:dap2:submitted file called debug.s or debug.asm [26/26]
81
+*:dap2:subroutine is called _debugregs or __debugregisters [26/26]
82
+*:dap2:code assembles with no warnings or errors [26/26]
83
+*:dap2:register states preserved across call [26/26]
84
+*:dap2:calls upon original _debug to do data output [26/26]
85
+*:dap2:output contains display of registers, contents [52/52]
86
+*:dap2:screenshot of subroutine in action to DISCORD [26/26]
87
+*:dap2:code contains usage instructions in comments [26/26]
88
+*:dap2:output contains display of addresses, contents [26/26]
89
+*:dap2:functionality is correct and to specifications [26/26]
90
+```
91
+
92
+### ADDITIONALLY
93
+
94
+ * Solutions not abiding by spirit of project will be subject to a 50% overall deduction
95
+ * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
96
+ * Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
97
+ * Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction
haas/spring2026/comporg/projects/images/sieveanimation.gif
... ...
Binary files /dev/null and b/haas/spring2026/comporg/projects/images/sieveanimation.gif differ
haas/spring2026/comporg/projects/pnc2.md
... ...
@@ -0,0 +1,113 @@
1
+# CSCS2650 Computer Organization
2
+
3
+# PROJECT: PRIME NUMBER COMPUTATIONS (pnc2)
4
+
5
+## OBJECTIVE
6
+
7
+Continue exploring algorithm/implementation, this time exploring a new
8
+algorithm: the sieve of eratosthenes and selected optimization.
9
+
10
+## GRABIT
11
+
12
+There is a GRABIT available, containing some skeleton code, an XML file,
13
+and a Makefile, that will facilitate building the cartridge.
14
+
15
+## TASK
16
+
17
+Add to your two separate, independent programs, one in Vircon32 C, and
18
+other in Vircon32 assembly, functionality that implements the following:
19
+
20
+ * sieve of eratosthenes (soe)
21
+ * sieve of eratosthenes with sqrt optimization (soe +s)
22
+
23
+Collect the timing data and add them onto your graphs. NOTE that you may
24
+have to adjust your bounds, and if needed, drop the naive brute
25
+implementation from consideration due to the extreme gap in performance.
26
+
27
+## PROGRAM
28
+
29
+Your next program, and first sieve, will be the Sieve of Eratosthenes.
30
+Perhaps among the best and likely longest-known sieves, its origins date
31
+from antiquity.
32
+
33
+This sieve, instead of calculating to determine the eligibility of a
34
+prime, works in a manner of marking off patterns of values that cannot be
35
+prime (so, it is composite-focused in approach vs. prime-focused).
36
+
37
+In order for it to work, we must store all the values we're processing so
38
+we can obtain what is left when done– what remains are the prime
39
+values.
40
+
41
+Some refined considerations:
42
+
43
+ * include memory management related to the sieve in your timing
44
+ * take measurements out to FIVE (5) decimal places
45
+ * consider doing a bar graph instead of line graph
46
+
47
+Please check out the [wikipedia page for the Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
48
+
49
+Here is an animated image of this sieve in action (from wikipedia):
50
+
51
+![sieve animation](images/sieveanimation.gif)
52
+
53
+## REFERENCE
54
+
55
+The following are reference screenshots of what your implementations
56
+should approximate:
57
+
58
+### PNC2 C IMPLEMENTATION
59
+
60
+![PNC2/C runtime](images/pnc2runtime.png)
61
+
62
+## SUBMISSION
63
+
64
+To be successful in this project, the following criteria (or their
65
+equivalent) must be met:
66
+
67
+ * Project must be submit on time, by the deadline.
68
+ * Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
69
+ * Processing must be correct based on input given and output requested
70
+ * Output, if applicable, must be correct based on values input
71
+ * Code must be nicely and consistently indented and aligned
72
+ * Code must be consistently written, to strive for readability from having a consistent style throughout
73
+ * Code must be commented
74
+ * Sufficient comments explaining the point of provided logic **MUST** be present
75
+ * Track/version the source code in your private semester repository
76
+ * Submit a copy of your source code to me using the **submit** tool by the deadline.
77
+
78
+## SUBMIT TOOL USAGE
79
+
80
+Let's say you have completed work on the project, and are ready to
81
+submit, you would do the following (once on LAB46, with all your data
82
+present):
83
+
84
+```
85
+lab46:~/src/SEMESTER/DESIG/pnc2$ make submit
86
+```
87
+
88
+You should get some sort of confirmation indicating successful submission
89
+if all went according to plan. If not, check for typos and or locational
90
+mismatches.
91
+
92
+### RUBRIC
93
+
94
+I'll be evaluating the project based on the following criteria:
95
+
96
+```
97
+260:pnc2:final tally of results (260/260)
98
+*:pnc2:submitted working C and assembly implementations [26/26]
99
+*:pnc2:graph produced from timing data produced [26/26]
100
+*:pnc2:post screenshots to class DISCORD channel [26/26]
101
+*:pnc2:processing is correct, and to specifications [26/26]
102
+*:pnc2:working sieve of eratosthenes implementation [52/52]
103
+*:pnc2:working soe with sqrt implementation [52/52]
104
+*:pnc2:all variants and combinations thereof operational [26/26]
105
+*:pnc2:timing data is taken out to at least 5 decimal places [26/26]
106
+```
107
+
108
+### ADDITIONALLY
109
+
110
+ * Solutions not abiding by spirit of project will be subject to a 50% overall deduction
111
+ * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
112
+ * Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
113
+ * Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction