Notes, summaries, assignments, exams, and problems for Computers

Sort by
Subject
Level

Graph Theory and Algorithms Overview

Classified in Computers

Written on in English with a size of 27.7 KB

Loop Invariant:

Initialization:
1. The loop invariant states that after the 0th iteration...
2. Loop Invariant at alpha = 0
3. Before the first iteration ...
4. explanation of all the code before the loop
5. Thus the invariant is true after the 0th iteration (before first)
Maintenance:
1. Assume that the loop invariant is true after the (alpha - 1)th iteration. I will prove that after the (alpha)th iteration...
2. State loop invariant at alpha = alpha
3. On the (alpha)th iteration...
4. explanation of all the code within the body of the loop (might need to show mathematical logic)
5. As we can see, the invariant holds true after the (alpha)th iteration, thus proving maintenance.

Big-Theta, Big-Oh, Big-Omega

For the following definitions, recall that N+ is
... Continue reading "Graph Theory and Algorithms Overview" »

Microprocessor Techniques: Binary Codes and Instruction Execution

Classified in Computers

Written on in English with a size of 3.82 KB

The application of several binary codes in microprocessor technique

Nbà + integer arithmetic, table/matrix indexing, event counting., C2à integer arithmetic, exponents in floating point notation.,Bcdà Faults:not effetive use of binary Word, absence of sign., Grayà code disksor bars to control position of moving elements., AScià Communication(text), service of: mosaic display, printers, autonomous keyboards.

Neuman:

It has a single storage system, Processor needs two clocks cycles. Dont use pipeline, Only one bus is used for both data transfers, older

Harvards:

It has two separated memories, 1 cycle if appropiate pipeling strategies, It has separate data and instruction busses, modern

Enumerate the phases of processor instruction execution.

Instruction... Continue reading "Microprocessor Techniques: Binary Codes and Instruction Execution" »

MIPS Code Examples and Register Optimization

Classified in Computers

Written on in English with a size of 3.4 KB

Code in MIPS to add the 4 integer variables: a, b, c, d.

Add e,a,b # a gets b+c or a,b,c # a gets b+c

Add e,e,c # a gets a+dor a,a,c, # a gets a+d

Add e,e,d # a gets a+ eor a,a,e # a gets a+e

Code in MIPS for: f = (g + h) ‐ (i + j);

or #f,.., j are mapped to $s0, ., $s4
add t0,g,h #temp t0=g+hadd $t0,$s1,$s2

add t1,i,j #temp t1=i+jadd $t1,$s3,$s4

sub f,t0,t1 #f=t0-t1sub $s0,$t0,$t1

Why the size of a register is 32 bit?

32 bit occurs frequently and thus in MIPS, it has a special name ‘word’. Size 32 aligns well with the MIPS instruction format.

‘MIPS is Big Endian’ – what does it mean?

Most significant byte at least address of a word.

What are lw and sw instructions used for?

MIPS data transfer instructions with an address to access particular... Continue reading "MIPS Code Examples and Register Optimization" »

FIR vs. IIR Filters: Advantages, Disadvantages, & Structures

Classified in Computers

Written on in English with a size of 14.44 KB

FIR Filters

A Finite Impulse Response (FIR) filter is characterized by its finite-duration impulse response, settling to zero in a finite time. Unlike Infinite Impulse Response (IIR) filters, which can have internal feedback and respond indefinitely, an Nth-order discrete-time FIR filter's impulse response lasts precisely N+1 samples. FIR filters are predominantly implemented in software and can be continuous-time analog or digital and discrete-time.

Transfer Function of FIR Filter

Z

Frequency Response

Z

IIR Filters

An Infinite Impulse Response (IIR) filter is a recursive filter where the output is calculated using current and previous inputs and outputs. This feedback mechanism within the filter structure is a defining characteristic. IIR filter design... Continue reading "FIR vs. IIR Filters: Advantages, Disadvantages, & Structures" »

MIPS Architecture and Procedure Calls

Classified in Computers

Written on in English with a size of 3.74 KB

What is a Basic Block?

A basic block is a sequence of instructions with no embedded branches (except at the end) and no branch targets (except at the beginning). A compiler identifies basic blocks for optimization. An advanced processor can accelerate the execution of basic blocks.

Six Steps Involved in Procedure Calling

  1. Place parameters in registers.
  2. Transfer control to the procedure.
  3. Acquire storage resources.
  4. Perform the desired operation.
  5. Place the result in a register for the caller.
  6. Return to the point of origin.

Register Saving Responsibilities

Between the caller and callee, the responsibility for saving registers is as follows:

  • Temporary registers ($t*): Can be overwritten by the callee.
  • Saved temporary registers ($s*): Saved and restored by the
... Continue reading "MIPS Architecture and Procedure Calls" »

Dynamic Table Generator

Classified in Computers

Written on in English with a size of 59 bytes

Dynamic Table Generator

ROW:
COL:

MIPS Overflow, Floating-Point Arithmetic, and Digital Logic

Classified in Computers

Written on in English with a size of 6.76 KB

1. Half-Adder Truth Table and Circuit

For a two single-bit input, draw the truth table and corresponding circuit for the half-adder.

Truth Table

Where A and B are the input values, C is the output carry, and Σ is the sum.

ABC (Carry)Σ (Sum)
0000
0101
1001
1110

(The question also requires a circuit diagram, which typically consists of an XOR gate for the Sum and an AND gate for the Carry.)

2. MIPS Overflow Handling Options

MIPS provides the following instruction options to handle overflow:

  • add, addi, sub: These instructions cause an exception on overflow.
  • addu, addui, subu: These instructions do not cause an exception on overflow.

3. MIPS Signed Addition Overflow Check

To avoid exceptions when performing signed addition, one can use addu and check for overflow... Continue reading "MIPS Overflow, Floating-Point Arithmetic, and Digital Logic" »

C Development Tools and Functions: A Comprehensive Guide

Classified in Computers

Written on in English with a size of 2.85 KB

Which C development tool may add automatically malicious source code to the original application source code?

C Preprocessor

Which C software development tool may inadvertently add compiled object/binary code to the original compiled application object code?

Linker or Linkage Editor

If two programmers are developing two separate files a.c and b.c to be merged into one source code before compilation, and one declares in a.c global integer variable int j; how should the other programmer declare and use the same integer variable j in the source code b.c. Write a line of code that allows the second programmer to use in b.c declaration of variable j from the first file a.c?

extern int j;

What does ELF specify?

Executable file format, Executable file header,... Continue reading "C Development Tools and Functions: A Comprehensive Guide" »

Operating Systems: Functions, Components, and Network Basics

Classified in Computers

Written on in English with a size of 3.51 KB

Functions of Operating Systems

Processor Management

The Operating System distributes the processor between different programs.

Random Access Memory Management

The Operating System coordinates the memory space that each application has. When physical memory is insufficient, the Operating System can create a "virtual memory" on the hard disk.

Input/Output Management

The Operating System allows the unification of program access to material resources through controllers.

Execution of Application Administration

The Operating System is responsible for ensuring that applications run smoothly.

Authorization Management

Guarantees that resources are only used by programs and users with the corresponding authorizations.

File Management

The Operating System manages... Continue reading "Operating Systems: Functions, Components, and Network Basics" »

Flowcharts, Programming Languages, and the C Language

Classified in Computers

Written on in English with a size of 5.56 KB

Understanding Flowcharts

The pictorial or graphical representation of the flow of a program is known as a flowchart. If algorithms or programs are displayed in the form of a picture, then it will be more noticeable and recognizable. We only need to know some specific shapes to represent each process or action. The fundamental shapes and descriptions used in flowcharts are as follows:

  • Rhombus: For decision-making and branching the flow of execution.
  • Rectangle: For processing and assigning variables.
  • Parallelogram: Accessing inputs and printing outputs.
  • Rectangle with Curved Edges: Start/Begin or Stop/End of the program execution.
  • Circle: Connectors to continue the flow of execution.
  • Arrow: Represents the direction of the flow of execution.

j9uY63M2wBnveRcyLNUIT34Tu4aWeSqdlhox9JkprjEzmiyBmtmP8KZOE9ItyPleqb820RulOWNBK3GMhvqLvE3HpnmwwrHzb7DE88UBI3YtVUPP5F33nd5VQA0aF_e2ICZ6AW7YV-ajFuT7HcyJt-c4Xh9Iektloljd0DiRGjXFpHgP_xKeDfpPLZEH2Q


Programming

... Continue reading "Flowcharts, Programming Languages, and the C Language" »