CS Final

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Understand the idea of a compute bound process.

A compute bound process is bound by the speed at which the CPU can perform tasks. Improving the speed of anything other than the CPU will not improve execution time, only giving it more CPU time, or increasing the speed of the CPU, will.

Understand the CPU and its parts

ALU: Arithmetic logic unit does arithmetic and logic operations control unit: directs the operation of the processor. tells the memory, ALU, and i/o what do do and how to respond to instructions register unit: cache, quickly accessable memory general and special purpose registers: cache, holds stuff

Know about AND, OR, XOR, NOT, NAND, gates, and gate symbols in the text.

AND: 00 01 OR 01 11 XOR 01 10 NOT 01 NAND 11 10

Understand the idea of an I/O bound process.

An I/O bound process is limited by the speed of the I/O (disk, ram, network) to complete its task, and is often waiting for information from these devices. Increasing the speed of the CPU will not significantly decrease execution time, only increasing the speed of the I/O will.

What is the difference between assemblers and compilers? What are translators and interpreters?

An assembler translates assembly code to machine code. The translation is mechanical, and can be done in only one way. In contrast, a compiler has more freedom when it compiles the relevant programming language - it can optimize, for example, and even non-optimizing compilers produce different code. Also, compilers can be written in a way that separates the "front-end" (corresponding to the programming language) and the "back-end" (corresponding to the computer architecture), whereas with assemblers the two are always the same. Interpreter: An interpreter is a program which translates statements of a program into machine code. It translates only one statement of the program at a time

What are identifiers in programming languages

An identifier is a string of alphanumeric characters that are used to represent various programming elements such as variables, functions, arrays, structures, unions and so on.

What is an operating system, be able to cite examples.

An operating system is the software that controls the overall operation of a computer. Oftentimes this includes a file manager, a desktop environment, and supporting applications, but these are all optional. Some examples are macOS, Linux (Debian,Ubuntu,Linux Mint, elementaryOS, Red Hat, CentOS, Fedora, Gentoo, Arch, Manjaro, Antergos, Suse, openSuse, Puppy, etc.), MS Windows, BSD (freeBSD, trueOS, netBSD, pcBSD), DOS (freeDOS, MSdos, etc), etc. In operating systems like Arch, installing anything past the bash command line is up to the user, which means that the user may not have a GUI, file manager, and even basic programs like sudo. (yes, you have to install sudo yourself in arch.)

What is the difference between a batch processing and a multiprogramming computer system.

Batch processing is the process of collecting jobs into a single batch, then executing them without further interaction. Multiprogramming is where the kernel allocates time slices to different processes and handles switching between then after each time slice is up.

*Work through calculations for CPU utilization.

CPU Time used for process/time to complete process

Describe what is CPU utilization.

CPU utilization is a measure of the relative utilization of the CPU as a percent of the maximum total usage. In this class, it mainly refers to the percent of time that the CPU is doing something divided by the total time, but in real life CPUs, this may not be the case. Modern CPUs can do many instructions per clock (IPC), but they may not all be used, or a program could only be single threaded when there are multiple cores on a CPU.

Understand the concepts behind contention, deadlock, and semaphores in operating systems.

Contention: multiple things need a thing Deadlock: cannot continue because things block eachother Semaphores: indicate that you need a thing so noone touch it

What do . (a single period) and .. represent in the nomenclature of filesystem meta data?

Current/active dir parent dir

Give examples of slow hardware.

Disk, network, user

Understand the basic idea of time-sharing a CPU.

Dividing the CPU time between multiple processes so that it may appear to have multiple programs running when in fact the CPU can only run one at a time (unless it is multithreaded, multicore, or multicpu machine)

*Be able to decode and trace through a sequence of machine instructions. *Be able to encode, decode, and interpret a machine instruction of book's example 8-bit machine language (Appendix C). Understand the "parts" of the book's example 8-bit machine language (with the help of Appendix C). *Be able to express sequences of high-level imperative logic (algorithms) as a sequence of machine instructions.

Do code with statements in list given

*What is an expression tree? How is one derived from a mathematical expression written in a programming language?

Expression tree is where you have cirlces for values and operators and link them to form the correct math formula.

Know how to use recursion in Python.

Function that calls itself

Understand and apply Hamming distance in a simple error-correcting code. Understand the limitations of parity and error-correcting-codes.

Hamming distance is number of bits to have to change to be a different value Limitations of partiy: can only detect odd number of changes, and cannot always recover.

Understand the hidden terminal problem.

Hidden terminal problem is when different machines cannot communicate with each other, but they can communicate with a central AP, so they might talk over each other if they are not careful. Solution: Require request and AP acknowledgment (acks) before transmitting entire message. If no acks are received, it waits and tries again.

*Understand truncation and round-off error error in the context of floating point arithmetic.

If there are not enough bits in the mantissa to hold all of the decimal places of the number.

Understand how the operating system "deletes" files, and why this doesn't mean the file data is removed from the disk.

In FAT Filesystems, files are deleted by merely removing the reference to them that is stored in the File Allocation Table, and making that space instead as empty, ready to be overwritten. To securely delete a file, it must be overwritten many times on a HDD, once on an SSD, or just keep it encrypted and then it just looks random to begin with, and you can forget the password.

*Be able to interpret a chain of cluster (block) indices in a FAT like file system.

Read in the blocks in the order of the block chain. Stop when length is the specified length.

*Understand and apply the rules of even or odd parity.

The parity system just described is called odd parity, because we designed our system so that each correct pattern contains an odd number of 1s. Another technique is called even parity. In an even parity system, each pattern is designed to contain an even number of 1s, and thus an error is signaled by the occurrence of a pattern with an odd number of 1s. if it doesnt have the right number of ones, then an error has occurred.

What does a grammar describe about a programming language?

The parsing process is based on a set of rules that define the syntax of the programming language. Collectively, these rules are called a grammar.

What is a context-switch?

The procedure of changing from one process to another is called a process switch (or a context switch).

How are constants in programming languages and how do they differ from literals? Is one better than the other?

const string x = "hello world" x is constant, "hello world" is a literal

Know how to define and use functions (procedures) in Python.

def procedure(inputs): do shit optionally, return

Know Figure 1.3 (Simple Flip-Flop)

it flip flops

Be able to infer parent-child relationships from directory tables.

look at starting clusters and locations of folders (zero size objects)

What is ambiguity in domain of programming language grammars?

more than one way to interpret something

*Know excess notation and how to convert decimal (base 10) integer values to and from an excess notation.

n bit excess: Value = plain binary - 2^n plain binary = excess value + 2^n

Describe a tree data structure.

nodes with some children, no loops or going up, or having nodes that are children of multiple others

*What is left-child first (also called in-order) traversal of an expression tree mean? How does an expression tree provide structure an order to the generation of machine code for value calcuations? *Understand how CPU registers can be assigned to expression tree nodes to facilitate efficient calculations.

once you have an expression tree, use left child first traversal and store the node value in the same value as the left child. by left child first traversal

*Be able to compress and decompress using the adaptive dictionary technique.

once you see a space, add to dictionary

*Know how to convert (to and from) base 10 whole and fractional value to the book's toy 8-bit format. *Know the book's toy 8-bit floating point format (bits for sign, exponent, and mantissa; normalized form).

one bit sign (plain plus minus on the value) three bit exponent (in excess 4 notation, moves decimal from .XXXX) four bits mantissa (normalized so first is always a one unless it is zero.

In a machine instruction, what is the distinction betwween op-codes and operands?

op code is the first hex digit of the instruction, tells it what to do, operands are what it acts on, the last three digits

*Understand the rules for adding binary numbers, be able to relate them to the same rules for adding decimal (base 10) numbers. *Understand binary representation of whole numbers and fractions. *Understand how to convert between binary (as well as radix binary) and decimal equivalent values.

powers of two

Know how to use Python format specifiers (with {}) to display variable values.

print("%s is %d years old." % (name, age))

Understand how to print information in the Python console.

print(x)

Use the newline character (\n) properly in formatted text output from Python.

prints a newline

Understand the importance of the stored-program-concept.

program and memory saved in memory and can be changed.

What does range(1,100) or range(20) produce?

range(1,100) includes 1 but not 100 range(20) includes 0 but not 20

What is the difference between a set and a list (there are two important differences).

set: unordered, no duplicates list: ordered, can have duplicates

Learn the different ways to specify literal strings in Python.

single quotes, double quotes, or triple quotes, with normal c++ string escape things

*How are the processes of lexical analysis, parsing, and code generation associated with each other? What are each?

source program -> lexical analyzer (process of recognizing strings and symbols 153 -> factor , * -> term , + -> expression) -> parser (creates parse trees (the ones with expressions (+,-), terms (*,/), and factors (x,y,3) -> code generator (turns parse tree into machine code) -> object program

What does booting a machine mean? Why is the bootstrap process special?

starting it up is special because to get stuff into memory it has to do stuff, which it cant yet because it isnt booted. to get around this, it executes a specified instruction by the bios.

Appreciate the difference between "3 * 4 + 1" (note the quotes) and 3 * 4 + 1.

string vs expression

What is the root directory or folder of a filesystem? What is its significance?

the top one.

What are control structures or control statements in programming languages? Do all languages have them?

things like if(test) do shit fucκ, or while loops you could construct such loops in assembly but they are not explicitly defined.

How are ram and disk different?

volatility, size, speed

Understand while loops in Python (Python does not have a post-test looping structure :()

while(test): do stuff

What are keywords (also called reserved words) in a programming language?

words that mean something special to the lexical analyzer (if, else, int, etc.)

What is an assignment statement? What machine code operation would you associate with assignment?

x=3 2R03

What does return mean in a procedure? What instruction is evaluated after return? How should input (arguments) and output (return values) be described in procedures?

you exit the procedure, it evaluates to the return value in any functions. none def function(arguments) { do shit; return othershit;}

Understand how boolean expressions are written and used in Python.

!= == <= >=

Be familiar with the basic properties of the FAT file system. Explain the terms Cluster (aka Block), File Allocation Table (FAT), Cluster (Block) Chain, and Index. What is the difference between these terms: a folder, a directory, a file, and a directory path?

(Naively) stores files sequentially Keeps a table of where files are and the blocks that they occupy (blockchain) Doesnt do checksumming, CoW, encryption, compression, or snapshotting Cluster: a number of bytes taken to be one continuous unit of data. File Allocation Table: a system of keeping track of which files use which clusters to store data, their names, and their lengths. Block Chain: the chain of blocks that, when read sequentially, create a file that spans between them Index: the location of each cluster on the disk Folder: a place where you can put files or other folders. Can be inside other folders Directory: Synonomous with folder, but has a path to get to it from the root directory (the directory that isnt inside any others) File: some information that can be accessed inside a folder. Directory path: the instructions on how to get to a folder from another one, generally from the root directory, but sometimes relative to another directory

Understand basic mathematical expressions in Python.

+,-,*,/,** do "proper" maths, not computer maths

*Write a state diagram for a process in an operating system.

->Program and Data load from disk, process creaton (Ready) (Ready)->(Running) Timeslice begins (Running) (Running) -> (Ready) Timeslice ends (Running) -> (Blocked) Program waiting for slow hardware, disk, network, user (Blocked) (Blocked) -> (Ready) Hardware Responds, interrupt (Running) -> ((Finished)) Process finishes, exits

*Understand how to describe a sequence of bits in hexadecimal notation.

0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F

*Given a data dependency graph, detect if there is the potential for deadlock.

1. There is competition for nonsharable resources. 2. The resources are requested on a partial basis; that is, having received some resources, a process will return later to request more. 3. Once a resource has been allocated, it cannot be forcibly retrieved.

Know the three conditions that must exist for deadlock to occur.

1. There is competition for nonsharable resources. 2. The resources are requested on a partial basis; that is, having received some resources, a process will return later to request more. 3. Once a resource has been allocated, it cannot be forcibly retrieved.

What is the "size" of a directory or folder? How much space does each directory entry consume?

24 or 25 bytes. look at entries and size of current folder.

How are imperative languages different than declarative languages? Do you "program" differently in them?

In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow. Many languages that apply this style attempt to minimize or eliminate side effects by describing what the program must accomplish in terms of the problem domain, rather than describe how to accomplish it as a sequence of the programming language primitives[2] (the how being left up to the language's implementation). This is in contrast with imperative programming, which implements algorithms in explicit steps. Declarative programming often considers programs as theories of a formal logic, and computations as deductions in that logic space imperative program consists of commands for the computer to perform. Imperative programming focuses on describing how a program operates.

*Given a service dependency graph, determine if there is a single point of failure in the system.

Is there one thing that would take out, either directly or indirectly, everything else? That is the single point of failure.

Understand the for Iteration Construct in Python (for c in aString : ...) Understand the for Iteration Construct in Python (for e in aList : ...) Understand the for Iteration Construct in Python (for e in aSet: ...) Understand the for Iteration Construct in Python (for i in range(100) : ...) Understand the for Iteration Construct in Python (for x in range(len(aList)) : ...)

Iterates over character, elements, element, [0,99], [0,len(aList)-1]

Learn what tracing through an algorithm means and the most common way to document tracing. Practice the skill of tracing through psuedo code to confirm its correctness or detect its flaws. Practice the skill of writing algorithms in pseudo code.

Just go through it and write out what it does in too much detail.

Learn basic terminology of network classifications.

LAN: Local Area Network MAN: Metropolitan Area Network WAN: Wide area network AP: Access Point, connect to a network over radio broadcast Protocols: rules on which activities are conducted CSMA/CD: Carrier Sense, Multiple Acess with Collision Detection WiFi: IEEE 802.11, local area network over radio waves Repeater: repeats signals at higher signal strength, passes between two busses Bridge: similar to repeater but doesnt pass all messges. Switch: controls traffic between more busses, where packets are directed only where they need to go Internet: the mass of connected computers over protocols such as http, https, ftp, smtp, ntp, TCP/IP, ssh, telnet, NNTP, MIME. IMAP, POP3, VOIP Routers: a device for connecting a LAN to a WAN (or internet) (gateway), has a forwarding table that controls which packets should go to which computers. DNS: a service for using a url rather than an ip address IPs are given out by the internet corporation for asignmed names and numbers, or ICANN N unicast: sending n messages to n recipients, induvidually multicast: sending one email to all recipients CDN: Content deliveray networks, anycast Port numbers, different channels used for different things, mostly arbitrarily

Know what a machine language is, what distinguishes it from "higher level" languages like Python?

Machine independent (and easier to code in) machine dependent. deals with hardware

Know about the special registers: program counter (PC) and instruction register (IR).

PC is where we are, moves by +2 each time unless jump or halt IR holds what we are currently doing

Know the precedence and associativity of the common mathematical operators. What binary operators, what do precedence and association mean for a binary operator? How do operator precedence and associativity govern the construction of an expression tree? How are these rules overridden?

Precedence, which to go first: PEMDAS Associativity, which two to evaluate: most things left associative (a+b-c -> (a+b)-c) however exponentiation and assignment are right associative (5**x**y -> 5**(x**y) and a=c=3 -> c=3, a=c) Which order and to what things are performed, parentheses.

When a sequence of terminals cannot be parsed by a set of grammar rules, what type of error is it called?

Syntax error

What is a timeslice in a multi-programmed operating system?

The amount of continuous time the kernel gives to a process before it is interrupted to let the kernel perform a context switch.

Understand the difference between application (user) software and system (kernel) software.

The kernel is used to handle the process that keep the computer running, interpret and handle hardware, and allocate time to user processes. It operates generally without user input, but in some cases (sysrq) can directly take user input. User software is software that the user installs and runs, and is given execution time by the kernel.

*Be able to interpret a state-diagram in the context of traversing a sequence of numbers. *Read and write state-diagrams.

Unterminated arrow means starting or from any state Arrow pointing from and to means going to, has condition associated with it Circles are states (that are written in them) Double circle means finished

*Be able to draw a data dependency graph from a table of resource sharing relationships.

What data each thing needs

*Be able to draw a service dependency graph for a collection of processes.

What things each thing needs

*Given a set of grammar rules, how are derivational steps used to parse a sequence of terminals?

You go through each of them and implement them until the structure you have built does what you want. terminals have no further evaluation (cirlces) and nonterminals can evaluate further (squares)

What is a data type in a programming language? Be able to cite examples of common data types.

a format of storing data short int unsigned short int int unsigned int long int unsigned long int long long int unsigned long long int float double string char array vector etc.

Know what a bit is.

a fucκing one or zero

How are arguments and returned values "connected" to values in the calling logic? By name, value, or position? Understand the application of repeat-while, repeat-until, and while-do loops. Understand the common iterative structures: enumerative (for loops), pre-test while-do and post-test repeat-while. Know the fundamental difference between pre-test and post-test loops.

arguments generally passed by value, although sometimes by reference (position). returned values are also generally by value. do-while loop, do-while loop, while loop for loop, while loop, do-while loop. test before vs test after loop. you always do one in the latter.

Be familiar with ASCII.

a=110 0001 A=010 0001

*Know how to add or subtract two's complement values and detect overflow. *Know how to convert from two's complement to decimal and vice-versa.

add like normal, if adding two things of same sign or subtracting two things of opposite sign, if the sign changes there was overflow

Understand the basic ideas of memory cells, their values, and their addresses.

address value 00 01 01 34 02 99 etc. each is a memory cell

Given a cluster (block) size in bytes, state how many clusters a file of given size (in bytes) will consume.

blocks = ceiling(bytes/(bytes per cluster))

Learn how to print prompts in Python, and read user input from the keyboard.

int(input()) float(input())

Understand the fetch-decode-execute loop of all conventional CPUs.

gets instruction, then decodes it, and executes that, then gets the next.

What does break do in Python?

goes up one loop

Understand how folders or directories differ from "normal" files at the filesystem level.

hold other things, no size, have a table of things

What steps must be taken to move a file system entity between two directories ("folders")?

https://drive.google.com/file/d/0BymUZnmG3r2XTXNfSjY5dkZDMDg/view

Know how to write simple if statements in Python, if-else statements, and if-elif statements.

if(statement): doshit elif(statement): othershit else: fucκ (<- I win quizlet)

Learn how to load modules in Python, access help for the modules, and access module functions.

import time import os import shit fucκ

What does the str function do in Python?

int -> ascii letter


Kaugnay na mga set ng pag-aaral

Principles of Management Final Exam (Chapters 10, 11, 13)

View Set

Psychology Test 2 Specific Phobia

View Set

2021 NC Drivers Permit Test Questions

View Set

Computer forensics - 2nd half - quiz 13, Computer forensics - 2nd half - quiz 14, computer forensics - 2nd half - chapter 15, computer forensics - 2nd half - quiz 16, CH 16 Ethics for the Expert Witness

View Set