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

Sort by
Subject
Level

Understanding Paging and Virtual Memory in Computer Architecture

Classified in Computers

Written on in English with a size of 5.17 KB

5. A machine has a 32-bit address space and an 8-KB page. The page table is entirely in hardware, with one 32-bit word per entry. When a process starts, the page table is copied to the hardware from memory, at one word every 100 nsec. Lf each process runs for 100 msec (including the time to load the page table), what fraction of the CPU time is devoted to loading the page tables?

The page table contains 232 /213 entries, which is 524,288.  Loading the page table takes 52 msec. If a process gets 100 msec, this consists of 52 msec for loading the page table and 48 msec for running. Thus 52% of the time is spent loading page tables.

6. Suppose that a machine has 48-bit virtual addresses and 32-bit physical addresses. If pages are 4 KB, how many... Continue reading "Understanding Paging and Virtual Memory in Computer Architecture" »

Traffic Server Client Request and Response API Functions

Classified in Computers

Written on in English with a size of 5.13 KB

Traffic Server Client Request and Response API Functions

This document describes the Traffic Server API functions related to client requests and responses.

Client Request Functions

FunctionDescription
ts.client_request.get_methodRetrieves the current client request's method name. Returns a string like "GET" or "POST".
ts.client_request.set_methodOverrides the current client request's method with METHOD_NAME.
ts.client_request.get_versionReturns the HTTP version string of the client request.
ts.client_request.set_versionSets the HTTP version of the client request with the VERSION_STR.
ts.client_request.get_uriRetrieves the client request's path.
ts.client_request.set_uriOverrides the client request's path.
ts.client_request.get_uri_argsRetrieves the client
... Continue reading "Traffic Server Client Request and Response API Functions" »

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" »

Essential MIPS Assembly Programming Practice Problems

Classified in Computers

Written on in English with a size of 2.83 KB

1. MIPS Addition of Four Variables

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

add $e, $a, $b
add $e, $e, $c
add $e, $e, $d

2. MIPS Implementation of f = (g + h) - (i + j)

Mapping f, g, h, i, j to $s0, $s1, $s2, $s3, $s4:

add $t0, $s1, $s2
add $t1, $s3, $s4
sub $s0, $t0, $t1

3. Why is a MIPS Register 32 Bits?

32 bits occur frequently and thus in MIPS, it has a special name: ‘word’. A size of 32 aligns well with the MIPS instruction format.

4. Understanding Big Endian in MIPS

‘MIPS is Big Endian’ means the most significant byte is stored at the least address of a word.

5. Purpose of lw and sw Instructions

These are MIPS data transfer instructions used to access specific memory locations:

  • lw (load word): Transfer data from memory to
... Continue reading "Essential MIPS Assembly Programming Practice Problems" »

Understanding Microprocessor Architecture and Core Components

Classified in Computers

Written on in English with a size of 6.55 KB

  1. Introduction to Microprocessor

Definition:

  • “The microprocessor is a multipurpose, clock driven, register based, digital-integrated circuit which accepts binary data as input, processes it according to instructions stored in its memory, and provides results as output.”
    • “Microprocessor is a computer Central Processing Unit (CPU) on a single chip that contains millions of transistors connected by wires.” Introduction:
    • A microprocessor is designed to perform arithmetic and logic operations that make use of small number-holding areas called registers.
    • Typical microprocessor operations include adding, subtracting, comparing two numbers, and fetching numbers from one area to another.
  • Components of Microprocessor
    • Microprocessor is capable of performing
... Continue reading "Understanding Microprocessor Architecture and Core Components" »

Alpha Vantage API Integration for Stock Market Data

Classified in Computers

Written on in English with a size of 3.22 KB

Stock Market Data Integration

Listar

Stock Data Table Headers

OPENHIGHLOWCLOSEVOLUME

Alpha Vantage API Implementation

The following script utilizes jQuery AJAX to fetch real-time stock data for MSFT from the Alpha Vantage API.


function main() {
    $("#list").click(function() {
        $.ajax({
            type: "GET",
            url: "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo",
            success: function (azul) {
                var roxo = azul["Time Series (1min)"];
                for (var verde in roxo) {
                    var vermelho = roxo[verde];
                    var str = "<tr><td>" + vermelho["1. open"] + "</td>"
... Continue reading "Alpha Vantage API Integration for Stock Market Data" »

5 Essential Computer System Hardware Components Explained

Classified in Computers

Written on in English with a size of 1.76 KB

Computer System Components

There are five main hardware components in a computer system: Input, Processing, Storage, Output, and Communication devices. These devices are used for entering data or instructions into the central processing unit.

The Five Basic Components of a Computer System

  • Input Unit: Data and instructions must enter the computer system before any computation can be performed. The input unit links the external environment with the computer system to perform this task.
  • Output Unit: The job of an output unit is the reverse of an input unit. It supplies information and results of computation to the outside world, linking the computer with the external environment.
  • Storage Unit: Data and instructions entered through input units must
... Continue reading "5 Essential Computer System Hardware Components Explained" »

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" »