Sie sind auf Seite 1von 6

THINGS TO KNOW

Von Neumann Architecture


Has three characteristics
- Four major subsystems: memory, input/output, ALU, control unit
- Stored program concept
- Sequential execution of instructions
Memory and Cache
- Random Access Memory (RAM)
o Volatile information disappears when the power is turned off
o Memory is divided into cells, which are each associated with their own address
o All accesses to memory are to a specified address, and the minimum unit of access is a
cell
o The time it takes to fetch/store the contents of a cell in the same for all the cells in
memory
o Memory width a certain number of bits per cell
o Maximum memory size 2N
o Keep clear difference between address and contents
o Two basic memory operations
Fetch fetch a copy of the contents of the memory cellthe original contents
remain unchanged (nondestructive fetch)
Store store the specified value into the memory cell specified by the address
(destructive store)
o Memory registers used to implement fetch and store operations
Memory Address Register (MAR) - holds the address of the cell to be accessed
Memory Data Register (MDR) contains the data value being fetched/stored
o Fetch/store controller determines whether we put the contents of a memory cell in the
MDR or into a memory cell
- Cache Memory
o Principle of locality when the computer uses something, it will probably use it again
very soon
o High-speed memory unit
o Typically 5-10 times faster than RAM but much smaller
o Average access time = (cache hit rate * cache time) + (1-cache hit rate)*(cache time +
RAM time)
Input / Output and Mass Storage
- Input / Output allow a computer system to communicate and interact with outside world and
store information
- Nonvolatile memory mass storage systems
- Input / output devices
o Represent information in human-readable form
o Store information in machine-readable form
- Mass storage devices
o Direct access storage devices (DASDs)
Every unit has a unique address, but the time needed to access the information
depends on the physical location
Examples: CDs, DVDs, hard drives, etc.

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

How to Find Access Time for a Disk


1. Seek Time
a. Best case = 0
b. Worst case = (number of tracks 1)*(arm movement time)
c. Average case = (assumed average number of tracks)*(arm movement time)
2. Latency
a. Best case = 0
b. Worst case = rotation speed
c. Average case = a revolution
3. Transfer
a. 1/(number of sectors/track)*(rotation speed)

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;
}

Chapter 8: Designing Classes


- Actor classes objects of an actor class carry out certain tasks for you (Example: Scanner,
Random)
- Utility class class with no objects but static methods and constants Math class
- Immutable classes only accessor methods and no mutator methods

Das könnte Ihnen auch gefallen