Table of Contents

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:

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:

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:

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:

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:

Hypothesis

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

Experiment

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

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:

Conclusions

Answer the following: