Beruflich Dokumente
Kultur Dokumente
THINGS TO KNOW
Stores information on sectors (address and data block)
Fixed number placed in a concentric circle on the surface of the disk
track
Surface of the disk contains many tracks
Single read/write head that can be moved in or out
Access time
Seek time time needed to position read/write head over the correct track
Latency time for the beginning of the desired sector to rotate under the
read/write head
Transfer time the time for the entire sector to pass under the read/write
head and have its contents read/written
Much faster than SASDs, usually used for mass storage
o Sequential access storage devices (SASDs)
Does not require all units of data to be identifiable via unique addresses
Repeats finding process until desired object is found
Useful in specific situations
- I/O devices very slow compared to other computer components
o Solution I/O controller responsibility is to handle the details of I/O and to
compensate for any speed differences
I/O buffer small amount of memory with enough I/O control and logic
processing capability to handle the mechanical functions of the I/O device and
transmit an interrupt signal
The Arithmetic/Logic Unit
- Subsystem that performs mathematical and logical operations
- Integrated with the control unit in the processor (CPU)
- Three components data path
o The registers
Storage cell that holds the operands of an arithmetic operation and holds its
results
Differences from RAM
Cells do not have a numeric memory address
Can be accessed much more quickly
Not used for general-purpose storage
o The interconnections between components
o ALU circuitry
The Control Unit
- Tasks
o Fetch from memory the next instruction to be executed
o Decode the message
o Execute by issuing appropriate commands to ALU, memory, or I/O controllers
- Instructions that can be decoded and executed are represented in machine language
o Operation code (op code) unique unsigned integer assigned to each machine language
operations
Maximum number of op codes is 2k
THINGS TO KNOW
o Address fields the memory addresses of the values where this operation will work
Dijkstras Algorithm
See notes
Turing Machines
- (current state, current symbol, next symbol, next state, direction of movement)
- Unsolvable Halting Problem proof by contradiction
Types of Sorting
- Sequential search checking every element in the list until the desired element is found
o Order of magnitude n
o N comparisons
- Selection sort putting things in order
o Select largest number in unsorted list and switch with last number, more marker over one
o N-2 comparisons
o Order of magnitude n2
- Insertion sort
o Element by element, compare to the largest element
o Order of magnitude n2
- Binary search only works if list is already sorted
o Order of magnitude lg n
Data Compression
- Colors: 3 bytes per pixel (24 bits)
- Compression ratio = size of uncompressed data / size of compressed data
THINGS TO KNOW
Boolean Logic
AND + OR 3 transistors; NOT 1 transistor
AND ab
OR
a+b
NOT
Transistor
Protocol Stack
Physical Layer
- Governs the exchange of bits across a physical communication channel (fiber-optic cable, copper
wire, radio channel, etc.)
- Specify
o How we know when a bit is present on the line
o How much time the bit will remain on the line
o Digital or an analog signal
o What physical quantities are used to represent 0 and 1
o The shape of the connector between the computer and transmission line
- Goal is to create a bit pipe between two computers
- Sends and retrieves bits
Data Link Layer
- Link created by Physical layer is not error free creates error detection and correction problem
- Need to identify start and end of a message framing
- Job of the Data Link protocols is to address error handling and framing
- Done in two stages
o Medium Access Control determine how to arbitrate ownership of a shared
communication link between nodes that are trying to send a message at the same time
Centralized creating a single master control node responsible for determining
ownership slow
Most used contention-based approach no central authority and all nodes
compete equally for ownership
o Logical Link Control solve error detection and correction problem and ensure the
message traveling form the source to destination arrives correctly
ARQ Algorithm
THINGS TO KNOW
ACK
Network Layer
- Job to deliver a message from the site where it was created to its ultimate destination
- Must
o Create a universal addressing scheme for all network nodes
o Deliver message between any two nodes in the network
- Example: Internet Protocol
o DNS
- Use Dijkstras Algorithm to find shortest path
Transport Layer
- Identifies each program with a port number and remembers which program goes with which port
- Creates program-to-program delivery service
- Deal with errors and reliability
o TCP (Transport Control Protocol)
Requires that two programs at the source and destination node first make a
connection
Then, must inform each other of the message exchange and describe the quality
of service they want to receive
Once connection is established, messages can be transmitted
Uses ARQ Algorithm
Application Layer
- The rules for implementing the end-user services provided by a network; establish host-to-host
connections
- Example: HTTP Protocol
o Single Web Page identified by URL
o Protocol host address page
o Must first establish connection between the http client program and the port
o Once connection is established, use the HTTP application protocol to access the page
o Request message and response messages sent through TCP
If successful, response also includes the requested page
Implicit Parameters
- Use this to refer to a variable in the current class
Comparing Strings
- if (string1.equals(string2))
Random Number Generator
- generator.nextInt(n)
- Math.random
THINGS TO KNOW
Arrays
- Index values start at zero
- Can be initialized in any form of object but still will contain null references
o Ex. BankAccount[] values = new BankAccount[10]
- Length of arrays are fixed
- Smaller than arraylists
Array Lists
- Can grow or shrink in size as needed
- Supplies methods for many common tasks
- ArrayList<String> names = new ArrayList<String>();
o Cannot use primitive types as type parameters for array lists
- names.add(Emily);
- Use get method to obtain the value of an array list element
o String name = names.get(2);
o String name = names.set(2, Carolyn);
- To put numbers or primitive types into array lists, they must be turned into objects through
wrapper classes
o Wrapper class names start with uppercase letters
o Conversion between wrapper classes and primitive types is automatic
Enhanced For Loops
- for (double element : values)
{
sum = sum + element;
}