User Tools

Site Tools


opus:spring2012:kkrauss1:part1

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

asm Keywords

asm Keyword 1:Logic Operations

Logic operations are one of the fundamental aspects of computer science. In simplest terms logic operations takes one ore more value inputs and outputs a single value. As it relates to this course it is a boolean function where as the input is 0 or 1 and the output is 0 or 1, as defined by the type of operation. Basically Logic Operations are a physical implementation of truth tables.

  • Here are the truth tables for AND, OR, and XOR:

AND

INPUT OUTPUT
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

OR

INPUT OUTPUT
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1

XOR

INPUT OUTPUT
A B A AND B
0 0 0
0 1 1
1 0 1
1 1 0
  • Each outputs have some difference but the key factor is that there is only ONE output and that everything is a boolean value.

asm Keyword 2: Negated Logic Operations

Negated Logic Operations work the same way as Logic operations(as defined in keyword 1) except the output is negated. So all boolean outputs are simply switched, if the output is for an AND operation is 0 then NAND would be 1.

asm Keyword 3: Address bus

The Address bus is a series of lines that connect devices. It is used specifically to specify a physical address. When a device needs to read or write to a memory location it specifies that location on the address bus.

asm Keyword 4: Data bus

After the Address bus trasnfers the information about the physical address of where the data should come or go, the data bus actually transfers the data.

asm Keyword 5: Fetch-execute cycle

The Fetch-Execute Cycle is the process of retrieving instructions from memory and implementing any action required by those instructions

  • Also known as the instruction cycle
  • Most basic operation of a computer
  • is continuously repeating from bootup to shutdown

Steps of cycle:

  • 1. Fetch the instruction
    • From memory address stored in Program counter
    • When finished the program counter will increment to the next address
  • 2. Decode instructions
    • Stored in instruction register
  • 3. Read effective address
    • Decide operation type, memory, I/O, or register
  • 4. Execute instruction
    • The control unit sends signals to releveant parts of CPU needed to implement instructions

asm Keyword 6: von Neumann vs. Harvard architecture

The Von Neumann architecture is the general purpose architecture for most modern pc's. It only has one bus used for data and instruction fetches. It typically only has one cache, if any at all, that stores both data and instructions.

The Harvard architecture utilises separate buses for data and instructions. This allows for data and instructions to be fetched simultaneously. Caches are almost always used with this architecture as it adds to its efficiency. Also separate caches can be used for data and instructions. This is not as readily used in the general purpose pc world as it is quite inefficient in processor design, at least compared to von Neumann.

asm Keyword 7: Binary and Hexadecimal Number Representation

Binary and Hexadecimal are the names of two common number representations used today. There are many others, decimal, or base 10, for example is one anyone reading this should know. 0 through 9. Binary, or base 2, is 0 and 1. Only two values hence its name. Hexadecimal, or base 16, uses 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. These are different ways to represent quantities. Binary is the most commonly used when working with digital electronics. Processors only deal with two states, aka voltage levels, which we treat as 0's and 1's. Hexadecimal is commonly used for memory addresses for convenience, trying to display it in binary would be less convenient but can be done this way or with any number system. Any value can be represent by any number system, its a matter of convenience, preference, and of course standards that determine what we use.

asm Keyword 8: Processor & Memory Organization

  • For this topic I have decided to talk about interleaving memory.
  • “There are several memory banks which are one word wide, and one word wide bus. There is some logic in the memory that selects the correct bank to use when the memory gets accessed by the cache. Memory interleaving is a way to distribute individual addresses over memory modules. Its aim is to keep the most of modules busy as computations proceed. With memory interleaving, the low-order k bits of the memory address select a module, and the high-order m bits name a location within that module. Hence, consecutive addresses are located in successive modules. A request to access consecutive memory locations can keep several modules busy at the same time.”

asm Objective

asm Objective Understanding the C standard library

  • The C Standard Library provides predefined functions macros and type definitions. This allows for handling strings and number computations. It also handles i/o and memory allocation. Without the standard library it would take us much longer as we would need to write code for these things each time wrote a program.

hpc0 Keywords

hpc0 Keyword 1: Partition

A Partition is storage space on a hard drive. A hard disk can have multiple partitions thus dividing the hard drive into multiple “virtual” hard drives. It can also have only one partition using the entire disk or a part thus having unused portion of the hard drive.

hpc0 Keyword 2: File system

For keyword 1 I discussed what a partition is, however a partition by itself is useless. It needs a File System. A file system is what we use to organize data on the partitioned hard drive. The file system retains the data on the hard drive and allows the data to be retrieved and updated. The file system also allows for managing the physical space on the hard drive.

  • NOTE: although I have emphasized hard drive in my definitions, partitions and file sy stems are actually used on many devices including floppy drives, optical discs and flash drives.

There are many types of file systems, Unix based systems typically use ext4 and windows uses NTFS. From the user point of view they do the same t hing they just have different means of managing the partition and all its data.

hpc0 Keyword 3: Operating System

An *Operating System is a program or a series of programs and applications that runs your computer. It is the most important type of software on a system. It gives users the ability to interact with the system by running applications and accessing system devices. Windows is an example of an operating system, a graphical one to more specific. This gives the user the ability to access the systems resources to “do” various things. Examples being accessing the internet, playing games, sending data to a printer.

hpc0 Keyword 4:Bootstrap loader

When a computer system is first turned on there is no operating system in the ROM or RAM(read only memory, and random access memory). The bootstrap loader is a small program that is stored in rom or on the first sector of the harddrive. The bootloader has the instructions needed to load any operating system stored on the hard drive.

hpc0 Keyword 5: Network Services

  • Network Services are pieces of software hosted by a server that give functionality and shared resources to users on a network. E-mail and file sharing are two common network services.

hpc0 Keyword 6: System administration

  • System administration, in its simplest terms, is the upkeep of a computer system or network. The person who maintains the system or network is typically called a system administrator. The duties of a system administrator to maintain the system or network to company specifications varies depending on the company. The most important aspect of system administration is critical thinking and problem solving. This will come in handy when troubleshooting a unique problem under time constraints. Common system administration duties include: log checking, OS updating, hardware updates, security updates and backups.

hpc0 Keyword 7 Backups

  • Backup is defined, in computer science, as the process of making copies of data to be used to restore the original if it is ever lost or damaged. Backing up data is a very important aspect of the computer science world as loss of data is quite common. When dealing with multiple systems and/or networks trying to back up everything can be quite the challenge but there are many ways it can be accomplished. One good example is scheduling a time when system resource usage is typically at its lowest and automatically copying the contents of directories deemed critical to an offsite server.

hpc0 Keyword 8: Virtualization

  • In computer science Virtualization is defined as is the creation of a virtual (rather than actual) version of something. Hardware platforms, operating systems, storage devices and network resources can all be virtualized. The most common form of virtualization is server virtualization in which one physical server is partitioned into several virtual serves that can interact independently with devices and applications as if it were a separate resource. The virtual machine manager(VMM) is a common software package used in virtualization. It manages multiple operating systems, or instances of the same, on a single system. It manages all the systems resources and allocates what is needed based on what resources each operating system needs.

hpc0 Objective

hpc0 Objective: Impact of high performance computing

  • High Performance Computing can be defined as, the use of powerful processors, networks and supercomputers to tackle problems that are very compute or data-intensive. As technology continues to advance access to high powered technology, such as a supercomputer with a powerful processor, becomes more commonplace. This has caused a boom in High performance computing as HPC is widely used in a range of areas of science, engineering and industry such as climate research, aerospace and automotive engineering, oil exploration, drug design, genetic sequencing and nanotechnology.

hpc2 Keywords

hpc2 Keyword 1: Partition

hpc2 Keyword 2:File systems

hpc2 Keyword 3: Operating system

hpc2 Keyword 4: bootstrap loader

hpc2 Keyword 5: Network services

hpc2 Keyword 6: System administration

hpc2 Keyword 7: backups

hpc2 Keyword 8: Virtualization

hpc2 Objective

hpc2 Objective: demonstrate knowledge of Linux & Open Source

  • Open Source is a philosophy that a user should have free access to, and the ability to change the design of an end product. This gives the end user the ability to alter the end product to his or hers own preference, they are no longer forced to use it exactly as it was originally designed. This philosophy has led to massive improvements because so many end users come up with ways to make the end product better.
  • Linux is an example of an open source end product, in this case an operating system. Linux is synonymous with open source and what made the term more mainstream, along with the advent of the modern internet. Microsoft windows is an example of a non open source end product, also an operating system. Windows is not packaged with its source code, and in fact Microsoft tries to protect its source code. This does not allow for user improvements that can be distributed to anyone interested. Only Microsoft coders, at least in theory, can make changes for improvement to the operating system and users are forced to wait for updates and newer versions of the operating system. Linux on the other hand is packaged with the source code and the user can do with it as they see fit thus compiling the code to perform how they want. Due to the fact so many people are tweaking the code, there are constant improvements and many options as how to use linux. This is why linux is becoming more and more popular.

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 <stdio.h>
 
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 <stdio.h>
 
int main(int argc, char *argv[])
{
 
	return 0;
 
}
karl@joffice2:~/Desktop$ gcc argExperiment.c 
karl@joffice2:~/Desktop$ 
*No issues compiling ★argv[] either
#include <stdio.h>
 
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.
opus/spring2012/kkrauss1/part1.txt · Last modified: 2012/03/05 11:15 by kkrauss1