User Tools

Site Tools


opus:spring2012:bkenne11:start

Brandon Kennedy's Spring 2012 Opus

Welcome to the fun!

Introduction

This is a story all about how I got turned into a programming hound And I'd like to take a minute and sit right there And tell you how i became the prince of the BDC Lair

In west horseheads i was born and raised On the computer was where I spent most of my days gettin high scores and chomp'n up coins commander keen was my, closest boy

When a couple of guys who were upto no good startin' makin' trouble in my neighborhood I got in one LARP fight and my mom got scared she said you're gonna go to college they can, help you there.

I whistled for my teacher and when he came near his shirt said nerd and he beard said weird If anything i could say this lad is rare but i though nah forget now on the the Lair

I walked into the Lair about 7 or 8 And i yelled to a guy yo homes where I sit he looked at me weird like his mind was, kinda flat I later learned his name was, brian black

Part 1

Entries

Entry 1: January 26th, 2012. 11:10 PM EST

I am pretty sure that this is going to be the ONLY class I enjoy this semester. Physics is so nit-picky it is driving me crazy and the first week isn't even over! Then there is biology… If you put my first weeks bio notes in a book it would be the size of the websters exhaustive concordance.

Let's just get this project moving, I can't wait to learn the very basics, the fundamental parts of the foundation if you will.

Entry 2: February 8th, 2012 EST

Today was an epic day to say the least. Today we ventured into the crazy land of flipflops which pretty much flipfloped my mind. Since I was the one to bring up starting flipflops I got to code the first flip flop and I tell you what, it was insane! Not that the code was anything durastic. It wasn't 500 lines long, and it didn't use a bunch of strange libraries that noone had ever heard of before, it was that the logic didn't make sence. Beow is an example of a NAND flipflop:

include "nandff.h"
 
NANDFF::NANDFF() //NANDFF constructor
{
        mynandgate = new NAND();  //instantiation of a NAND gate
        mynandgate2 = new NAND(); //second NAND gate
        mynotgate = new NOT();    //Not gate
}
 
 
bool NANDFF::Q() //here is where the magic begins!
{
mynandgate -> setA(A);
mynandgate -> setB(mynandgate2 -> getX());
mynandgate2 -> setA(mynandgate -> getX());
mynandgate2 -> setB(B);
 
return(mynandgate -> getX());
} //bool Q is the output of the NANDFF that is not negated.
 
bool NANDFF::NQ()
{
mynandgate -> setA(A);
mynandgate -> setB(mynandgate2 -> getX());
mynandgate2 -> setA(mynandgate -> getX());
mynandgate2 -> setB(B);
 
mynotgate -> setA(mynandgate -> getX());
 
return(mynotgate -> getX());
} //likewise NQ is the negated output of NANDFF.

Does this make any sence to you? It makes sence to me, I just don't totally get it!

Entry 3: February 24th, 2012 11:39 EST.

It is amazing how an internet meem can help you understand a computer science topic. We used long cat(turned into long worm) to describe the concept of an infinite tape. And when you understand the joke about long cat being reeeeeally long, or pretty much infinate in our understanding, it make so much sence! Anyways, we have been working from the top down lately trying to make sence of the menu that will be displayed. This is really helpful because we start to realize what functions we need and at what level they need to be developed, so we can develop our base logic into the bigger parts. An example of this is finding out what type of registers we will need, and how many, and then using our base logic to build those types of registers. our menu looks like this:

while ((input != 8)&&(snap != 'y'))
        {
                printf("Computer Simulator Menu, yo\n\n");
                printf("1) Enter Program\n");
                printf("2) Run Program\n");
                printf("3) Single Step Program\n");
                printf("4) Load from File\n");
                printf("5) Save to File\n");
                printf("6) Memory Dump\n");
                printf("7) Register Display\n");
                printf("8) Exit\n");
                printf("Please enter your choice: ");
                cin << input:
                switch (input)
                {
                        case 1:
                                printf("Enter memory address to start at: ");
                                cin << hexnum;
                                //
                                break;
                        case 2:
                                printf("Enter hex address to run at: ");
                                cin << hexnum;
                                //
                                break;
                        case 3:
                                printf("Enter hex address to run at: ");
                                cin << hexnum;
                                //
                                break;
                        case 4:
                                printf("Enter file name to load program from: ");
                                cin << filename;
                                //
                                break;
                        case 5:
                                printf("Enter file name to save to: ");
                                cin << filename;
                                printf("Enter program starting address to save to file '%s'", &filename);
                                cin << hexnum;
                                //
                                break;
                        case 6:
                                //print out a listing of hex addresses used in current programs
                                //dump all da crap
                                break;
                        case 7:
                                //print out the contents of all the registers and the hex address  for the cpu
                                break;
                        case 8:
                                break;
                        default:
                                printf("Invalid option");
                                //reprint menu
                }

Entry 4: February 28th, 2012 at 12:00 PM EST

Over the last week we have been covering our menu, a bit on registers, and the turing machine. First off is our menu, which i posted a copy of in my last entry. It hasen't developed very much, but i plan top develop it more tomorrow(wednesday), so that we can create logic to print out register addresses and contents, dump memory and exit out of the menu loop when 8 is pressed. Maybe even develop the inner menues of each case a little bit more. Now on to turing, the unstable autistic! Genious or madman? or both? Turings special case of autism led him into a whole new world of intelligence. He could imagine and remember whole elements of a “computer system” in his head. He created to touring machine out of pure imagination fabrication, meaning it was all in his head. This touring machine ran by a not so complex, but exhaustive set of symbols that I still don't really understand. The logic is a bit beyond my comprehension without writing it down, I can't do it all in my head :p

Keywords

asm Keywords

asm Keyword 1: Rgisters Part One

Registers (General Purpose/Integer, Floating Pointer, Accumulator, Data)

Definition

Registers are a small amount of storage used by a processor. They are like a series of data boxes that can be used to store data for use for arithmetic, manipulation, or testings by some machine instruction. They allow processors quick-access of pieces of memory they may use frequently, allowing for quick access because the processor doesn't have to continually fetch that data from the hard-disk or RAM.

Accumulator

An accumulator is a type of register that allows for quick storage and access of data that was used for arithmetic, or is created as result of arithmetic. Without accumulators the CPU would have to write each arithmetic action to the main memory storage, only to sometimes be immedietely re-used for something else, causing the processor to access the main memory more than needed.

asm Keyword 2: Registers Part Two

Registers (Stack Pointer, Program Counter, Flag/Status)

Definition
Stack Pointer

A stack pointer is a special type of register that points to the top of the stack. This thpe of register is usually called a Frame Pointer and is set up to point to a fixed location in the frame structure.

Program Counter

A program counter is a processor register that tells the computer where it is in it's instruction sequence. This type of register can hold either the memory address or the current instruction to be executed, or the next instruction to be executed. This register is usually incremented automatically after a program instruction is grabbed, this makes the cpu retrieve instructions sequentially from memory.

These memory addresses can contain jump instructions and returns which allow the set sequence to be interupted by telling the cpu to look at a new memory location for it's next access point.

flag/status

This type of register is a collection of flag bits for a processor. It contains information about the process state. Individual bits are read and/or written by the instruction execution on the processor. A status register can have many fields, but the classic design includes at least these three: Zero, Carry, and Overflow.

The most common flags
ZZero FlagIndicates that the result of an arithmetic or logical operation (or, sometimes, a load) was zero.
CCarry FlagEnables numbers larger than a single word to be added/subtracted by carrying a binary digit from a less significant word to the least significant bit of a more significant word as needed. It is also used to extend bit shifts and rotates in a similar manner on many processors (sometimes done via a dedicated X flag).
S/NSign flag / Negative flag Indicates that the result of a mathematical operation is negative. In some processors,[1] the N and S flags are distinct with different meanings and usage: One indicates whether the last result was negative whereas the other indicates whether a subtraction or addition has taken place.
V/O/WOverflow flagIndicates that the signed result of an operation is too large to fit in the register width using twos complement representation.
PParity flagIndicates whether the number of set bits of the last result is odd or even.

asm Keyword 3: Register Part Three

Registers (Index/Pointer)

Definition

An index register is found in the CPU and is used for modifying operand addresses during a program, usually for vector or array operations. This process register is used for indirect addressing where an immediate constand is forced into the contents of a register to form the address to the actual operand or data.

This type of register was implemented around 1955-1964.

asm Keyword 4: Logic Operations

AND, OR, XOR

Definition

Logical operations are called boolean logic, a logic of truth values. The boolean algebra laws can be defined axiomatically because axioms, along with there theorems provide for every possible assignment of 0 or 1 to their given variables.

This is because boolean algebra is based around the thought of two variables. usually taken to be T & F or 0 & 1. To understand this boolean logic, it really doesnt matter if you use T&F, 1&0, or Sneeches w/ stars and Sneeches w/o stars, as long as you have 2 independant variables.

AND

The AND operation can be thought of as multiplication. when you multiply 0 by 0, what do you get? 0. when you multiply 1 by 0, what do you get? 0. 1 by 1? 1. That is the basis behind an AND gate, and this logic develops a truth table like so.

ABoutput
111
100
010
000
OR

The OR operation can be though of as addition, sorta ;). When you add 0 to 0 you get 0, 1 to 1 you get 1, 0 to 1 you get 1. In any case this means that if A, B or AB is 1, you get a one.

ABoutput
111
101
011
000
XOR

Not sure how to explain this one mathmatically, but it works like this. If A or B is 1 but not both, then the output is one. Else the output is 0.

ABoutput
110
101
011
00

asm Keyword 5: Logical Operations cont.

NOT, NAND, NOR, XNOR

Definition

A negated operation. The output of this operation is the opposite of its non-negated couterpart. Look at keyword 4 :p

NOT

A NOT operation is the basis behind a negated operation. This basically means that if the input was one thing, it comes out the other. If you put in a 1, you get a 0. Put in a 0, get a one.

Aoutput
10
01

A NAND operation, as well as NOR and XNOR build on the the not operation.

NAND
ABoutput
110
101
011
001
NOR
ABoutput
110
100
010
001
XNOR
ABoutput
111
100
010
001

asm Keyword 6: Boolean Arithmetic

Boolean Arithmetic Operations (Addition, Subtraction, Multiplication, Division)

Definition

Boolean algebra is a type of arithmetic based off from two variables. The operations to be discussed are addition, subtraction, multiplication and division.

Let's start with subtraction because in boolean algebra, it doesn't exist. The existance of subtraction implies the existance of negative numbers, which are a no no in boolean.

Division, like subtraction, doesn not exist either. The reason for this is because division is really just compunded subtraction, like multiplication is compounded addition.

Addition does exist, it's not like boolean algebra is some messed up alternate reality, it is just a better reality where life is much more simple.

With that beaing said, boolean addition works like so: 0 + 0 = 0 (ok, so far so good) 0 + 1 = 1 (I think i can handle this Pre-k math) 1 + 1 = 1 (Say Whaaaaaaat?) 1 + 1 + 0 + 1 = 1 (someone's been on the bottle)

Because boolean algebra is made up of just 1's and 0's, there is no 2 or 3. Thefore when we add 1 + 1, it can't be zero, so it has to be one by process of elimination.

Multiplication also exists, and makes perfect sence. 0 x 0 = 0 1 x 0 = 0 1 x 1 = 1 Simple as that.

Boolean algebra though does not tend to use 1's and 0's, it uses letters, normally A and B.

asm Keyword 7: instruction sets

Instruction Sets (CISC, RISC)

Definition

Complex instruction set computer or reduced instruction set computer is a type of computer when one instruction can run multiple low-level operations such as arithmetic or memory storage and retrieval.

Demonstration

Demonstration of the chosen keyword.

Instruction: store A +B in A. Operations involved:

  1. retrieve A
  2. retrieve B
  3. add A + B
  4. store answer in A

And even so many other sub-operations are going on inside of operations like add A+B because register called accumulators are involved in storing A and B and their result as things are manipulated.

asm Keyword 8: Subroutines

Subroutines (Calling, Return Address)

Definition

A subroutine is a snippet of code within a larger program that executes one specific task that is entirely dependant of the remaining code. Subroutines are also called subprograms and as you can imagine, it is because they act as programs inside of a program. These subprograms are usually programmed so that they can be easily called multiple times within a program without re-writing the code over and over.

An example of a subroutine is a method that computes a logorithm or a matrix determinate. The method can accept 0 or more inputs and return 0 or 1 things.

These subroutines are often grouped into structures called libraries so that a large grouping of them can be easily accessed.

Demonstration
#include <stdio.h>
#include "library of subroutines"
int main()
{
    print "please enter a logarithm base"
    save input1
    print "please enter a second number for the logarithm"
    save input2
    answer = logarithmsubroutine(input1, input2)
    print "answer is 'answer'"
    return(0);
}

asm Objective

asm Objective

Experience using registers, stacks, and branches

Definition

Understand how registers, stacks and branches are made and used. Familiarity by experience using registers.

Method

So far we have been understanding them by reading up about them, asking questions, actually getting into building registers from flipflop. I believe the best way to understand all of these topics is to actually build them and understand their functionality.

Measurement

So far so good, we have started to build flipflop so that we can build registers. This has already helped me to start to grasp what a register really is and how one works. I have done a lot of reading on registers for opus keywords and will be asking a lot of questions in class tomorrow.

Analysis

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

  • How did you do? Really good so far, i have learned a lot about flipflops and how they are used to construct register, adders and other things.
  • Is there room for improvement? there is always room for improvement.

Experiments

Experiment 1

Question

Does the Nvidia 9800 from the church video PC still function after it crashed? can the drivers be re-done or it it toast?

Resources

Hypothesis

I think that the card will be toast, and that the computer will not boot properly when the card is installed, and that it is beyond help.

There were two video cards running simultaneously in the computer when one of them failed. It took took the operating system with it.

Experiment

stupidly, I am going to stick it in a computer tower that I have and see if:

  • The computer will boot. if so:
  • The graphics display normally. if so:
  • Can the drivers be installed and the card operate correctly under intense situations such as skyrim, WoW, eve and other MMORPG's.

Data

The computer not only booted up, but the graphics card displays fine!

Analysis

Based on the data collected:

  • Was your hypothesis correct? nope
  • Was your hypothesis not applicable? nopt
  • Is there more going on than you originally thought? appearently
  • What shortcomings might there be in your experiment? testing the computer the card failed on for other issues i guess!

Conclusions

Based on the data collected by this experiment, i can ascertain that the video card is totaly fried, but I still want to try it in another computer, or dual booting to see if the other card will run so i can do diagnostics on the first card.

Experiment 2

Question

What is causing the security camera computer to shut down and restart randomly? what caused the cmos to change by 4 minutes and lose the boot sequence it had?

Resources

Hypothesis

Based on my research I believe the the cmos lost the boot sequence because the cmos battery is shot, and there is a cmos capacitor that is malfunctioning.

Experiment

Pull open the case and check the cmos battery. If it is shot, then check the capacitor.

Data

Cmos battery is shot, can't find the capacitor that should be on the board. I'll have to do more extensive research to find out why the computer is shutting down, but i think it is related to the cmos and bios issues.

Analysis

Based on the data collected:

  • Was your hypothesis correct? Partially
  • Was your hypothesis not applicable? slightly, it is possible that the cmos and shutdowns are not related.
  • Is there more going on than you originally thought? Possibly
  • What shortcomings might there be in your experiment? not sure
  • What shortcomings might there be in your data? not sure at this point

Conclusions

I can conclude that there is most likely a cmos issue because of a dead cmos battery, and that the loss in cmos might have affected the boot sequence to chance, possibly affecting the bios aswell.

Experiment 3

Question

Can HDMI be directly converted to DVI through an adapter, or do you need more intelligence inbetween?

Resources

googling hdmi to dvi adapters

Hypothesis

It only takes an adapter, nothing special.

Experiment

I'm going to buy an adapter and see what happens!

Data

Well would you look at that! It only takes an adapter.

Analysis

Based on the data collected:

  • Was your hypothesis correct? Yes
  • Was your hypothesis not applicable? no
  • Is there more going on than you originally thought? nope!
  • What shortcomings might there be in your experiment? yes, a lot finer detail to the conversion that you cannot easily see
  • What shortcomings might there be in your data? possible

Conclusions

I can ascertain that matt haas must have been thinking of something else, and that it only takes an adapter to convert hdmi to dvi.

Part 2

Entries

Entry 5: March 16th, 2012 3:40 EST. BDC Lair, 34% moon

Today was a fun-filled talk about instruction sets. We are in the process of creating an instruction set forour 6502 wannabe.

Each instruction is allocated 4 bytes of memory, and are laid out as follows.

instructionfirst bytesecond bytethird bytefourth byte
and000.00.00.x00.xxxxxxxxxxxxxxxxxxxxxx
or001.00.00.x00.xxxxxxxxxxxxxxxxxxxxxx
not010.00.xxx00.xxxxxxxxxxxxxxxxxxxxxx
if/branch011.00.xxxxxxxxxxxbranch addressbranch address
move100.xx.xx.xxxxxxxxxxxxxxxxxxxxxxxxx

These are not yet fully developed, as you can see by move and others, but they are great progress!.

I also started to develop my schedule for next semester. It looks like I will be taken hpc1, hardware 101, electricity 101, and another computer course that yet again has slipped my mind! that should be 13 credits, so financial aid? i think so!

March 28th, 2012; 10:25 EST

This weeks experiences haven't been fun filled, but I have certainly learned a lot. Maybe it is time for a little recap:

Storage: Volatile vs. Non-volatile.

Volatile memory refers to short term memory, such that is only kept when there is power to the memory. An example of this type of memory is RAM, which is used to store information temporarily while the computer is running. An example of this RAM is CPU RAM, which is used as quick access storage for the CPU.

Non-Volatile memory refers to long term memory, such that is kept whether there is power to the computer or not. An example of this type of memory is your hard drive, where most of your computers information is stored.

Understanding the difference between these two helps to shed light on what RAM is used for. Since the RAM is cleared every time the computer is powered off, it must hold information that is created when the computer is started, or when a program is started, but does not affect the programs start-up. In other words it does not contain any of the instructions for the computer of it's programs, just the information they create that is pertinent to it's current running state.

Entry 7: March 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.

Entry 8: March 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.

Keywords

asm Keywords

Data Bus

Definition

An internal element that transfers data between computer components, or between computers.

Demonstration

A bus is a way to connect a peripheral device for data transfer. They have evolved from a different card for every peripheral to universal busses to connect many different peripherals through the same bus. These busses can range from a system bus, to attach a cpu, to a universal serial bus to connect anything from a mouse or keyboard to another harddrive.

Few more examples:

  • USB
  • SYSTEM BUS
  • SATA PORT
  • ATA PORT
  • VGA PORT
  • CONSOLE PORT
  • etc…

Address Bus

Definition

An address bus is a computer bus that is used to specify a physical address. When a processor needs to read or write to a memory location it specifies that memory location on the address bus.

Demonstration

Early processors used to you a single wire for each address bit that it sent, meaning a 32 bit address bus used a 32 wire connector. This was soon replaced by cutting the address in half and sending it in two waves, cutting a 32 bit address bus down to a 16 wire strip.

The width of the address bus determines the amount of memory a system can address.

interrupts

Definition

An asynchronous signal that indicates the need to look at a certain event or tell running software to change its execution.

Demonstration

Hardware Interupt:

  • Causes the processor to save its state of execution and begin execution of an interrupt handler.

Software interupt:

  • Implemented as instructions in the instruction set, which cause a context switch to an interrupt handler similar to a hardware interrupt.
  • A signal to the system from an event that has originated in hardware, such as the pressing of a key on the keyboard, a movement of the mouse or a progression in the system clock.

Stack operations

Definition

Stax yo! a stack is a last in, first out data gobbling beast! Also called a LIFO if you must. These work like a stack of papers. The last page you set on the stack is the top page, and you cannot access any of the pages below without first moving/removing the pages above it. They are commonly implemented using a linked list, but can also be implemented by use of an array.

There are three common stack operations, and they are as follows:

  • push - add a node to the top of the list
  • pop - remove the top node from the list
  • peek - display the value of the top node
Demonstration
#include"stack.h"
 
Stack *push(Stack *notes, int val)
{
        Node *stick;
        stick=(Node *)malloc(sizeof(Node));
        stick -> value = val;
 
        if(notes -> top == NULL)
        {
                notes -> top = notes -> bottom = stick;
        }
        else
        {
                notes -> top -> prev = stick;
                stick -> next = notes -> top;
                notes -> top = notes -> top -> prev;
        }
        return notes;
}

Machine Word

Definition

It's a bunch o' bits wrapped up all nice and neat for a computer to read, like an instruction of sorts. The number of bits in a word(size, width, length) is defined by the proccessor design, or the computer architecture. The size of a word reflects the computers operation. Registers are often word sized, and the largest peice of memory that can be moved into working memory is the size of word. Common sizes today are 32 and 64 bit.

Depending on how the computer is structured, units of the word size can be:

  • Integer numbers
  • floating point numbers
  • addresses → holders for memory addresses
  • registers → processor registers
  • memory-processor transfer
  • unit of address resolution
  • instructions → machine instructions

Storage

Definition

Puttin stuff in spots to keep it for a while. The retension of information.

short term

  • Volatile memory
  • Lost when power is yanked from the wall in a TMNA(teenage mutant ninja aliens) rage
  • examples are ram and cpu ram

long-term

  • non-volatile
  • does not rely on power to save information
  • examples are hard drive and cmos

subroutines

Definition

A portion of code running inside a program that has one specific purpose and is relatively independant of the rest of the code to be performed.

A subroutine is also called a subprogram, and as that insinuates, it will act much like a program itself, running inside a larger program. A subroutine is usually code that can be called multiple times from multiple places inside the program.

Subroutines are often collected into libraries, and contain programs such as mathmatical computations.

Fetch-Execute Cycle

Definition

The fetch-execute cycle is the basic operation cycle of a computer. This cycle is repeated by the CPU from startup to when the computer is shut down and is the process by which the computer retreives its instructions from memory.

The cicuits used in a fetch-execute cycle are:

  • Program Counter - an incrementing counter that contains the memory address of the instruction to be used next.
  • Memory Data Register - holds data fetched from memory
  • Contol Unit - decodes the instruction in the instruction register and activates needed resources.
  • Instruction Register - holds the instruction just fetched from memory.
  • Memory Address Register - holds the address of the memory to be written to
  • Arithmetic Logic Unit - Does logical and mathmatical operations

So, to break it down:

  • Fetch the instruction
  • Decode the instruction
  • indirect vs. direct instruction
    • indirect - effective address is read from main memory.
    • direct - do nothing
  • Execute the instruction

asm Objective

asm Objective

familiarity with how assembly impacts programming.

Definition

How assembly will impact the styles and flow of programming. How the code is put together in functions.

Method

General discussion on how assembly affects programming. Matt has expressed that assembly and processor commands can affect programming styles by helping to make code more efficient.

Measurement

The only good way to measure this is to review some code that I recently wrote to see if i can relate my new knowledge of assembly and processor instructions to coding styles.

Analysis

I can see how processor commands can affect programming styles. I can not yet really optimize any code or change the flow based on what the processor does/receives, but I believe that by the end of this course I will be able to optimize my code at least a little by being processor sensitive.

There is deffinitely room for improvement, I think I need to do some research on assembly commands so that I can better understand what the processor is being told because of the code I am writing.

Experiments

Experiment 4

Question

How can an ethernet cable provide power to an end device?

Resources

Hypothesis

Power over ethernet is done by sending a dc current over four of the wires.

Experiment

I will research PoE and find an example of how PoE sends a dc current over the same line that data is sent over. Also, there is a PoE phone in the lair, so i will mess around with that to see it in action.

Data

I hooked an IP phone up to a PoE supplier that adds a dc current to the ethernet cable. I also plugged an active ethernet cable into the PoE supplier so that it was supplying a dc current and an internet signal over the same line.

Wikipedia displays a great table that shows the pins used in a PoE setup for both 10/100 and gigabyte PoE connections.

Analysis

Based on the data collected:

  • Was your hypothesis correct? yes
  • Was your hypothesis not applicable? no
  • Is there more going on than you originally thought? A little bit, PoE doesn't just send a dc signal over the lines, there is a standard as to which wires are used. The amount of power sent is always 36watts.
  • What shortcomings might there be in your experiment? I don't know of any, but i could always lick the end and find out.

Conclusions

PoE is a very powerful tool that can be very useful when there are a lot of IP phones or wireless access points that need to periodically be reset. All one has to do is simply reboot the source of the ethernet cables and all end devices will be reset.

Experiment 5

Question

If I am connected to a gigabyte switch that has a dedicated line from roadrunner, will the download/upload of my computer by a gigabyte?

Resources

Hypothesis

I can only reach speeds of 100mbps or whatever the incomming line allows me to reach.

Experiment

I will hook my laptop up to a gigabyte router and do speed testing like speedtest.net, command prompt things to check speed rates, and network and sharing center.

Data

Speedtest.net claims 96mbps, 100mbps and 92mbps. network and sharing center claims anywhere from 56-400 mbps depending on what i'm downloading. command prompt, essentially doing the same thing speedtest.net, claims about 92-98mbps.

Analysis

Based on the data collected:

  • Was your hypothesis correct? Yes! I received speeds of up to 100mbps
  • Was your hypothesis not applicable? no
  • Is there more going on than you originally thought? not that i can see
  • What shortcomings might there be in your experiment? testing with gigabyte capabilities.
  • What shortcomings might there be in your data? none that i know of.

Conclusions

Your connection speed is based on your hardware/connection. If everything allows 1000mbps, then you could essentially get 1000mbps. If you have a 1000mbps connection, and only a 100mbps port, then you will only get 100mbps.

Retest 2

Perform the following steps:

State Experiment

David Schoefflers experiment on autp typed variables. http://lab46.corning-cc.edu/opus/spring2012/dschoeff/start#experiment_2

Resources

Evaluate their resources and commentary. Answer the following questions:

  • Do you feel the given resources are adequate in providing sufficient background information? Yes, he provided the source page for the auto variable
  • Are there additional resources you've found that you can add to the resources list? yes, but they are unneeded because the actual source was provided.
  • Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment? yes
  • If you find a deviation in opinion, state why you think this might exist.

Hypothesis

State their experiment's hypothesis. Answer the following questions:

  • I believe you will not be able to declare the auto typed variable without initializing it.
  • Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover? yes
  • What improvements could you make to their hypothesis, if any? not that i can see

Experiment

Follow the steps given to recreate the original experiment. Answer the following questions:

  • Are the instructions correct in successfully achieving the results? yes
  • Is there room for improvement in the experiment instructions/description? What suggestions would you make? a little example of what compiler/compiler attributes would be nice
  • Would you make any alterations to the structure of the experiment to yield better results? What, and why? nope, the experiment is adequate to what needs to be tested.

Data

Publish the data you have gained from your performing of the experiment here.

 1: #include<iostream>
 2:
 3: using namespace std;
 4:
 5: int main()
 6: {
 7:    auto autovar;
 8:    cout << "enter value to put in auto typed variable: " ;
 9:    cin >> autovar;
10:    cout << "value stored in auto typed variable - > " << autovar << endl;
11:
12:    return (0);
13: }

I ran the same code and received the same errors in compiling

lab46:~$ g++ --std=c++0x autotest.cc -o autotest
autotest.cc: In function 'int main()':
autotest.cc:7: error: declaration of 'auto autovar' has no initializer
lab46:~$

Analysis

Answer the following:

  • Does the data seem in-line with the published data from the original author? yes
  • Can you explain any deviations? none exist
  • How about any sources of error? in using the same exact code, there are no deviations or errors.
  • Is the stated hypothesis adequate? yes.

Conclusions

Answer the following:

  • What conclusions can you make based on performing the experiment? the auto typed variable is very powerful, but follows most of the same rules as other variables.
  • Do you feel the experiment was adequate in obtaining a further understanding of a concept? yes
  • Does the original author appear to have gotten some value out of performing the experiment? yes
  • Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author). The hypothesis was very direct, and the experiment was comprehensive, so i do not believe their are any suggestions to be made, other than maybe a little documentation along with the code, especially about the way it was compiled.

Part 3

Entries

Entry 9: April 19th, 2012: 3:50 PM EST

Todays learning expendentures invloved von neumann vs. harvard architecture comparisons. The part that stuck out to me the most was how similar they are while being so different. The von neumann architecture can either be reading an instruction or reading/writing data to/from the memory. They cant both happen at the same time because the instructions and data use the same system bus; whereas the harvard architecture, ceteris paris, just separates the reading to two separate system busses so that different types of processing can be done simultaneously.

Also, I did a little bit on binary vs. hex representation. Just a little spiel on base 16 vs. base 2 and base 10 for decimal. Also showed how to convert between binary, decimal and hex.

Bit Placementbit 8bit 7bit 6bit 5bit 4bit 3bit 2bit 1
Value128643216 8 4 2 1
DecimalHexadecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111

Entry 10: April 21st, 2012

I/0, input/output, taking stuff in and pushing stuff out. The part that stuck out to me the most was how easy it was to relate input and output for a person to a computer. Computer input/output involves any peripheral devices such and a mouse, a keyboard, a printer, a monitor, etc… Just as a person has input like sight, sound, touch, smell, and taste.

Also, a cpu has input/output because the processing it does receives information, does something, and spits the information out. This relates to our cpu, our brain, receiving input and sending output. Kinda lame, but it was cool to see the similarities, and nothing else really stood out.

Entry 11: April 27th, 2012 5:04 EST

Been working on binary manipulation programs for a couple days now. Creating functions to increment(add one), decrement(subtract one), lshift(shift to the left one digit) rshift(shift to the right one digit) and a few others. The purpose of these manipulations is to implement them in use with registers. Once i finish them I will make a few registers(arrays filled with bits) and perform some manipulation on them with the functions I created in an attempt to simulate processor functionality. Tomorrow I will probably create load and store so that i can go from registers to memory(store) and memory to registers(load) so that i can get even further into the cpu simulation.

The way I have done my binary manipulations is a little different though, as it does not directly implement a carry. While the algorithm indirectly uses a carry in most of the functions, not all implement a carry in use, just in theory. So some of my functions, like increment, look a little different becasue there is no carry, like so:

void increment(char *array)
{
        int i;
        for(i=7;i>=0;i--)
        {
                if(array[i] == 0)
                {
                        array[i] = 1;
                        break;
                }
                else
                {
                        array[i] = 0;
                }
        }
}

Entry 12: May 1st, 2012

I think I will dedicate this dated entry to the people outside the MLC window screaming about how the government is trying to brainwash them while they pay way too much for college. I would write about something else, but I can't concentrate because they are TOO LOUD.

Todays work was all about boolean logic. I made a comparrison between true and false boolean and 1 vs. 0. I made two different programs to compare boolean values of true and false to 1 and 0. They set a boolean value to one and zero and then compared those values with boolean values of true and false. I know I am just saying the same thing over and over, but I don't really have anything else to say.

asm Keywords

von neumann vs. harvard architecture
Definition

A battle between computer architectures.

The harvard architecture has completely separate storage and signal pathways for instructions and data. This architecture stored all data within the CPU, and had no access to the instruction storage as data. All programs were loaded by a person. This means that the cpu can both read an instruction and perfom a data memory access at the same time, without a cache. The harvard architecture also has distinct data address spaces: instruction address zero is not the same as data address zero.

In contrast, the von neumann architecture can either be reading an instruction or reading/writing data to/from the memory. They cant both happen at the same time because the instructions and data use the same system bus.

The harvard architecture would be faster because instruction fetches and data access do not contend for a single memory pathway.

Binary and Hex number representation
Definition

The representation and conversions of/between hexadecimal, binary and decimal numbers.

Each digit in a binary number is called a bit, which form a byte when 8 bits are wrapped together. These bytes can take on the form of any combination of a “1” and a “0”, such as 10110010 or 00001001. This number system is called base 2, because is only has two different characters in its representation.

Below is a layout of the positioning of a binary byte.

Bit Placementbit 8bit 7bit 6bit 5bit 4bit 3bit 2bit 1
Value128643216 8 4 2 1

Therefore, with a binary number like 10011101, we get:

binary number10011101
ad up the place values of the ones12800168401

decimal equivalent is: 157

In hexadecimal, four bits is represented by a single digit. Since 4 bits gives 16 possible combinations, 0-9 are used along with A-F to represent the characters, meaning that hexadecimal must be base 16.

Below shows a relationship between hex, binary, and decimal.

DecimalHexadecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111

For example, the number D93A is two bytes of data: 1101 1001 0011 1010. In decimal, 1101=13 + 1001=9 + 0011=3+ 1010=10 = 35.

Processor & Memory Organization
Definition

The major parts of a CPU are:

  • Registers
  • Flags
  • ALU
  • Buses
  • Control unit

The structure of these CPU's usually follows this scheme:

The Control unit acts as sort of a interfact to the outside via pins then buses. Then on the inside it communicates with the registers and the ALU, which can communicate with each other, or something like that.

Memory is organized into a two main different areas: On the CPU: Registers/RAM. Off the CPU: RAM, Harddrive, CD, Flash memory.

Control and Data Flow
Definition

Control flow literaly refers to controlling the flow of the program, or in what order the instructions of a program are executed in. A controlflow statement would have a condition that, based on the outcome of the condition, tells the program to do down one of two paths. In assembly, this control flow is based on a program counter. For most CPU's, the only control flow instruction available is a branch instruction.

if(day == monday)
{
    go get groceries;
}
else
{
    write down what groceries you need to get on monday;
}
Data Instructions

(Data Movement, Address Movement, Data Conversion, Bit Manipulation)

Definition
Data Movement

Data movement between registers and memory. This could be moving any peice of data from memory to a register in order to manipulate it, or loading an address from memory into registers so that it can be loaded.

Data Conversion

Converting between data encoding schemes such as Ascii, unicode and morse code. All of which are just a character pattern to represent a series of bits. This can be something as simple as a software upgrade from version 1.0 to 1.2.

Bit Manipulation

Bit mainpulation deals with manipulating a sting of binary bits. This includes functions like:

  • Increment
  • Decrement
  • Shift left or right
  • Roll left or right
  • AND, NOT, OR, XOR

Programming languages allow programmers to deal with high level representations of bit patterns and editing bit patterns via functions as described above like AND and left shift.

I/0
Definition

I/0 or Input/Output is something we do an uncountable amount of times a day. We are constantly sending and receiving message and signals that tell us how to interact and react to an enviroment. Similarly, it is how a computer communicates with another computer or a human. In other words it is how a computer sends/receives messages/signal/data.

Examples of input devices are mice and keyboards, which the computer receives input in the form of a mouse button press or a key press on the keyboard. An output device would be a printer, monitor or speakers, in which the computer outputs data in the form of sound or words for the user to read. An example of an input/output device is a disk drive or a flash drive. The computer can both read and write data to these devices. For a lower level implementation, the processor inputs/outputs device drivers that run these devices. The processor also provides memory-mapped I/O that is used the low level programming of these drivers.

Data Representation 1

Big Endian, Little Endian, Size, Integer, Floating Point, ASCII

Definition

Endian refers to end, and specifies which end of the number trail is the most significant bit. The twp types on endian are big and little, only differing in the position of the most significant big.

Big Endian

Big endian is where the most significant bit is on the left hand side and move to the right in order of decreasing significance. Therefore in 1010, the one all the way to the left would be the most significant and would represent 8, while the 0 all the way on the right would be the least significant and would represent 1.

Little Endian

Little endian is the reverse of big endian, and implements the common form of a “carry”. In little endian the most significant bit is on the right, while the least significant bit is on the left. Therefore in 1010, the one all the way to the left is now the least significant and represents 1, while the 0 on the right is the most significant and represents the 8.

Integer

An integer is a four byte data type that can be represented as a signed or unsigned range. A signed range allows for negative numbers, while an unsigned range allows for only non-negative numbers 0 or greater, within the size. This size can vary within computer architectures, but is most commonly four bytes.

INTEGER low high
Signed -2,147,483,648 2,147,483,647
Unsigned 0 4,294,967,295

There is four ways to represent a negative binary number, and the most common is two's compliment. For a deffinition of two's compliment look at the key word below labeled “data representation 2”.

Floating Point

Floating point descibes a way to represent real-numbers in a way that can show a wide range of values. These numbers are generally truncated to a fixed number of significant digits and then scaled by an exponent. Floating point means that the decimal point can float around the number, relative to the significant digits, and scaled to an exponent. The base for scaling is usually 2, 10, or 16.

Ascii

Ascii is a character encoding scheme used for information interchange. Ascii, based on the English language, represents text in computers, communications, and anything else that uses text. Ascii text, being an encomding scheme used for information interchange, represents series of bits. for example, the ascii character F is 01010111.

Data Representation 2

Sign Representation, One's Complement, Two's Complement

Signed Number Representation

signed number representation deals with encoding for negative numbers in the binary number system. In regular mathematics a negative number is prefixed by a - sign, showing that it is a negative number, but in binary there is no - sign. This is where sign representation methods come in to play.

One's Compliment

The one's compliment form of a negative binary number is a bitwise NOT applied to its positive couterpart. This system has two ways to represent zero: 00000000 which is a +0, and 11111111 which is a -0. As an example, the one's compliment of 00110100 (52) is 11001011 (-52). A byte thus ranges from -127 to +127 with a +-0.

binary valueone's complimentunsigned binary
00000000 0 0
00000001 1 1
00000010 2 2
00001010 10 10
01111101 125 125
01111110 126 126
01111111 127 127
10000000 -127 128
10000001 -126 129
10000010 -125 130
11110101 -10 245
11111101 -2 253
11111110 -1 254
11111111 -0 255
Two's Compliment

In two's compliment there is only one 0, 00000000. Negating a number is done by inverting all bits and then adding 1 to the resulting number. Therefore 01001110 (78) negated is 10110010 (-78) or 10110001 + 1.

binary valuetwo's complimentunsigned binary
00000000 0 0
00000001 1 1
00000010 2 2
00001010 10 10
01111101 125 125
01111110 126 126
01111111 127 127
10000000 -128 128
10000001 -127 129
10000010 -126 130
11110101 -10 245
11111110 -2 254
11111111 -1 255

asm Objective

asm Objective

Familiarity with the role of the C library.

Definition

Understanding the power of the vast resources of the C library. Familiarity with the types of functions in the many libraries, and familiarity with the man page function in order to understand what libraries are needed for what functions.

Method

Testing and improving my knowledge of what libraries are needed for the functions I have used and have knowledge of.

Measurement

I ran through some old programs and made sure I knew what libraries they were found in and I also looked up a listing of a lot of functions in the C library to try and broaden my understanding of what functions are available.

Analysis

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

  • How did you do? There isn't a real way to qauge this, but I did improve my understanding of the functions available through the C library.
  • Is there room for improvement? always is
  • Could the measurement process be enhanced to be more effective? always can be
  • Do you think this enhancement would be efficient to employ? always would be
  • Could the course objective be altered to be more applicable? How would you alter it? Give a more detailed explanation.

Experiments

Experiment 7

Question

Does the Boolean value true equal a 1 or 0 while false equals the other? Can a numeric comparison be made?

Resources

bytes.com → forumns.

Hypothesis

Based on my extensive research(all 5 minutes of it) I believe that the boolean value true can be expressed as an arithmetic 1, which false is 0.

Experiment

I will create a simple program that will add a boolean expression, such as (value == value1) to a number to see if the number increases.

Data

#include<stdio.h>
#include<stdbool.h>
int main()
{
        int i = 1;
        int value = 4;
        int value2 = 4;
        bool check = true;
 
        printf("Before: %d\n", i);
        i = i + (value == value2);
        printf("After: %d\n", i);
        if(check != i)
        {
                printf("David is a awesome");
        }
        else
        {
                printf("chickens are invading the bk lounge");
        }
        return 0;
}

Analysis

Based on the data collected:

  • Was your hypothesis correct? Yes, it was right on target
  • Was your hypothesis not applicable? no
  • Is there more going on than you originally thought? (shortcomings in hypothesis) none that i can see
  • What shortcomings might there be in your experiment? none that i can see
  • What shortcomings might there be in your data? none that i can see

Conclusions

What can you ascertain based on the experiment performed and data collected?

Boolean logic(true or false) can be related to 1 vs. 0. The value true is equal to the value one, while false is equal to 0.

Experiment 8

Question

Can you set a bool equal to 1 and have it represent true? If not what happens?

Hypothesis

Based on the forumns i have read, and past experiments I have done, I believe there is a good chance of it working.

Experiment

Ima write some code that sets a bool equal to 1, and see if it executes as true.

Data

#include<stdio.h>
#include<stdbool.h>
int main()
{
        bool value = false;
        bool check = true;
        value = 1;
        if(value == check)
        {
                printf("Theya re too loud");
        }
        else
        {
                printf("i hate this");
        }
        return 0;
}

Analysis

Based on the data collected:

  • Was your hypothesis correct? yes, yes it was
  • Was your hypothesis not applicable? nope
  • Is there more going on than you originally thought? (shortcomings in hypothesis) not that i see
  • What shortcomings might there be in your experiment? if i knew, they wouldent be in there
  • What shortcomings might there be in your data? if i knew, they wouldent be there

Conclusions

What can you ascertain based on the experiment performed and data collected?

We knew that in the background boolean was just 1 and 0, we just didn't see it anymore because they are set to true or false. Now I can see that nothing really changed, and that boolean is still 1 or 0, they are just equivalent to true or false.

Retest 3

Perform the following steps:

State Experiment

David Schoeffler My final experiment will be whether you can declare an auto variable without initializing it and if so how will it respond. http://www/opus/spring2012/dschoeff/start

Resources

Evaluate their resources and commentary. Answer the following questions:

  • Do you feel the given resources are adequate in providing sufficient background information? yes, he provided a source pdf covering the implementation of the autotyped variable.
  • Are there additional resources you've found that you can add to the resources list? they are all redundant of the information in the pdf
  • Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?adequate
  • If you find a deviation in opinion, state why you think this might exist. none

Hypothesis

State their experiment's hypothesis. Answer the following questions: I do not believe you will not be able to declare the auto typed variable without initializing it.

  • Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover? yes
  • What improvements could you make to their hypothesis, if any? none

Experiment

Follow the steps given to recreate the original experiment. Answer the following questions:

  • Are the instructions correct in successfully achieving the results? yes
  • Is there room for improvement in the experiment instructions/description? What suggestions would you make? none that i see without being rediculous
  • Would you make any alterations to the structure of the experiment to yield better results? What, and why? none

Data

Publish the data you have gained from your performing of the experiment here. I used the original experimentee's materials, so i received the same results from the same code: <code c> 1: #include<iostream> 2: 3: using namespace std; 4: 5: int main() 6: { 7: auto autovar; 8: cout « “enter value to put in auto typed variable: ” ; 9: cin » autovar; 10: cout « “value stored in auto typed variable - > ” « autovar « endl; 11: 12: return (0); 13: } <code>

lab46:~$ g++ --std=c++0x autotest.cc -o autotest
autotest.cc: In function 'int main()':
autotest.cc:7: error: declaration of 'auto autovar' has no initializer
lab46:~$

Analysis

Answer the following:

  • Does the data seem in-line with the published data from the original author? yes
  • Can you explain any deviations? none
  • How about any sources of error? none
  • Is the stated hypothesis adequate? entirely

Conclusions

Answer the following:

  • What conclusions can you make based on performing the experiment? The auto typed variable cannot be used without first being initialized
  • Do you feel the experiment was adequate in obtaining a further understanding of a concept? yes
  • Does the original author appear to have gotten some value out of performing the experiment? yes
  • Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author). none
opus/spring2012/bkenne11/start.txt · Last modified: 2012/08/19 16:24 by 127.0.0.1