User Tools

Site Tools


opus:spring2012:dgirard3:part1

Part 1

Entries

Entry 1: January 27th, 2012

This week for computer organization we really just talked about what was going to happen. We explained how logic gates work and how we were to use them. We counted 0 to 64 in binary to show how we would count through with these gates. With the gates we are going to create a computer simulator, slowly creating flip-flops, registers and programs to run through it for us to see if it works. So with the logic gates, we first made up truth tables to show how they would operate. Then we began creating the codes for the in linux.

In HPC, i started looking at a script that is for the mac labs up in corning. The script is flawed and does not work. It is made to add, change and delete usernames for the students that use them. So for one of my projects in this class, im going to understand how this works and hope that i can fix it so they are able to use it.

Entry 2: February 3, 2012

This week of class we went more into the computer simulation. We talked a little on logic gates and the logic of using them. We have header files and programs that will run these gates. But soon we learned to combine them to create more gates and to start the creation of flip flops. Its a combination of logic gates that will create certain outputs that we could use for bigger parts of the computer. It would either give out a value or an undefined, and these two outputs could be used for our advantage when creating this computer simulation. In HPC, I am still looking over the script. Its a little more confusing then originally thought of so it might take longer then usual. I am beginning to have more of an idea of how this script works but not enough to actually start manipulating it in any way.

Entry 3: February 10, 2012

In this week of computer organization, we talked more on flip flops and latches. We talked a little on how they worked and how they will be implemented into registers, the place where most of our memory runs through and gets stored. I actually taught the class this week of how a register should work. I didnt have a complete concept of it but i knew enough to actually talk to the class about it. The register can output and input data many different ways, like serial to parallel or parallel to parallel. With these different ways, we can manipulate on how we want our data to be outputted. So we can store information how we want and output the information the way we want. So we talked about this and how it can be used in our simulation. In HPC i believe i know how this scripts work. Once you see it, its pretty segregated in its steps and you can see where it can be broken up into functions, i just need to know how to use functions in bash scrpting, i havent delved into that yet. I will perform a experiment on it i believe to get a better understanding of it. But all together, i got good headway on this script.

Entry 4: February 17, 2012

This week we talked a little more on the use of registers and flip flop logic. It was kind of confusing but i think it is understood now. But the main topic of the week was learning the turing theory. he was the father of computers, in a way. he had made a theory of a basic computer. Infinite tape ran while a head would move left, right, or place a value on the tape. It was a simple programing computer (in a way) that read input and wrote output onto tape. So we did an excercise with this to get thinking on different concepts of simple logic and programming since we will be dealing with a low level language when finishing this computer simulation. In HPC, i am having a hard time with this script. I wish i wasnt taking so long but when i feel like i am making head way, it somehow gets ruined and i have to start from sqaure one. I feel i should look this over some more and see what can be done for me to get a better grasp.

Keywords

asm Keywords

Storage

Definition

Areas in the computer like registers or buffers. or other simple things like USB's or RAM, they are places that store digital data for us to use.Data storage is a core function and fundamental component of computers. There is no one kind of storage you have anywhere from permanent to volatile.

Demonstration

This picture shows the hierarchy of storage. From primary to tertiary.

Data Bus

Definition

A data bus is a group of electrical wires used to send information (data) back and forth between two or more components. The width is one of the most important aspects. The width shows how many bits are made up of the bus. It can be from 8 up to 64 bits. When people refer to what size processor the computer they are using, they refer to the front side data bus that connects the processor to the main memory. There are others such as one that goes from processor to dedicated cache memory.

Demonstration

I am not sure how exactly to demonstrate this. But here is an example of what a computer uses “The Intel processor in the current line of Macs uses a 64-bit data bus to connect the processor to its memory.” Its just the wires so the computer can transfer its information to other components.

Address Bus

Definition

An address bus is a computer bus, a series of lines connecting two or more devices, that is used to specify a physical address. When a processor or a device needs to read or write to a memory location, it specifies that memory location on the address bus, the value to be read or written is sent on the data bus.

Demonstration

For example, a system with a 32-bit address bus can address 232 (4,294,967,296) memory locations. If each memory address holds one byte, the addressable memory space is 4 GB.

Machine Word

Definition

Machine word is a specific characteristic in a computer architecture. It represents each bit which are a fixed sized and are handled by the instruction set or the hardware of the processor. The bits represent the length, width and height of each word and this is important.

Demonstration

Some examples of what words are used for are integers, floating point numbers, addresses, registers, memory process transfer, instructions and unit of address resolution. A word in each of these areas of hardware or instruction are important because they help a long the data go through smoothly and easily.

Interrupts

Definition

An interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution. You have 2 different kinds as well a hardware interrupt and a software interrupt. A hardware interrupt cause the processor to stop and save its current state and begin execution of an interrupt handler. A software interrupt is usually found within an instruction set and it will have a context switch. Interrupts are a commonly used technique for computer multitasking, especially in real-time computing.

Demonstration

This code is a simple code that just shows when a car driving continues or gets interrupted. First, we start rolling forward. We have an integer used as a flag, that is either 0 when we have not hit an object, or 1 when we hit something. An interrupt occurs when we hit something, it will stop the robot to avoid any damage, and also set our flag. and so on so forth.

// Interrupt-Driver Bumper Example
// A bumper switch on the front of the robot should be tied to digital pin 2 and ground
 
#include <avr/interrupt.h>
 
volatile int bumper;          // have we hit something
 
void setup(){
    pinMode(2, INPUT);      // Make digital 2 an input
    digitalWrite(2, HIGH);  // Enable pull up resistor    
 
    // attach our interrupt pin to it's ISR
    attachInterrupt(0, bumperISR, FALLING);
 
    // we need to call this to enable interrupts
    interrupts();
 
    // start moving
    bumper = 0;
    DriveForward();
}
 
// The interrupt hardware calls this when we hit our left bumper
void bumperISR(){
    Stop();
    bumper = 1;
}
 
void loop(){
    // if bumper triggered
    if(bumper > 0){
       DriveBackward();    // set motors to reverse
       delay(1000);           // back up for 1 second
       TurnRight();            // turn right (away from obstacle)
       bumper = 0;
       DriveForward();      // drive off again...
    }
    // we could do lots of other stuff here.
}

I/O

Definition

Input and output is what the core of the computer is. It is how data is sent from one place to another. You have some form of hardware that can process information such as a computer and you have a thing to input or give data such as a human or some sort of outside force. Input are data that are received by the system and output is data sent from it. Input devices would be like a keyboard or a mouse. and output would be the screen of your monitor.

Demonstration

This code below is a simple direct address code for the computer. It just says where to read from and where to write from. Or in current terms, input and output.

MOV register, [address] ; to read
MOV [address], register ; to write
 
; similarly
IN  register, [address] ; to read as input
OUT [address], register ; to write as output

Stack Operations

Definition

The two operations that form the majority of the functionality of the stack are the operation of adding to the stack, and the operation of removing items from the stack. First off, a stack is a device that operates in a last in, first out basis. Its like plates in a spring loader of a restaurant. They can only be added to the top, removed from the top and no other plates can be accessed. They move up one at a time while the lower one is moved up as the top is removed. In computer terms we have a an area of data that can be added to, remove some data, check to see if there is any data or check to see if it is full.

Demonstration

This is a simple code to show stack being filled and or emptied depending on what you want to be done or what the situation is.

int main() {
  stack<int> S;
  S.push(8);
  S.push(7);
  S.push(4);
  assert(S.size() == 3);
 
  assert(S.top() == 4);
  S.pop();
 
  assert(S.top() == 7);
  S.pop();
 
  assert(S.top() == 8);
  S.pop();
 
  assert(S.empty());
}

Control and Data Flow

Definition

There are some distinct differences between data flow and control flow. Data flow can do streaming, unlink control flow which can run multiple components that can process data at the same time, smallest unit in data flow is an component, just data within the control flow but can affect the outcome of your control flow, data flow is made up of source(s), transformations, and destinations. Control flow uses process, it is the key for control flow, the first task needs to be completed before it can continue. Smallest unit is a task, control flow does not move data and package control flow is made up of containers and tasks connected with precedence constraints to control package flow

Demonstration

The left side shows a control flow and the right represents a data flow:

asm Objective

asm Objective

familiarity with the organization of a computer system

Definition

This objective entails that i must explain how a computer is setup, such as from the very bottom of how it works all the up to what appears to the user.

Method

To show i know how a computer is organized, i will state and explain some of the basic things that are found within the computer system.

Measurement

To begin, the computer's most important task is storing and managing information within the computer. Simply put, you have unit input then processor then memory then finally unit output. That is a basic setup of what is going on. Obviously there is much more to what is going on within. You have the hardware that is needed such as the CPU, the peripherals, main and secondary memory. The CPU is the major component of a computer; the electronic brain of the machine. It consists of the electronic circuits needed to perform operations on the data. Main Memory is where programs that are currently being executed as well as their data are stored. The CPU fetches program instructions in sequence, together with the required data, from Main Memory and then performs the operation specified by the instruction. Main memory is like Random Access Memory or RAM, and this is tons of data can and will be stored. The secondary memory storage creates a long stable place for the memory to be at. The most commonly known place known as secondary storage would be known as the disk storage. Then you have your peripherals which is used for the users. It makes it easy for us to input some form of data and see and outputted data. But the hardware cant be used unless it has instructions from a program. Thats when the OS comes in or the Operating system. It is a set of instructions for the hardware to run the computer effectively. There is more programming that deals with this but the OS is the biggest part of running the computer.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do? I think i explained what i know pretty well.
  • Is there room for improvement? Yes there is so much more that i could learn
  • Could the measurement process be enhanced to be more effective? Yes it could
  • Do you think this enhancement would be efficient to employ? I think it would be
  • Could the course objective be altered to be more applicable? How would you alter it? No it is fine the way it is.

hpc2 Keywords

Whiptail

Definition

whiptail is a program that will let you present a variety of questions or display messages using dialog boxes from a shell script. Currently, these types of dialog boxes are implemented: yes/no box, menu box, input box, message box, text box, info box, checklist box, radiolist box gauge box, and password box.

Demonstration

Demonstration of the chosen keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

#! /bin/bash
if (whiptail --title "PPP Configuration" --backtitle "Welcome to my example" --yesno "
Do you want to configure your PPP connection?"  10 40 )
then 
        echo -e "\nWell, you better get busy!\n"
elif    (whiptail --title "PPP Configuration" --backtitle "Welcome to
my example" --yesno "           Are you sure?" 7 40)
        then
                echo -e "\nGood, because I can't do that yet!\n"
        else
                echo -e "\nToo bad, I can't do that yet\n"
fi

The code you see above should produce a nice display of yes and no choices.

Troubleshooting

Definition

This is where you do step by step processes to solve an issue. If you have some sort of error with in a program or with the computer itself, you go through common fixes that will hopefully come to a solution. You are basically ruling out any simple error that can be fixed and determine if there is a major issue that you can not just simply solve.

Demonstration

There is not much to demonstrate other then stating some simple troubleshooting methods like doing a hard reset of the computer, defragmentation, disk cleanup, re install OS, and there are many other methods.

Stand Alone Testing Mode

Definition

This is obviously a mode to test out a program in and/or a script. When it says standalone it is stating that no other programs/hardware are needed to test this program. It may only need the OS and nothing else to aid in its run time. It is nothing but verifying the input given from front end is correctly stored in data base are not.

Demonstration

I honestly have no idea how to properly stand alone test other than to just run the program that is currently being worked on in one area to make sure everything runs correctly.

User Deletion Logic

Definition

Reference to a record that remains in the database, but is not included in comparisons or retrieved in searches. So a user is able to delete some form of data but it was always be there stashed away in the database, it most likely can be brought back easily.

Demonstration

There is really no demonstration that can be done other then it gets deleted, however you delete it. It can be found though going through your sub version repository.

Source (command)

Definition

The source command can be used to load any functions file into the current shell script or a command prompt. It can read and execute commands read from a file and will return. The pathnames in $PATH are used to find the directory containing a file. If any arguments are supplied, they become the positional parameters when a file is executed.

Demonstration

Demonstration of the chosen keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

#!/bin/bash
# load myfunctions.sh function file
source /home/vivek/lsst2/myfunctions.sh
 
# local variable
quote="He WHO Sees me in all things, and ALL things in me, is never far from me, and I am never far from him."
 
# invoke is_root()
is_root && echo "You are a superuser." || echo "You are not a superuser."
 
# call to_lower() with ${quote}
to_lower ${quote}

Code Reuse

Definition

The practice of using the same segment of code in multiple applications. This can be accomplished in many different ways, such as distributing source code, using an operating system's compiled libraries, etc.

Demonstration

No real demonstration other then to state like a windows OS or linux. If you look at earlier versions it is the same just update with new programs and features.

Production Enviroment

Definition

This term is generally used in reference to a “test environment”. The production environment is the set of resources and controls directing them to provide a “live” service - such as a web site, a transaction processing system or a running operating system which users can log into and get work done.

Demonstration

There is no real demonstration to show, its just a place for the user to get work done without any issues.

Getent

Definition

a unix command that helps a user get entries in a number of important text files called databases. This includes the passwd and group databases which store user information – hence getent is a common way to look up user details on Unix. Since getent uses the same name service as the system, getent will show all information, including that gained from network information sources such as LDAP.

Demonstration
lab46:~$ getent group
dmckinn2:*:5751:dmckinn2
dsherbur:*:5752:dsherbur,wedge
jbamper:*:5753:jbamper,wedge
jcavalu3:*:5754:jcavalu3
jpettie:*:5755:jpettie,wedge
mfaucet2:*:5756:mfaucet2,wedge
mpage9:*:5757:mpage9
rhensen:*:5758:rhensen,wedge
rmatsch:*:5759:rmatsch,wedge
rsantia4:*:5760:rsantia4,wedge
skinney1:*:5761:skinney1,wedge
smalik2:*:5762:smalik2
tedmist1:*:5763:tedmist1,wedge
thakes3:*:5764:thakes3,wedge
zmccann:*:5765:zmccann,wedge
eryan3:*:5766:eryan3,wedge
jferrito:*:5767:jferrito
ta018998:*:5768:ta018998
mcantin3:*:5769:mcantin3
ahazen:*:5770:ahazen
csit2310:*:5771:csit2310
...

There was a huge list of groups but this is the output that would show.

hpc2 Objective

hpc2 Objective

demonstrate scripting skills to automate tasks

Definition

I believe this is saying just being able to write a working program in shell that can do some sort of task.

Method

I'll just show an example of a shell script and describe it for you.

Measurement
  1 #!/bin/bash
  2 #
  3 # This script will output information regarding user login and information
  4 #
  5 echo "Hello this script will show the last utility in action"
  6 sleep 5;
  7 echo "This is going to show successful logins, most bad logins, who contacte    d lab46 the most and who contacted lab46 the least amount in the month of de    cember"
  8 sleep 5;
  9 echo "Successful logins: `last -f /var/log/wtmp | grep "Dec" | wc -l`"
 10 sleep 5;
 11 echo "All bad logins: `lastb -f /var/log/wtmp | grep "Dec" | wc -l`"
 12 sleep 5;
 13
 14 exit 0

In this code it will be taking the task of last and implementing so i actually have power to manipulate text that appears when i run the ps command.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do? I could have done better
  • Is there room for improvement? Always
  • Could the measurement process be enhanced to be more effective? Yes it can
  • Do you think this enhancement would be efficient to employ? Yes i would
  • Could the course objective be altered to be more applicable? How would you alter it? No its fine the way it is, just need to expand more on it. Its a little unclear.

Experiments

Experiment 1

Question

How Does Whiptail work in the linux enviroment?

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

State your rationale.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

Experiment 2

Question

Is there a way to read and connect data from different files of scripts into one script?

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

State your rationale.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

Experiment 3

Question

What is the question you'd like to pose for experimentation? State it here.

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

State your rationale.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

opus/spring2012/dgirard3/part1.txt · Last modified: 2012/02/28 15:27 by dgirard3