Tuesday, May 17, 2016

Difference Between For & While

For Loop:
  • It is a fixed repetition loop. It will run the given number of times no matter how the body of for loop code changes the values of the variables.
  • Of you have a constant, you can run the for loop for that many times. You can change the value of the constant.
  • The counter value increases or decreases depending upon the for loop min, max, incremented, or decremented values automatically as stated per requirement—no separate statement is made within the body of for loop
  • A separate variable is needed most times to run a for loop
  • A for loop can also start with a maximum value and decrease each time the body of the loop is executed
While Loop:
  • While loops can have various conditions and they can be joined (AND OR). The control enters the loop body only when the condition is met. If the condition is not met, the control goes to the statement following the end of the while loop body. A statement within the while loop changes the criteria and that actually moves the control out and to the statements that are following the end of the while loop.

Wednesday, April 13, 2016

Computer Architecture Notes

Input Devices

  • Graphics Table
  • Cameras
  • Video Capture Hardware
  • Trackballs
  • Barcode Reader
  • Digital Camera
  • Gamepad
  • Joystick
  • Keyboard
  • Microphone
  • MIDI Keyboard
  • Mouse
  • Scanner
  • Webcam
  • Touchpads
  • Pen Input
  • Electronic Whiteboard
  • Magnetic Key Cards
Output Devices
  • Monitor
  • Printers
  • Plotters
  • Projector
  • LCD Projection Panels
  • Computer Output Microfilm (COM)
  • Speaker(s)
  • Radio
Both Input and Output
  • Modems
  • Networks cards
  • Touchscreen
  • Headsets
  • Facsimile (FAX)
  • Audio Cards / Sound Card
  • USB
Random Access Memory
  • Is volatile, meaning when the power is switched off, everything stored in the RAM is erased
  • Programs (currently running) and Data (related to those programs) stored in RAM
Central Processing Unit
  • Has 2 components: Control Unit and Arithmetic Logic Unit
  • ALU performs arithmetic operations and evaluates logical statements
  • Control Unit executes the program line by line and works as an interface between Input/Output devices, ALU, and RAM

Computer Architecture Diagram

Wednesday, April 6, 2016

Fundamentals of Computer Architecture

Computer responds to only two things—on and off

  • 0 = off
  • 1 = on
  • ^ two states, on and off, so binary was chosen
  • 0 = electrical pulse doesn't go in
  • 1 = electrical pulse goes in
Binary
  • 0 bit
  • 1 bit
Every symbol on the keyboard is called a character, including spacebar and special symbols
  • Combination of eight bits, called a byte, code for a character
  • Every character on the keyboard is represented by a byte
  • BYTE AS IN STORAGE BYTE i.e. gigabyte
  • Pattern of electrical pulses is stored and becomes visual
Operating system does resource management
  • Helps computer wake up and shut down and connect screen and mouse and printer, etc
Jobs are there and each job is given a priority
  • Certain people are given a priority for jobs and which job gets done first depends on this priority
Compiler takes the high level language program from the user, checks in for any errors, displays them to the user to correct them, and after the errors are fixed, convert the ENTIRE program into machine language/binary language/object code/binary code/machine code.
  • It converts high level language to binary to check for errors, converts it back to high level language to display to the user, takes the corrected program and converts it back to binary, gives the binary corrected program to the computer for execution, then takes the result and converts it to high level language to display to the user.
Interpreter is a systems program that takes in the high level language and converts it, statement by statement, into machine language.
  • It also corrects errors along the way.
  • You get output immediately
Source Code --> Compiler/Interpreter --> Object Code

Object Code: binary code/language, machine code/language, executable
Source Code: high level language (Java, C++, Python, etc)

Application Software and Systems Software
  • Application Software: a software for a particular system
  • System Software: use them all the time but in background (example: operating system, compiler, drivers)
When you boot your operating system, it is checking that everything is working

Wednesday, March 9, 2016

Points to Consider for Presentation

Some points I would consider to keep my audience engaged during the presentation:

  • Present in an animated fashion (not monotone)
  • Use colors and images
  • Insert fun facts and other entertaining factors
  • Don't type too much information on the presentation—say it instead
  • Don't ramble on and on about something—state it with brevity
  • Look at the audience and talk to them instead of the wall or something like that
Video:
  • 10-20-30 rule
    • 10 slides in 20 minutes with 30 point font minimum

Wednesday, March 2, 2016

Software Approach, Top Down Design

One way of coding is to simply have an rough idea of what you want to do and then start typing away to produce one huge source file.

This is a very bad idea.

The resulting code is likely to have many issues with it that include

  • Poorly documented code, so very hard to maintain and update
  • 'Spaghetti code' - which means a tangled mess of jumps and loops all over the code, very hard for someone to understand. even by the original coder a few days later!
  • Duplication of code, so wasting memory and running speed
  • Very hard to develop by more than one person as there is only one file
  • Very hard to debug - the file either works or it doesn't

Systems Thinking

What comes to your mind when you hear the word system. What is a system? How does it work?
  • When I hear the word system, I think of something that completes a task and has many parts to it, like an assembly line.
  • A system is a set of instructions or functions to complete a task.
  • it works because all the parts are compatible and each instruction follows the previous, completing the next section of the task.
  • Examples: computer code, assembly line, body organs, school, government, etc.
Notes about systems
  • Communication is very important for a system to work—one change in a subsystem can affect everything in the system
    • or else discrepancies or errors or changes may affect the system
  • If you change one thing, it changes everything—set of instructions, like the ripple effect
  • Discrepancies will affect a system and not let the system work
    • i.e. if a variable has different names
      • which is why communication is important
  • Communication makes a team, which is what makes a system
    • no communication, no system