======Part 1====== =====Entries===== ====January 30, 2012==== *It's that time again, winter break simply wasn't long enough. Being back for only a week and the frustrations have already returned. Comp org thus far is interesting to say the least, I have no clue where we are going yet but hopefully something will make itself apparent soon enough. HPC 0 and 2 are as I expected, and of course joes system and networking god only knows. Networking fun is intense but right up my alley in how it is taught. Its only the first day of the second week so I haven't gotten much done but plan on picking up the pace this week. I had some struggles with my personal laptop and thankfully got that taken care of(thus far). I also had some issues with the pc I use in the lair but after several attemps of installing a stable operating system I finally have thing set up the way I like. Lets see where this semester leads me. ====Entry 2: February 17, 2012==== *Today is the half way point of the first part of opus. I, like many others, have not even started so will be working tonight to get it all done. I am definitely put off by how this semester has been going. It is not the same as it was last semester and I mean that in more way than one. Comp org still seems entirely non directional but when I can get joe by himself it seems to make a little more sense. Networking is my best class so far, loving the structure and lab atmosphere. My hpc courses, much like last semester have suffered but I plan to remedy that after the break. ====Entry 3: February 27, 2012==== *Soooo things seem to be going in a better direction for classes, but as always my job sucks and is exhausting me to the point that I'm still having some issues keeping up on everything. Overall though, after having a conversation with Matt and Joe, I am happy where things are sitting. I am having to do the juggling act where I ignore a class for a while in place of another but it usually all works out in the end and I hope for that to be the case this semester. Comp org was actually quite interesting on Friday. We discussed a turing machine and the concept was truly amazing for the time period. I have done a little reading on it and hope we get to play with it a little bit more. *Opus is due Wednesday night, I hope to get it done on time but Matt usually won't kill me if I am a little late. Right now I am going to do my first experiment. Even though I have specifically said I cannot work on Mondays, as that is my day to try and get caught up on work, I was once again scheduled today. Hopefully I can get some keywords done too before I have to go in. ====Entry 4: February 29, 2012==== *Happy leap year! Aka technically the last day of opus. I have one more experiment to do, if I ever stop arguing with Tyler. Its been an interesting month to say the least. I have definitely had to slack off on some classes to get some things done but hopefully it will all balance out in the end. Today we talked briefly about the instruction sets of various CPU's. I looked up the instruction set for the amd 29k processor, the info was quite informative to say the least. I am going to finish up my last keyword and experiment for comp org and hopefully get a head start on the next opus. =====Keywords===== {{page>asmpart1&nofooter}} {{page>hpc0part1&nofooter}} {{page>hpc2part1&nofooter}} =====Experiments===== ====Experiment 1: To not, or not to not, or not to not to not....==== ===Question=== *As often happens with me, my experiment originated from a simple question in class. We were talking about "not" aka !, in class and I asked if it only works with 1's and 0's. Well we are about to find out! *I am going to set a value a equal to 0 1 and then some random number, then set b equal to !a. Here is the code and output: int main() { int a=1, b ; b = !a; printf("a = %d\n", a); printf("b = %d\n", b); return (0); } lab46:~/Desktop$ ./a.out a = 1 b = 0 lab46:~/Desktop$ int main() { int a=0, b ; b = !a; printf("a = %d\n", a); printf("b = %d\n", b); return (0); } lab46:~/Desktop$ ./a.out a = 0 b = 1 *So the above code is basically the same except a is switched between 0 and 1, and the outcome is as expected. When a is 0 b is 1 and vice versa. Now what happens when a is a number other than 0 or 1? int main() { int a=99999, b ; b = !a; printf("a = %d\n", a); printf("b = %d\n", b); return (0); } lab46:~/Desktop$ ./a.out a = 99999 b = 0 int main() { int a=-9436, b ; b = !a; printf("a = %d\n", a); printf("b = %d\n", b); return (0); } lab46:~/Desktop$ ./a.out a = -9436 b = 0 lab46:~/Desktop$ ===Conclusions=== *So as we can see from the code when using "not" ! it simply tests for 0 or any other number, if is any other number then we will get a 0 and if its 0 it will be 1. ====Experiment 2: SVN update! Where?==== ===Question=== Another simple one... How do you update your subversion repository and where do you need to be to do so? *The command to update a subversion repository is "svn update" The directory of the repository is /home/kkrauss1/src/cpu So we will try to run update from the home directory then each subdirectory until we get an update lab46:/$ svn update Skipped '.' lab46:/$ cd home lab46:/home$ svn update Skipped '.' lab46:/home$ cd kkrauss1 lab46:~$ svn update Skipped '.' lab46:~$ cd src lab46:~/src$ svn update At revision 17. lab46:~/src$ cd cpu lab46:~/src/cpu$ svn update At revision 113. lab46:~/src/cpu$ As we can see nothing really happens until we get into src. Now our repository is cpu but we did get an "at revision17" at the src level, this is because src is a repository checked out from a different semester. If there any updates made to the files of the repository then it would have updated. Once we get to cpu we see that it says we are at revision 113, now we are where we need to be for this class and it is already updated. So to answer the question of where you need to be to update; you need to be in the directory of the repository. ====Experiment 3: ★★argv vs ★argv[] vs argv[][]==== *We were talking in class about argv and whether or not ★★argv, ★argv[], and argv[][] were all usable syntax. Everyone agreed on ★★argv and ★argv[], however Joe said argv[][] would not work. Brian and I both disagreed and said we had done it before. So I am going to test it with a simple program using all three versions and see what compiles and what does not! #include int main(int argc, char **argv) { return 0; } karl@joffice2:~/Desktop$ gcc argExperiment.c karl@joffice2:~/Desktop$ *As we can see ★★argv had no issues compiling #include int main(int argc, char *argv[]) { return 0; } karl@joffice2:~/Desktop$ gcc argExperiment.c karl@joffice2:~/Desktop$ *No issues compiling ★argv[] either #include int main(int argc, char argv[][]) { return 0; } karl@joffice2:~/Desktop$ gcc argExperiment.c argExperiment.c:3: error: array type has incomplete element type karl@joffice2:~/Desktop$ *Well as we can see there WAS an issue with compiling argv[][], and Joe was 100 percent right. ★★argv and ★argv[] for the win, argv[][] is a failure at life.