NEB 12 Computer Science flashcards
NEB 12 Computer Science · Build recall with a focused review session.
33 cards. Read the term and the definition here. The deck at the top of this page is optional.
- Two's complement range
- In an n-bit two's complement system the representable range is −2^(n−1) through 2^(n−1)−1, so 8 bits cover −128 to 127 and there is only one representation of zero.
- Hexadecimal digit to bits
- Each hexadecimal digit corresponds to exactly four binary bits, so hex F is 1111 and hex A is 1010; grouping binary digits in fours from the right converts back to hex.
- De Morgan's theorems
- The complement of a sum equals the product of the complements, (A+B)' = A'·B', and the complement of a product equals the sum of the complements, (A·B)' = A' + B'.
- Universal gates
- NAND and NOR are called universal gates because either one alone can be wired to produce NOT, AND and OR functions, so any logic circuit can be built from it.
- Half adder outputs
- A half adder adds two bits and produces Sum = A XOR B and Carry = A AND B; it has no carry input, so it cannot add multi-bit columns alone.
- Von Neumann stored program
- Instructions and data are held together in the same main memory and fetched sequentially by the program counter, which is the defining idea of the stored-program computer.
- Cache memory purpose
- Cache is small, fast memory between the CPU and main RAM that holds recently used instructions and data to reduce average memory access time.
- Volatile versus non-volatile memory
- Volatile memory such as RAM loses its contents when power is removed, while non-volatile memory such as ROM, flash and magnetic disks retains data without power.
- Multiprogramming versus multitasking
- Multiprogramming keeps several jobs in memory so the CPU always has work when one job waits for I/O; multitasking time-slices the CPU so several tasks appear to run at once.
- Compiler versus interpreter
- A compiler translates the whole source program into object code before execution and reports all errors together; an interpreter translates and runs line by line, stopping at the first error.
- Call by value
- In call by value the function receives a copy of the argument, so changes made inside the function do not affect the caller's original variable.
- Stack versus queue
- A stack is last-in-first-out with push and pop at one end, while a queue is first-in-first-out with insertion at the rear and deletion at the front.
- Circular queue advantage
- A circular queue reuses freed front positions by wrapping the rear index around, avoiding the false overflow that a linear array-based queue shows when space is free.
- Primary key
- A primary key is a column or column set that uniquely identifies each row of a table, cannot contain null values, and is usually indexed.
- Foreign key
- A foreign key is a column whose values must match a primary key in another table or be null, enforcing referential integrity between related tables.
- DDL versus DML
- Data definition language covers CREATE, ALTER and DROP for defining structures; data manipulation language covers INSERT, UPDATE, DELETE and SELECT for working with rows.
- OSI reference model layers
- The seven OSI layers from bottom to top are physical, data link, network, transport, session, presentation and application, each handling a distinct communication concern.
- TCP versus UDP
- TCP is connection-oriented, acknowledges segments and retransmits lost data, so it is reliable but slower; UDP is connectionless with no guarantees and suits streaming.
- Usable hosts in a subnet
- For a prefix length p, total addresses are 2^(32−p) and usable host addresses are that total minus two, because the network and broadcast addresses are reserved.
- Star topology
- In a star topology every device connects to a central hub or switch; a single cable failure affects only one device, but failure of the centre disables the whole network.
- GET versus POST
- GET appends form data to the URL as visible name-value pairs and is length-limited; POST sends data in the request body, hiding it from the address bar.
- Static versus dynamic web page
- A static page is a fixed file returned exactly as stored, while a dynamic page is generated per request by server-side code, often from a database.
- Computer virus versus worm
- A virus inserts itself into a host file and spreads when that file is executed, whereas a worm self-replicates and propagates across networks without a host program.
- Phishing
- Phishing is a social-engineering attack that sends fraudulent messages imitating a trusted organisation to trick recipients into revealing passwords or financial details.
- Firewall
- A firewall inspects incoming and outgoing network traffic and permits or blocks packets according to configured rules, forming a barrier between trusted and untrusted networks.
- Digital divide
- The digital divide is the gap between groups with reliable access to computers, internet and digital skills and those without, often following income, region and gender lines.
- Binary search precondition
- Binary search requires the array to be sorted; it compares the target with the middle element and discards half the remaining range each step, giving O(log n).
- Bubble sort behaviour
- Bubble sort repeatedly compares adjacent elements and swaps them when out of order, pushing the largest remaining value to the end each pass; worst case is O(n²).
- Recursion base case
- A recursive function must include a base case that returns without calling itself, otherwise the calls never terminate and the stack overflows.
- Flowchart decision symbol
- A diamond in a flowchart represents a decision with one input and two labelled outputs, typically Yes and No, branching the flow of control.
- C string terminator
- A C string is a character array ending with the null character '\0'; functions such as strlen and printf rely on it to know where the text stops.
- fopen modes
- fopen opens a file and returns a FILE pointer; mode "r" reads an existing file, "w" creates or truncates for writing, and "a" appends at the end.
- Algorithm properties
- A valid algorithm must be finite, definite in each step, accept zero or more inputs, produce at least one output, and be effective enough to carry out.