======Part 1====== =====Entries===== ====Entry 1: July 22, 2012==== - **What action or concept of significance, as related to the course, did you experience on this date?** *I performed the first experiment yesterday. For the experiment, I wrote some code to see if using boolean arrays would have been faster for our project than using the char arrays that we did use. From the data I collected, it would have been faster, but not at a level of any significance.\\ - **Why was this significant?** *It wasn't incredibly significant, I just enjoyed tweaking something and seeing how it changed what we have been doing.\\ - **What concepts are you dealing with that may not make perfect sense?** *Some of the instructions have been challenging. I'm still working on the Add and Subtract with Carry, but nothing has been too big of an obstacle.\\ - **What challenges are you facing with respect to the course?** * Just trying to get everything up and running. ====Entry 2: July 23, 2012==== - **What action or concept of significance, as related to the course, did you experience on this date?** *I was researching some of the registers to provide more information for the Opus, and as I was reading up on the Stack Pointer, it occurred to me that I had the complete wrong impression of what it was. I thought that the Stack Pointer was used to keep track of information in the other registers. This is probably because the instructions I dealt with all just had registers transfer their data to the Stack Pointer.\\ - **Why was this significant?** *It certainly helps in understanding the architecture better. It may help when doing more instructions, but the revelation probably isn't incredibly significant, it is just good knowing more about the system.\\ - **What concepts are you dealing with that may not make perfect sense?** *Nothing new since yesterday.\\ - **What challenges are you facing with respect to the course?** * Just trying to get everything up and running Still. ====Entry 3: August 6, 2012==== - **What action or concept of significance, as related to the course, did you experience on this date?** *I was looking more into the difference between zero page and indirect instructions.\\ - **Why was this significant?** *Learning the difference between the two concepts will help in a couple of ways. The first being that I now know how to differentiate the logic in the instructions, at least I think that I do. Then, secondly, I now have something else to put in this journal log.\\ - **What concepts are you dealing with that may not make perfect sense?** *Nothing at this particular point.\\ - **What challenges are you facing with respect to the course?** * Just trying to get everything up and running Still. ====Entry 4: May Day, 2012==== This is a sample format for a dated entry. Please substitute the actual date for "Month Day, Year", and duplicate the level 4 heading to make additional entries. As an aid, feel free to use the following questions to help you generate content for your entries: * What action or concept of significance, as related to the course, did you experience on this date? * Why was this significant? * What concepts are you dealing with that may not make perfect sense? * What challenges are you facing with respect to the course? Remember that 4 is just the minimum number of entries. Feel free to have more. {{page>asmpart1&nofooter}} =====Experiments===== ===Question=== Would it have been at all faster to make the register boolean arrays instead of char arrays? ===Resources=== http://www.roseindia.net/java/master-java/java-data-types.shtml \\ http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html= ===Hypothesis==== Based on the resources I have found that say booleans take up less memory and are faster to access, I believe that an array of boolean values would have been a faster alternative to char arrays. ===Experiment=== I will write java programs that will be clones except for using boolean arrays in one of the programs and char arrays in the other. The program will load an array and time how long it takes. \\ \\ * Note that the difference in data types may require some differences in functions and register initializations. ===Data=== Boolean Results TIME: NanoSeconds | ^ | ^ 1st ^ 2nd ^ 3rd ^ 4th ^ 5th ^ ^ 1 | 46660 | 4200 | 3733 | 3267 | 3732 | ^ 2 | 47127 | 4666 | 3733 | 3266 | 3733 | ^ 3 | 44795 | 4666 | 3266 | 3733 | 3733 | ^ 4 | 46194 | 4199 | 3733 | 3733 | 3733 | ^ 5 | 45727 | 4200 | 3733 | 3733 | 4200 | ^ AVG: | 46100.6 | 4386.2 | 3639.6 | 3546.2 | 3826.2 | ^ AVERAGE |12299.76 | ||| Char Results TIME: NanoSeconds | ^ | ^ 1st ^ 2nd ^ 3rd ^ 4th ^ 5th ^ ^ 1 | 45728 | 4200 | 3732 | 3733 | 3733 | ^ 2 | 46195 | 3733 | 3732 | 3733 | 3733 | ^ 3 | 46660 | 4666 | 3267 | 3733 | 3733 | ^ 4 | 49461 | 4199 | 4200 | 4199 | 3733 | ^ 5 | 46195 | 4666 | 3266 | 3266 | 3733 | ^ AVG: | 46847.8 | 4292.8 | 3639.4 | 3732.8 | 3733 | ^ AVERAGE |12449.16 | /* * Experiment for opus. * First program test. * Using char arrays. * * */ public class ExperimentChar { public static char [] test = new char[8]; public static void load(int val) { String binaryVal = Integer.toBinaryString(val); for(int x = 0; x < binaryVal.length(); x++) test[x] = binaryVal.charAt(x); } public static long getTime(int val) { final long startTime = System.nanoTime(); final long endTime; try { load(val); } finally { endTime = System.nanoTime(); } final long duration = endTime - startTime; return duration; } public static void main(String [] args) { ExperimentChar experiment = new ExperimentChar(); for(int k = 0; k <= 4; k ++) System.out.println("The time for the " + (k + 1) + " experiment was: " + experiment.getTime(k) + " nanoseconds."); } } /* * Experiment for opus. * Second program test. * Using boolean arrays. * * */ public class ExperimentBool { public static boolean [] test = new boolean[8]; public static void load(int val) { String binaryVal = Integer.toBinaryString(val); for(int x = 0; x < binaryVal.length(); x++) if(binaryVal.charAt(x) == '1') test[x] = true; else test[x] = false; } public static long getTime(int val) { final long startTime = System.nanoTime(); final long endTime; try { load(val); } finally { endTime = System.nanoTime(); } final long duration = endTime - startTime; return duration; } public static void main(String [] args) { ExperimentBool experiment = new ExperimentBool(); for(int k = 0; k <= 4; k ++) System.out.println("The time for the " + (k + 1) + " experiment was: " + experiment.getTime(k) + " nanoseconds."); } } ===Analysis=== Based on the data collected: *My hypothesis was correct, the boolean array loaded roughly 100 nanoseconds quicker. *Some problems with the data may be the first time through the loop, where it takes a lot longer to get the method going, which would affect subsequent results. ===Conclusions=== The boolean array did take less time to run, however it was only around a 100 nanosecond difference, so I do not believe that it would have actually affected the project.