======Part 1====== =====Entries===== ====Entry 1: January 25, 2012==== Today was the first day of Computer Organization. In it, we very, very vaguely talked about what the course would be about. We've all been here in Computer-based programs for a while now, so there wasn't much need for the usual introduction. We started by talking about how a computer actually sees things-- not as ones and zeros per se, but as electrical signals. It is as though one is given only two things, and from these two things only, the he must build whatever he wants. Afterwards, we were tasked with writing 0 through 63 in binary. A large group in the class worked up on the board. They split the work up in to sections, each person having a set number to complete. Derek and I worked separately from that group, and from each other, but we seemed to get it all done faster (not to sound like a snot, or anything.) I mean, it is only counting. I don't think the group is bad at it, I just think they thought about it in a way that made it harder than it was. Anyhow, I hope we get to some coding soon. As for the rolling class schedule that is HPC II, I talked to Matt and I've settled on two projects on which to start. I'm going to be making my one gaming PC in to two with the help of new parts and old, so one of my projects will be the assembly and set up of each. It will be well documented so as to be a how-to guide (let's face it, building computers is easy once you've done it, but it can be rather daunting if you haven't). My other project will involve a guide for setting up wireless on the model of netbook I have when Linux Mint Debian edition is installed. This seems to be a problem for many people, myself included, who use the OS in general, and there are many different fixes that may or may not work generally. So, even though I have already figured out how to get mine to work, I will try to document the process as best I can. More on both of those projects later. ====Entry 2: January 27, 2012==== Today, we talked about sneeches and flabulators. Some sneeches have stars, and others do not. A tunnel flabulator does not change a sneech, but a vortex flabulator does. ...We made a truth table? Okay, basically, the lesson represented how a computer handles bits (sneeches, in this case) to send instructions. We made a truth table to represent how two sets of four bits could be manipulated based on various conditions in order to send certain instructions. That was about it for Computer Organization. As for HPC, I asked Matt if I could do another project based off of my computer building project, which involves making benchmarks for my soon to be created system on Nvidia PhysX enabled games between the system using only one card (a GTX 560 Ti) or that same card along with a lesser card (9600 GT) as a PhysX dedicated card. That will be an interesting project, I think. I just need to check to see if there are certain attributes I need to be meeting for these HPC II projects. ====Entry 3: February 7, 2012==== Things have been going relatively slow in ASM so far. We've just been talking about logic gates and how the processor functions in general. Don't get me wrong, this is very interesting stuff, but we usually had these sort of discussions along with some code analysis. As in, Matt would write some code for us to compile and study up on the board, and discussion with model drawing and all that would compliment the code to drive the point home. We're just getting started, so it's to early to tell what we'll be up to for the whole semester. As for HPC II, Matt told me that my own little personal second excursion in to SDL could count as a project. I figured it would be worth looking in to on its own, but I didn't even consider the possibility of it being a project. This works for me though. If I can keep it up, I have so grandiose plans for it all. I am using the Lazy Foo' guide yet again, and I am up to Lesson 6. I'm learning quite a bit, as it is an excellent guide. I wish I had more time to work on it all, though. ====Entry 4: February 15, 2012==== Today was a rather interesting class. Unfortunately, I did have to leave early for a dentist appointment (which went well, for what it is worth!). In class, however, we had a nice discussion on registers, including what they are and how they function in a basic sense. Derek was able to draw a very nice diagram of a register, simply from his experiences in our high school engineering program, which is honestly impressive. We talked about how a register is essentially storage in the processor for commonly executed tasks. This makes it easier for the computer to be efficient, as less work is needed to execute said tasks. As for HPC II, my progress has been partially slowed by other work. I have some nice projects lined up, and they will be started and completed soon. My SDL adventure is also taking a bit of a break so that other more pressing tasks can be completed. However, I left off on lesson 8, so progress has been made. I can't wait until I learn more, as making games with what I've learned is a very exciting prospect. ====Entry 5: February 24, 2012==== Today was a particularly interesting class in Comp. Org., as we discussed some ~*particularly interesting*~ things. We went over Karl's meticulous and painstakingly printed on-board explanation of the Fetch-Execute cycle (recently catch-phrased into the trendy "fetchecute" cycle), which could be described simply as the method by which the computer executes an instruction and proceeds to acquire (or, fetch) a new one. This led in to our discussion about Turing machines, which are wonderful devices of which there are no physical manifestations. Simply, it is a method of thinking developed by Alan Turing which led to the development of modern day computing. We had a nice little visual representation on the board drawn to represent the Turing machine's hypothetical infinite storage tape from which we spent the remainder of class trying to figure out how many symbols we would need to have the Turing machine print a certain sequence. =====Keywords===== {{page>asmpart1&nofooter}} {{page>hpc2part1&nofooter}} =====Experiments===== ====Using a Startup script to finish solving Wireless setup issue==== ===Question=== Though this problem has already been solved, this will serve as a sort of retroactive experiment. In the beginning of the semester, I was having issues with my netbook's Linux Mint Debian installation and the wireless connection. After much troubleshooting, I was able to solve it, but only if I removed and reloaded a module from the kernel. Naturally, this is kind of annoying to do each time when I start up, so naturally the question was asked-- "Could I use a start up script to solve this wireless issue?" The answer may (or may not) surprise you. ===Resources=== * Matthew Haas * Various Linux distribution's Support Forums (for finding help with the module in the first place) ===Hypothesis=== Being that it takes only a couple terminal commands to fix the situation via modprobe, adding these commands to a script that runs at start up should fix my wireless issues. Matt suggested that I add them to //"/etc/rc.local".// ===Experiment=== The experiment is simple-- add the commands to the start up script (/etc/rc.local), restart the computer and check to see if the wireless issue is resolved. ===Data=== ==The commands== modprobe -r brcmsmac modprobe brcmsmac ==/etc/rc.local== #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bitso # # By default this script does nothing. mkdir -p /dev/cgroup/cpu mount -t cgroup cgroup /dev/cgroup/cpu -o cpu mkdir -m 0777 /dev/cgroup/cpu/user echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent modprobe -r brcmsmac modprobe brcmsmac exit 0 ===Analysis=== Ultimately, the script works. My wireless starts up perfectly each time the system boots. ===Conclusions=== Scripts can do many a great thing, even if it is something as simple as this. This was resulted in my system acting as it should, after a great deal of stress and Googling. There was SO much Googling. Too much, even. Even so, I learned a great deal about the workings of a Linux system through the troubleshooting process. Really, that is how I've learned most things about computer maintenance and set up-- break something, stress a lot, fix it somehow, lesson(s) learned. ====Simple Logic Gate Program==== ===Question=== Simply put, I wrote some code snippets for some of my keywords regarding logic operators. I wanted to make sure that the code was valid, so this is the experiment that puts these code snippets to the test. The question being, "Is my syntax correct in such a way that the concepts of the basic logic gates are accurately displayed?" ===Resources=== * [[http://en.wikipedia.org/wiki/Logical_connective]] * Class lectures ===Hypothesis=== Naturally, my hypothesis is that my code is correct, otherwise I wouldn't have written it as such. This experiment is solely to make sure. For science! ===Experiment=== Simply, I will run the program (code is below) with every possible input for two items ([1,1], [1,0], [0,1], [0,0]), and check to see if the logic gates are working as they should, according to the definitions provided above, in the keywords section. If they are working as they should, then my hypothesis is correct. ===Data=== ==Source code== #include int main() { int x,y; do { printf("Enter an X value (0/1): "); scanf("%d", &x); if (x < 0 || x > 1) { printf("ERROR: Please enter either a 0 or 1. \n"); } } while (x < 0 || x > 1); do { printf("Enter a Y value (0/1): "); scanf("%d", &y); if (y < 0 || y > 1) { printf("ERROR: Please enter either a 0 or 1. \n"); } } while (y < 0 || y > 1); //AND in C if( x == 1 && y == 1) { printf("AND: True\n"); } else { printf("AND: False\n"); } //OR in C if( x == 1 || y == 1) { printf("OR: True\n"); } else { printf("OR: False\n"); } //XOR in C if( (x == 1 && y == 0) || (x == 0 && y == 1) ) { printf("XOR: True\n"); } else { printf("XOR: False\n"); } //NAND in C if(!(x == 1 && y == 1)) { printf("NAND: True\n"); } else { printf("NAND: False\n"); } //NOR in C if(!(x == 1 || y == 1)) { printf("NOR: True\n"); } else { printf("NOR: False\n"); } //XNOR in C if(!((x == 1 && y == 0) || (x == 0 && y == 1))) { printf("XNOR: True\n"); } else { printf("XNOR: False\n"); } return(0); } ==CLI Output== tyler@aleron ~/src/asm $ ./logicgates Enter an X value (0/1): 1 Enter a Y value (0/1): 1 AND: True OR: True XOR: False NAND: False NOR: False XNOR: True tyler@aleron ~/src/asm $ ./logicgates Enter an X value (0/1): 1 Enter a Y value (0/1): 0 AND: False OR: True XOR: True NAND: True NOR: False XNOR: False tyler@aleron ~/src/asm $ ./logicgates Enter an X value (0/1): 0 Enter a Y value (0/1): 1 AND: False OR: True XOR: True NAND: True NOR: False XNOR: False tyler@aleron ~/src/asm $ ./logicgates Enter an X value (0/1): 0 Enter a Y value (0/1): 0 AND: False OR: False XOR: False NAND: True NOR: True XNOR: True tyler@aleron ~/src/asm $ ===Analysis=== My hypothesis was correct-- the code compiles, and the logic gates work as intended, as demonstrated above. ===Conclusions=== It is worth noting that I did not use the bitwise operators here, however. In C, there actually is a bitwise operator for xor. Obviously, I did not do that, opting only for the logical operators the language provides. Perhaps a bitwise version of this will come in handy later. I did notice that I could have made the XOR and XNOR gates more efficient, code-wise. It's essentially checking to see if the two values are the same, so the condition could be if x==y or !(x==y), respectively, instead. Oh well! The experiment wasn't so much to make super efficient code, it was to test the code I whipped up in a minute. ====Retest: Karl's "Not" Experiment==== ===Question=== A discussion in class led to the question being posed regarding the nature of the NOT operator in C/C++. We wondered what happened if an integer is defined as a given number and then has the NOT operator applied to it. We know that if the number is 1, we will get a zero. But what if the number is larger than 1? What if it is an arbitrarily large number? This is what the experiment seeks to answer. ===Resources=== * Class Discussion * [[http://lab46.corning-cc.edu/opus/spring2012/kkrauss1/start#experiment_1to_not_or_not_to_not_or_not_to_not_to_not|Karl's Opus]] ===Hypothesis=== One might think that the number returned would be negative (for whatever reason?), but given that using NOT on 1 yields 0, it is likely that using it on a different number will yield 0 as well. ===Experiment=== I will be testing this by writing code that accepts an inputted number, runs NOT on it, then prints the result. ===Data=== ==Source Code== #include int main() { int a, b; printf("Please enter a value to use NOT on: "); scanf("%d", &a); b=!a; printf("a = %d\nb = %d\n!b = %d\n", a, b, !b); return(0); } ==CLI Output== tyler@aleron ~/src/asm $ ./notexp Please enter a value to use NOT on: 1 a = 1 b = 0 !b = 1 tyler@aleron ~/src/asm $ ./notexp Please enter a value to use NOT on: 3 a = 3 b = 0 !b = 1 tyler@aleron ~/src/asm $ ./notexp Please enter a value to use NOT on: 9001 a = 9001 b = 0 !b = 1 ===Analysis=== My hypothesis was correct, and Karl's original test checks out. The not operation, when placed on a variable, will yield a 0 if the variable is another number other than that, and a 1 if it is zero. ===Conclusions=== My conclusion is largely in the analysis portion of this experiment. But, through this experiment, it has become clear that the NOT operator in C/C++ will serve as a valuable tool in our CPU simulation project.