ECE3073 Lecture Revision Flashcards
What is reentrancy?
The ability of a function to be executed concurrently in different processes with the same results. If the code is interrupted at one point, are we able to resume its execution?
What is a process period, initiation rate, initiation time and deadline?
Period: interval between process activations. Initiation rate: reciprocal of period. Initiation time: time at which the process must become ready. Deadline: time at which process must finish.
What is a semaphore?
An OS primitive for controlling access to critical regions and coordinating multiple processes. We can first get access to a semaphore by pending on it, then perform critical operations, then release the semaphore.
What is a deadlock?
One or more processes request resources but never receive the resource. Deadlocks are referred to as a deadly embrace, as one task holds a resource requested by another task that holds a resource requested by the first task.
How do we deal with deadlocks?
Acquire resources in the same order. Document the order globally. Wait on semaphores in the same order in all tasks.
What is a mutex?
A mutex will raise the priority of a process occupying a resource to the maximum of all processes which are blocked by the resource. This means that the original low priority task can run uninterrupted until it releases the resource.
How do we decide whether to use a semaphore or mutex?
Depending on how important the resource is. How quickly we want to release the resource. If we want to release as fast as possible, use a mutex.
What is a data flow graph?
A directed graph showing the data dependencies between a number of functions. The basic blocks of a model is a node with one entry point and one exit point. Control Data Flow Graphs implement branches which create multiple paths.
List and describe four optimisation strategies.
Expression simplification: constant folding (precompute noncritical calculations), algebraic simplification (factorise algebra into less calculations), strength reduction (replace multiplication or division by powers of 2 by left or right shifts for a less demanding operation). Dead code elimination: sometimes code is entered into a program for the sake of debugging when it will never be run by a user. Remove it! Procedure inlining: eliminate procedure linkage overhead by writing out the interior of a function whenever it is called instead of passing parameters and returns. Loop unrolling: reduce loop overhead and pipeline flushes by writing out multiple iterations of a loop in sequence so that execution requires less branches and control statements.
What are the functions of an assembler?
Translate labels into addresses. Handle pseudo-operations. Generate binary for symbolic instructions. Provide a one to one translation of assembly code to machine code.
What is a symbol table?
Used by compiler and assembler where each identifier of a source code is associated with information relating to its declaration such as type and location. Find the labels in a source code and convert it to specific addresses stored in the symbol table.
What are testing procedures, controllability and observability?
Testing procedures: Provide programs with inputs, execute the program and compare the outputs to expected results. Contrallability: ensure that we can cause a particular internal condition to occur. Observability: ensure we can see the effects of a state from the outside.
What is white-box testing?
Testing a program while knowing how the code operates. Test are usually generated from the program structure. Our tests may be more efficient but may not generate all the inputs which a typical user might input. They generally result in path based testing. Control the program to exercise a path, then observe the program to determine if the path was properly executed. May look at whether location on path was reached (control) or whether variable on path was set (data).
What is black box testing?
Tests are generated without knowledge of program internals. No care as to how the code actually work, but rather how it works! Select inputs from specifications, determine required outputs. Random: generate random tests, determine appropriate outputs. Regression: tests used in previous version of the system.
How do we evaluate our tests, and what is error injection?
Evaluating tests: keep track of bugs found, compare to historical trends. Error injection: add bugs to copy of code, run test on modified code to see if your tests will detect the bug.
What is cyclomatic complexity? What are different path testing strategies?
An upper bound to the control complexity of the program. Calculated as M=e-n+2p or M=#decisions+1. Branch testing: Exercise the elements of a conditional, not just one true and one false case. Domain testing: Test cases on the boundaries of inequalities. Test along the boundary as well as on either side. Loop testing: Skip the loop, perform different amounts of iterations, test if the results are as expected.
2006 Q1.1) What is a microprocessor?
A computer processor that incorporates the functions of a central processing unit on a single integrated circuit. It is a clock driven and register based circuit that accepts binary input as data and processes instructions stored on memory to produce a digital output.
2006 Q1.3) What is the difference between a microprocessor and a microcontroller?
A microprocessor is simple an integrated circuit with a CPU inside of it. It does not have any RAM, ROM or other peripherals on the chip. Microprocessors perform specific tasks based on specific inputs. A microcontroller has memory, IO, storage and peripherals integrated and can be thought of as an “all in one”.
2006 Q1.4) What is the difference between machine code and assembly language?
Machine code is binary code that can be executed directly by the CPU. It is a mixture of 1s and 0s and would be completely indiscernable. Assembly code is plain text code which has a 1:1 direct translation to a machine instruction. A compiler is used to convert this assembly code into machine code for the CPU to execute.
2011 Q1.1) Give the name and purpose of four peripheral registers contained in the NIOS UART peripheral.
Rxdata: This register is used for the received data through the UART terminals. Txdata: This register is used for the transmitted data through the UART terminals. Status: This register is used to store specific flags providing information about the transmission of data. The status register can detect different types of errors, or when there is an end of a packet encountered. Control: This register is used to enable specific features for the UART terminal such as enabling interrupts for different errors.
2006 Q2.3) What is memory foldover?
Memory fold-over is the effect of not decoding a particular address line resulting in some address bits being left as a “don’t care” Suppose we use a 20-bit address and we leave address bit A19 not decoded. If we choose to read and write address 0x00000, 0x00001… it will have the same effect as using addresses 0x80000, 0x80001.
2013 Q2.4) Explain the process of reading and writing data from a single transister memory cell.
To write to a memory cell, we place a particular logic ‘0’ or ‘1’ value on the appropriate vertical line known as the bit line. The word line then activates the transistor briefly, allowing the charge on the bit line to flow to the capacitor. To read from a memory cell, we assert a row line known as the word line, making the transistor conductive and allowing the charge stored in the capacitor to flow into the bit line. We then sense the amount of charge flowing in the bit line to determine its value.
2015 Q1.3a) What is the purpose of a direct memory access controller?
A direct memory access controller is an extra hardware device which monitors service requests from peripherals. It takes over the role of data transfers with pripherals from the processor. The DMA can transfer between a peripheral device and memory, bypassing the CPU. Without a DMA, all of the data from memory has to pass through the CPU. Each word of data has to be transferred from the disk, through the CPU and individually placed onto memory.