Study Guides (238,443)
Canada (115,138)
UOIT (305)
general (1)

Com. Sci. Exam Review.docx

6 Pages
Unlock Document

Computer Science
CSCI 1040U

DATA STORAGE  Bits o 0 and 1; true and false  Boolean operations o Work with true or false values o AND (only true if both inputs are true) o OR (true if at least one of its inputs is true) o NOT (converts true to false) o XOR  Gates perform these operations o Special symbols for each operation  Flip-flop o More complex gate o Main memory structure o Stores 1 bit of information o 8 flip flops needed to store a byte  KNOW INPUTS AND OUTPUTS  8 bits = 1 byte  Main memory o Dynamic random access memory (DRAM) o Very fast o speed is close to speed of processor o Problem is its expensive, and loses information when the computer is turned off  Better memory sources -> mass storage devices o Dvd o Hard disk  ASCII o Uses 8 bits of information o Only qualifies 256 characters  UNICODE o Uses 16 bits o Around 6500 possible characters  Integers o represented using a binary format o Uses just 2 digits -> 0 and 1 o 2x  Negative numbers o Digit farthest left represents either + or - o 0 = positive o 1 = negative o Uses 2's complements notation DATA MANIPULATION CPU  o Arithmetic/logic unit - performs math operations and AND, OR, NOT, XOR operations o Control unit - decides who uses arithmetic/logic unit, makes decisions o Resistor unit - memory inside of CPU, memory is temporarily copied into resistor unit, manipulated, and copied back into main memory  Hexadecimal notation o 16 digits used 0..9 and A..F  KNOW HOW TO CONVERT BETWEEN DIFFERENT NOTATIONS  Address o Represented in hexadecimal notation  Program o Stored in main memory as binary numbers  Different types of instruction sets o Data transfer o Arithmetic/logic instructions o Control instructions - used for making decisions  OP Code - operation code o Tells computer what operation has to performed o First 4 bits of the instruction  OPERAND  Look at Appendix C  Fetch-decode-execute o Fetch - gets data/instructions from main memory o Decode - see what the opcode means and what are the operands o Execute - performs operation o This cycle is constantly going  Algorithms o Sequence of steps to perform and reach a goal, solve a problem o Transforms inputs into an output o Has to finish an operation in a certain amount of time o Finite number of steps o Represented by  Flow chart diagrams  Pseudocode  Similar to human language and computer language  Written in an imperative way  Tells the computer if it is going to use procedure  Assignment operation?  Conditional statements (if, then, else)  loops o Searching and sorting  Sequential search  searches things in a list one by one  Worst case - what we're looking for is at the bottom  Best case - at the top  Average case - number of items in the list divided by 2  Binary search  List has to be in order in order for this search to work  Divides the list in half; keeps doing it until it finds what its looking for  Average case = log n (n = number of items in the list)  Insertion sort  n2  Takes longer than binary and sequential search o Complexity of algorithm = complexity 0(n) o Recursion  Another way to represent a loop  Procedure that calls itself  Needs recursive call and condition to stop recursive call (called a base case)  Example - factorial PROGRAMMING LANGUAGE  1st generation - machine language; lowest level language  2nd generation - assembler language (uses some English words (e.g. jump)  3rd generation - C++, Python (uses English words - if, while)  4th generation - SQL (works with databases); highest level language  Compiler - transforms these languages into machine language  Paradigm o Imperative o Object-oriented o Functional o Declarative  Statements o Declarative - tells computer what we're going to use (e.g. c++ -> int x=0; or python -> x=0) o Imperative - tells computer what to do (assignments, conditionals and loops) o Comments - describe what you are doing in your program  Variable o Global - variable can be used any where in the program o Local - variable used only in a specific place (e.g. for loop)  Data types o Boolean values o Etc  Procedures o Write name followed by (inputs/arguments/parameters)  Python -> define name(argument)  c++ - name(argument) { } o Return statement (e.g. return x) stops procedure  Parameters o Call by value o Call by reference  Control structure
More Less

Related notes for CSCI 1040U

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.