Thursday, October 30, 2014

Hardware

Scholarship opportunities!

#1:

#2:








Fun new stuff - Android Wear:








  

 






Random trivia: Top 10 Excel shortcuts
http://www.computerworld.com/s/article/9247093/10_top_Excel_keyboard_shortcuts?taxonomyId=86&pageNumber=1







Parts of a computer:



Basic parts:
1. Case: box around all the parts


Needs to be:
- easy to open up
-large enough to fit everything into it
- large exhaust fans
- compatible with motherboard



2. Power Supply
Provides power to motherboard and expansion slots.
 - adequate wattage
- modular plugs (to manage cables)
- fan (heat management).  

 





3. Motherboard:
.







- Ties all the parts of the computer together: (processor, memory, power supply, video cards, keyboard, mouse, sound, monitor etc.)







-AGP - Accelerated Graphics Port channel for attaching a video card

-RAM - Random Access memory - temporary data storage that can be accessed in any random order.  Temporary - is gone if you shut the computer down (if you did not save your work, and the computer shuts down, it will be gone because it was only in RAM.)

ROM - read-only memory. Permanently stored data. ROM stores your computer's configuration is and is necessary to boot the operating system.

-PCI - Peripheral Component Interconnect – attach hardware devices like network cards, sound cards, modems etc.

-ISA Industry Standard Architecture IBM computer bus   

Bios Basic Input/Output system, or basic integrated operating system, performs basic functions like booting and keyboard control.  

CMOS battery – stores the system time and CMOS BIOS settings when computer is off (Complementary metal oxide semiconductor)
- EIDE - Enhanced integrated drive electronics, or ATA storage device connector, like hard disks & floppy drives

-CPU - Central Processing Unit




PCI (express) - 
Peripheral Component Interconnect Express serial expansion bus - hard disks, sound cards, integrates data from other buses into the system bus.
SATA - Serial ATA (Advanced Technology Attachment) bus interface that connects bus adapters to storage devices like hard disk drives and optical drives.

ATX - default form factor, full-size ATX board is 12 × 9.6 in (305 × 244 mm).

DDR - double data rate RAM - high transfer rates

HDMI (High-Definition Multimedia Interface) audio/video interface for transferring uncompressed video data

USB - Universal Serial Bus, connect cameras, scanners, printers, etc.

Firewire - video cameras, external hard drives








4. CPU
 - central processing unit, hardware in computer that performs input/output operations, decodes, and performs calculations.

Multiprocessing - more than one CPU
Multi-core processors - multiple CPU's on single chip

located next to big fan, most expensive part of computer

  • Intel - LGA (land grid array) socket, no pins, just gold contacts
  • AMD - pins 

 

  • Fan - important to keep CPU from overheating!!


5. Memory


DIMM - dual in-line memory module,  series of dynamic random-access memory integrated circuits.
RAM - Random Access Memory
temporary memory that only works when the computer is on, then it is flushed out.

6. Video Card
DVI - Digital Visual Interface





Discrete video card - separate from what you get on motherboard

PCI  (Express) -  Peripheral Component Interconnect, serial computer expansion bus

  • serial communication sends data one bit at a time, sequentially, over a communication channel or computer bus.

  • parallel communication,  several bits are sent as a whole, on a link with several parallel channels.
 
7. Storage (HDD/SSD) - AKA hard drive
Permanent memory storage (does not disappear when computer is turned off, like RAM/DIMM)
Mechanical hard drive.  Two different types:


  • HDD - hard disk drive -uses rapidly rotating "hard" disks coated with magnetic material.  Magnetic heads arranged on a moving actuator arm read and write data to the surfaces. Data is read in a random-access manner, meaning individual blocks of data can be stored or retrieved in any order rather than sequentially.  



  • SSD - solid-state drive/solid-state disk
 - no moving parts, no actual "disk" of any kind,
- no motors to "drive" the disks, -
- data storage device using integrated circuit assemblies as memory to permanently store data
- fast and quiet


    8. Optical Drive
    reads and writes to CD's, DVD, and Blue Ray disks.

    CD - "compact disk", originally created for music, expanded for use with storing data.
    • CD-ROM: Read-Only Memory
    • CD-R - "Recordable" is a Write Once Read Many (WORM) optical medium
    • CD-RW "re-written"



    DVD "Digital Video Disc" or "Digital Versatile Disc", originally for videos, expanded for use with music and other data.  
     
    Blue Ray - can store video and audio with greater definition


    I/O  (Input Output)
    keyboard, mouse, USB, Printer, Monitor etc.

    BIOS - Basic input output system for loading

    UEFI - Unified Extensible Firmware Interface
    replace BIOS in newer computers, interface between OS and firmware.

    OS - Operating System - software that manages hardware resources - links programs with hardware. (UNIX, Solaris, Linux, Mac OS X, Microsoft Windows)

    Program - instructions to perform a task.

    Measurements:


    ¨Bit (b) – Binary Digit, value of 0 or 1
    ¨Byte (B) – 8 bits
    ¨Kilobyte (KB) – 1024 bytes (210 bytes)
    ¨Megabyte (MB) – 1024 * 1024 bytes (220 bytes)
    ¨Gigabyte (GB) – 1024 * 1024 * 1024 bytes (230 bytes)
    ¨Terabyte (TB) – 1024 * 1024 * 1024 * 1024 bytes (240 bytes)

    Extra Credit - **Build a Computer:**

     



    Computer Engineering Lab



    The purpose of this lab is to familiarize you with the major components of a personal computer.  I want you to “build” a personal computer by selecting components you find on the web.  List the details for each component as described below.  Make sure that the components you choose work together and that the power supply you choose is adequate for your power budget.  For this lab, assume heat issues have been mitigated with appropriate cooling techniques.

    Just cut and paste what is below,  if you have not done this kind of thing before, look at the desktop PC's that are already assembled on places like :
    http://www.newegg.com/Desktop-PCs/Category/ID-228

    Scroll down, click on specifications:
    http://www.newegg.com/Product/Product.aspx?Item=N82E16883103950

    Many of the general spec's have a little description you can click on to see what it is describing:




    There is a lot of info just in the title of the PC:
    Example:
    http://www.newegg.com/Product/Product.aspx?Item=N82E16883103950

    "Acer VX2631-UR11 Desktop PC Intel Core i3 4130 (3.40GHz) 4GB DDR3 500GB HDD Windows 7 Home Premium 64-Bit"


    Acer  → brand name
    VX2631-UR11 → model # (motherboard, unless it's a Dell or HP)
    Desktop PC
     Intel Core i3 4130 (3.40GHz) → CPU type / speed
    4GB DDR3 → RAM Memory
    500GB HDD → Hard Drive / data storage
    Windows 7
    Home Premium
    64-Bit →CPU


    Another great webpage:
    http://pcpartpicker.com/


    ~~~~~~~~Fill in Below, 
    then email it to me so I can open up your links etc.  
     
    ~~~~~~~~~~~~~~~~~~~~~~

    Motherboard           ________
     Cost:                                       
    Size/Form Factor: ________(Mini ITX, Micro ATX, or full ATX, determines size of case)
    Ports: ________(USB ports? HDMI?)  

    Chipset:             (manages the data flow between the processor, memory and peripherals:,

    northbridge links the CPU to very high-speed devices, especially RAM and graphics controllers, and the southbridge connects to lower-speed peripheral buses (such as PCI or ISA, Ethernet, USB, and audio devices


    Socket:                 (determines which CPU you can use, LGA socket = no pinsAMD - pins)



    Manufacturer:        (ASUS, GIGABYTE, and MSI...BIOSTAR, ASRock etc.)

    Website:                                               



    CPU                

    Cost:                                               

    Cores:      __  (more cores means it can carry out more sets of instructions at one time)

    Clock Speed:                 (how many instructions one core can carry out in one second)

    Cache:                    (speeds up the memory retrieval process)

    Manufacturer:              (AMD - less expensive, Intel - performs better)

    Website:                                              



    RAM                        (check what your motherboard supports!) 

    Cost:                                              

    Size:                              (average ~ 4GB)

    Speed:                                                                              

    Memory Type:                (static RAM (SRAM)- more $/faster/less energy;  dynamic RAM (DRAM) - most common, and phase-change memory (PRAM), DDR3- double data rate type three with
    DRAM interface)

    Package–Memory Pin/Format:                           (240 pin? 

    Manufacturer:                                              

    Website:                                              



    Power Supply                                                
    P.S. calculator: http://extreme.outervision.com/psucalculatorlite.jsp 

    add 100 Watts more than you need in case you get upgrades
    Cost:                                              

    (Size)Form Factor:                   (how large is it? "ATX" - new standard)  

    Wattage:                                              

    Efficiency:                                 (80+ - most energy efficient) 

    Manufacturer:                                              

    Website:                                                


    Hard Drive(s):                                               

    Cost:                                               

    Drive Type:                                        (HDD, SSD)        

    Capacity:                             (500GB, 1TB?) 

    Spindle Speed (RPM):                         (~7200 RPM - only applies to HDD's)

    Buffer Memory/cache:                                    only applies to HDD's

    Interface:                              (USB 3.0?  

    Manufacturer:                      (Western Digital, Seagate, Hitachi, Samsung, and Toshiba)

    Website:                                             



    Graphics Card                                               

    Cost:                                             

    Interface Type:                 (example - PCI Express 3.0)    

    Interface Speed:                                              

    Chipset:                                            

    Memory Type:                                    (GDDR5 etc.            

    Memory Size:                                    (2 GB etc.    

    Manufacturer:                                   (MSI etc.    

    Website:                                                              



    Case                                            

    Cost:                                              

    Compatible Motherboards:                                             

    Dimensions:                                             

    Cooling Fans:                                              

    Manufacturer:                                              

    Website:                                             



    Optical Drive(s)                                        

    Cost:                                                 

    Compatible Media:                                                         

    Write Speed:                                                                  

    Cache Size:                                                                 

    Manufacturer:                                                                         

    Website:                                                                             





    Total Cost for PC                                           


    Example: http://www.newegg.com


    Motherboard:  

    ASRock X79 Extreme6 LGA 2011 Intel X79 SATA 6Gb/s USB 3.0 ATX Intel Motherboard

     Cost:    $214.99               
    Size/Form Factor: 9.6" by 12"_
    Ports: (see pict)_ 



    Chipset:  Intel X79    

    Socket:  LGA 2011 (determines which processors you can use)



    Manufacturer:     ASRock__





    CPU:

    Intel Core i7-3820 Sandy Bridge-E 3.6GHz (3.8GHz Turbo Boost) LGA 2011 130W Quad-Core Desktop Processor BX80619i73820


    Cost:  $299.99                        

    Cores:     Quad core

    Clock Speed:     3.6 - 3.8 GHz           

    Cache:  10MB L3, 4 x 256KB L2

    Manufacturer:    Intel





    RAM:  

    Kingston HyperX 16GB (2 x 8GB) 240-Pin DDR3 SDRAM DDR3 1600 Desktop Memory Model KHX1600C10D3B1K2/16G


    Cost:   $159.99                            

    Size:         2*8GB = 16 GB

    Speed:   1600 MHz, Cas Latency 10           

    Memory Type:   SDRAM DDR3             

    Package–Memory Pin/Format:  240 pin DDR3                

    1.5V
    Manufacturer:    Kingston   

    Website:  http://www.newegg.com/Product/Product.aspx?Item=N82E16820104302   



    Power Supply:  

    Rosewill LIGHTNING-1000 1000W Continuous @ 50°C, Intel Haswell Ready, 80 PLUS GOLD, ATX12V v2.31 & EPS12V v2.92, SLI/CrossFire Ready, Modular Active PFC Power Supply


    add 100 Watts more than you need in case you get upgrades
    Cost:   $169.99                       

    (Size)Form Factor:   7.09" x 5.91" x 3.39"    

    Wattage:     1000W                      

    Efficiency:  80 +                  

    Manufacturer:   Rosewill      

    Website:  http://www.newegg.com/Product/Product.aspx?Item=N82E16817182239     


    Hard Drive(s):  

    Western Digital WD Black WD2002FAEX 2TB 7200 RPM 64MB Cache SATA 6.0Gb/s 3.5" Internal Hard Drive Bare Drive - OEM



    Cost:  $149.99                       

    Drive Type:    3.5" internal hard drive     

    Capacity:     2TB                            

    Spindle Speed (RPM):   7200 RPM

    Buffer Memory:     64MB                     

    Interface:  SATA 6.0Gb/s                     

    Manufacturer:   Western Digital,_________

    Website:   http://www.newegg.com/Product/Product.aspx?Item=N82E16822136792



    Graphics Card 

    MSI Gaming N760 TF 2GD5/OC GeForce GTX 760 2GB 256-bit GDDR5 PCI Express 3.0 SLI Support Video Card


    Cost:     $259      

    Interface Type:   PCI Express 3.0     



    Chipset:     GTX760           

    Memory Type:    GDDR5                   

    Memory Size:   2GB                         

    Manufacturer:  MSI                        

    Website:  http://www.newegg.com/Product/Product.aspx?Item=14-127-745 



    Case:  

    Rosewill BLACKHAWK-ULTRA Gaming Super Tower Computer Case, support up to HPTX, come with Eight Fans,Top HDD docking


    Cost:   $169.99                    

    Compatible Motherboards:  ATX, E-ATX, XL-ATX, HPTX     

    Dimensions:  9.45" x 25" x 25.99" (WxHxD) (front & top panel included)    

    Cooling Fans: 8 fans           

    Manufacturer:  Rosewill             

    Website:   http://www.newegg.com/Product/Product.aspx?Item=N82E16811147157 



    Optical Drive(s)

    LG Black 14X BD-R 2X BD-RE 16X DVD+R 5X DVD-RAM 12X BD-ROM 4MB Cache SATA BDXL Blu-ray Burner, Bare Drive, 3D Play Back (WH14NS40) - OEM


    Cost:      $79.99            

    Compatible Media:  BD, DVD, CD                

    Write Speed:   2X(BD-RE)-48X (CD-R)                      

    Cache Size:           4MB                                                      

    Manufacturer:     LG                                                          

    Website:   http://www.newegg.com/Product/Product.aspx?Item=N82E16827136250





    Total Cost for PC     $1509.92                                      

    Saturday, October 25, 2014

    Programming Languages



    Scholarship: https://smart.asee.org/
     

    How Computers Add Numbers:



    https://www.youtube.com/watch?v=VBDoT8o4q00

    Machine Language: 0's and 1's




    compiler:
    Converts program into machine language
    A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).
    linker:
    Program that links to the libraries needed for an executable program.


    10.7 Operating systems
    Operating system - interface between computer hardware (monitor, mouse, physical devices), software (programs), and user (you!).

     
    Example operating systems:

    • UNIX
    • MS-DOS (Microsoft)  / Windows
    • Apple - Macintosh

    10.8 Programming languages




    Procedural language: Fortran, Basic, Pascal, C: fetch-and-decode-execute

    Value =5
    new_value = log(Value)


    second line of code – new_value – “fetches” the variable “value”, the log function is “decoded” and then the function log(value) is “executed”.

    Object-Oriented Languages:  C++, Java
    data and routines that act on data treated as “objects”.  

    Value =5
    new_value = log(Value)


    “value” and “log” are treated as one single object, that, when called, automatically takes the log of value.

    object = reusable, modular software component





    FORTRAN(77, 90, 95) – Formula translating System, IBM, John Backus – 1957, higher-level programming language that uses English instead of just symbols.
    Libraries of FORTRAN codes:
    IMSL (International Mathematics and statistics Library)
    NAG (Numerical Algorithm group)

    .
    BASIC – Beginner’s All-Purpose Symbolic Instruction Code – 1964 at Dartmouth by John Kemeny & Kurtz – to encourage more students to use computers by offering a more user friendly, easy-to-learn language. 

    .
    Pascal – 1971 – also developed for educational purposes by Prf. Wirth (not used much outside of schools)

    .
    C – 1972 – by Dennis Ritchie of AT&T Bell Labs, outgrowth of BCPL & B languages.

    .
    UNIX – also based off B language.

    .
    ANSI C
    – common industrial language.

    .
    Java
    – by James Gosling of Sun Microsystems
    small, fast, reliable, transportable program
    software for TV’s, VCR’s, telephones, etc.
    Java applications – word processors, spreadsheets
    Java applets – stored on remote computers, accessed through web.

    .
    HTML - HyperText Markup Language 
    code for webpage.
    use tags:
    <TITLE> ... </TITLE>
    <P> - paragraph
    <H2>Second level heading</h2>
    <ADDRESS> text ... </ADDRESS> - sigs, italic and/or right justified or indented

    To see the HTML code used to create the Web page - Click on "View" in the menu bar and then click "Page Source."







    C&C++ are among the world's most popular programming languages.

    If you want C++ on your home personal computer, you can download it for free:

    http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express/thank-you?key=A1D5554A-253A-43AB-AC28-F7A29337C839&lang=enFree install code:
    6VPJ7-H3CXH-HBTPT-X4T74-3YVY7

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Hello world!
    • classic 1972 tutorial
    • check that the compiler setup is working correctly
    • teach new users simple syntax& program structure

    Open C++
    Start,
    All Programs,
    Microsoft Visual Studio,
    Microsoft Visual C++ 2010 Express


    File →New→Project



    →Win32 Console Application
    → enter a name for your project "Hello World"
    → ok→ next



    → select "" and ""
    →Finish

    You should now have a page that look like this:


    Click the green arrow at the top to run the precompiled header
    Would you like to build it?  Yes
    Did you get a lnk error message?

    Google the error message – see how to fix it:







    Click the green arrow again,


    Is the error message gone now?


    Copy the following code into C++:

    // Hello World.cpp : this is the comment line where you can tell users what your program does.  This program will output "Hello World"
    //


    #include "StdAfx.h"
    #include "iostream"
    using namespace std;
    int main ()
    {
        cout <<"Hello World"<<endl;
        system("PAUSE");
        return 0;
    }


    ***Note - C++ is picky, it is case sensitive, you have to be very careful to get everything typed in correctly.




    Click the green arrow,
    would you like to build it? → yes




    The program should then execute, a new window will pop up and say "Hello world"

    What is in your program?

    #include "StdAfx.h"
    #include "iostream"

    include instructs the pre-processor to include another file (the file SrdAfx.h, and iostream or in out stream in this case)

    C++ has a library of many codes like "iostream" you can use to save yourself time & hassle.
    http://www.cplusplus.com/reference/iostream/

    iostream - input and output program, lets you use "cin" and "cout" to allow a user to imput data into the program, and for the program to output data back to the user.
    StdAfx.h namespace, reduces compile & processing time
    - http://www.cplusplus.com/articles/1TUq5Di1/


    int main () 
    the first function, where the program actually begins.

     
    {}
    Surrounds the function
    { start
    end}
        cout <<"Hello World"<<endl;
    Outputs "Hello World" to the user

    ;  C++ syntax, ends the command

        system("PAUSE");

    Pauses the screen

        return 0;
    indicates that the main function has ended


    Functions provides a way of grouping commands together under a logical heading which can be called from a single line within your main program (no point rewriting and rewriting hundreds of lines of code every time you want a specific function – so get thousands of lines of code into one line of command)


     Library file
    – collection of resources used in your computer program, allows sharing and importing of resources across one or more computers, to use and reuse as often as you wish.  You can write your own, or use existing files created by C++. – use library files instead of having to code everything yourself, just “include” them into your program. 

    Open source – software whose source code is available free of charge to the public to use, copy, modify, etc.

    Preprocessor commands
    , command after # symbol, like #include – another separate program invoked by the compiler which includes extra source code definitions.  Include allows you to load separate source codes into your system. 

    Editor – what you type your code in (like a notepad)

    compiler – root of any programming language, transforms source code into assembly language or machine code, without it all you have is a block of text that doesn’t do anything.

    Object – entity which can be manipulated – variables, functions, data structures, & classes

    stream – input output channel linked to the console

    overload – if an operator has more than one meaning, example: << inserts data into the cout stream instead of being a left shift.

     Commenting
    // HW.cpp : Defines the entry point for the console application.
    //

    leave notes for other programmers who are looking at your code – text that is not part of the code itself, just explains what code does.








    //Airplane.cpp : Program to demonstrate for statements.

    //
     
     
    #include <stdio.h>
    #include "StdAfx.h"
    #include "iostream"
    int main(void)
    {

      
    int count;

    for(count=1; count<=500;count++)

    printf("I will not throw paper airplanes in class.");

    system("PAUSE");

    return 0;
    }

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Assignment #1
    This age calculator compiles, but does not calculate the correct age.

    1. Study the program to see what it does.

    2. change it so that it works using "if" statements:

    if(abc)then(do xyz)

    // Age Calc.cpp : Program to calculate someone's exact age.
    //
    #include "stdafx.h"
    #include<iostream>
    #include<conio.h>
    using namespace std;
    int main(int argc, _TCHAR* argv[])

    {

           int birthmonth,birthyear;

           int currentmonth,currentyear;

           int agey,agem;
           cout << "\n\n\t\t\t Age Calculator\n\n";

           cout<<"Enter Your Birth Year(Eg:1989):";

           cin>>birthyear;

           cout<<"\n\nEnter Your Birth Month(Eg:7):";

           cin>>birthmonth;

           if(birthmonth > 12 || birthmonth < 1)

           return 1;

          

           cout<<"\nEnter The Current Month(Eg:7):";

           cin>>currentmonth;


           cout<<"\nEnter The Current Year(Eg:2010):";
           cin>>currentyear;

           agey=currentyear-birthyear;
           agem=12-birthmonth;

           cout<<"\n\n\t\tYour Age is "<<agey<<" Years And "<<agem<<" Months ";

           getch();

           return 0;

    }
     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Test your program:

    Jack - born Jan 2005
    (Already had his birthday this year - 9 years, and 2 months

    Jill - born Sept 2006, (She has not had her birthday yet, 7 years, 6 months)


    Hint:


    //if(birthmonth > currentmonth) you have not had your birthday yet
           if(birthmonth > currentmonth)

           agey= ????
    etc.




    Assignment #2 




    Write a program that calculate the coefficient of friction & forces acting upon an object at rest on an inclined plane.

    Input: m, theta
    Output: u, Fn, Ff


    #include <math.h>

     // lets you use cos() sin() etc.//

    #define GRAV 9.8

    #define PI 3.141592654
    Assignment #3 - your choice, such as:




    Write a program that calculate the voltage drops and current in a simple series circuit.

    Input: V, R1, R2, R3
    Output: i, V1, V2, V3



    or 
    - write a program for your group project
    - write an ENGR1201 grade calculator
         *clac what grade you need on the final to get an A in class considering what you have so far
    - write a calorie counter
         * output how many miles you need to run in order to use up the food you just ate
    - write any program you want that:
       *asks for user imput

       * performs a calculation based on that input
       * outputs something based on the calculation
    ~~~