Notes, summaries, assignments, exams, and exercises for Computer science for University

Network Fundamentals: DHCP, Subnetting, and Transport Protocols

Computer science10.25 KB

Dynamic Host Configuration Protocol (DHCP) Servers

What is a DHCP Server?

A DHCP Server is a network server that automatically provides and assigns IP addresses, default gateways, and other network parameters to client devices. It relies on the standard protocol known as Dynamic Host Configuration Protocol (DHCP) to respond to broadcast queries by clients.

Benefits of DHCP

A DHCP server automatically sends the required network parameters for clients to properly communicate on the network. Without it, the network administrator has to manually set up every client that joins the network, which can be cumbersome, especially in large networks. DHCP servers usually assign each client with a unique dynamic IP address, which changes when the client’s...

Continue reading "Network Fundamentals: DHCP, Subnetting, and Transport Protocols" »

Intel 8086 Microprocessor Architecture Explained

Computer science3.48 KB

Introduction to the Intel 8086

The Intel 8086 is a 16-bit microprocessor introduced in 1978 by Intel Corporation. It is a foundational member of the x86 family of processors, which has significantly influenced the development of modern personal computers. The architecture of the Intel 8086 microprocessor is based on the von Neumann model and consists of several key components, including the Arithmetic Logic Unit (ALU), Control Unit, Registers, Bus Interface Unit, and Clock.

Arithmetic Logic Unit (ALU)

The ALU is responsible for performing arithmetic and logical operations on data stored in registers or memory locations. Its capabilities include:

  • Adders for addition and subtraction
  • Multipliers for multiplication and division
  • Logical gates for AND,
...
Continue reading "Intel 8086 Microprocessor Architecture Explained" »

Jacobi Method Implementation in Fortran

Computer science3.12 KB

This section details the implementation of the Jacobi method in Fortran for solving a system of linear equations. The subroutine solucion_Jacobi takes a matrix A, a vector b, and an initial guess X as input, and returns the solution vector X.

Subroutine: solucion_Jacobi(A, b, X)

The subroutine begins with the following declarations and initializations:

  • use normas
  • integer, parameter :: Kx = 100
  • real(8), parameter :: tolerancia = 1E-6
  • real(8), allocatable :: X0(:), ERROR(:)
  • real(8), intent(in) :: A(:,:), b(:)
  • real(8), allocatable, intent(out) :: X(:)
  • integer :: i, j, k, n
  • real(8) :: sum, zero, ek

Where:

  • Kx is the maximum number of iterations.
  • tolerancia is the error tolerance.
  • X0 is the previous iteration's solution vector.
  • ERROR is the error vector.
  • A is the
...
Continue reading "Jacobi Method Implementation in Fortran" »

Process Planning and Scheduling in Operating Systems

Computer science4.92 KB

Process Planning

Objectives

  • Justice: Avoid favoring some processes over others.
  • Maximum Number of Interactive Users: Focus on most time-sharing systems.
  • Predictability: The strategy must enable the execution of processes.
  • Minimizing Overhead: Minimize context switches.
  • Balance in the Use of Resources: Resources must be used fairly and for as long as possible.
  • Safety Priorities: Established priorities should be respected.
  • Maximum Capacity of Execution: Minimize process changes.

Criteria

  • Response Time: Speed with which the system responds to a request.
  • Service Time: Response time minus time for I/O.
  • Runtime: Service time minus timeout.
  • Processor Time: Processor time occupation.
  • Timeout: Waiting times in queues.
  • Efficiency: Processor utilization.
  • Yield: Number
...
Continue reading "Process Planning and Scheduling in Operating Systems" »

MIPS Architecture and Procedure Calls

Computer science3.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" »

E1 Primary Access and Multiplexing in PDH and SDH Networks

Computer science2.91 KB

E1 Primary Access and Multiplexing

Multiplexing and Quantization

True or False: Multiframes are sent 500 per second in E1 primary access.

Plesiochronous multiplexers cause a loss of original formatting information.

CMI code requires greater bandwidth.

Question: What is the step size of a uniform quantizer with 2048 levels and a dynamic signal range of ±1V?

Answer: 0.977 mV

Question: How many quantization levels are in the second segment of a non-uniform quantizer using the A-law approach?

Answer: 16 levels

E1 Primary Access Characteristics

False Statement: In E1 primary access, the word alignment multiframe is transmitted every 15 frames.

True Statement: In E1 primary access, the word alignment multiframe is transmitted every 2 ms.

NFAS: Offers a speed...

Continue reading "E1 Primary Access and Multiplexing in PDH and SDH Networks" »

SQL Database Operations: Create, Query, Modify Data

Computer science5.48 KB

SQL Database and Table Creation

These commands demonstrate how to create a new database and define a table structure within it.

Creating the BDHotel Database

USE master;
GO
CREATE DATABASE BDHotel
ON
(
    NAME = 'BDHotel',
    FILENAME = 'c:\MSSQL7\Data\BDHotel.mdf',
    SIZE = 4MB,
    MAXSIZE = UNLIMITED,
    FILEGROWTH = 1MB
);

Creating the ROOM Table

USE BDHotel;
GO
CREATE TABLE ROOM
(
    NHabit INT NOT NULL,
    Building CHAR(1) NOT NULL,
    NumCamas INT NOT NULL DEFAULT (2),
    Available CHAR(1) NOT NULL,
    PRIMARY KEY (NHabit),
    CHECK (Building IN ('A', 'B', 'C', 'D', 'E'))
);

SQL Data Query Language (DQL)

The SELECT statement is used to retrieve data from a database. Here are various ways to query data.

Basic Data Retrieval (SELECT)

...
Continue reading "SQL Database Operations: Create, Query, Modify Data" »

Component Architecture: Layers, Objects, and Associations

Computer science2.54 KB

Component Architecture

A component diagram illustrates the three layers:

  • User layer (interface)
  • Login layer (business rules)
  • Data layer (database)

The use of interfaces and menus indicates who created the interface design.

Object Fundamentals

Class -> identity + state + behavior

Denormalization: The process of reverting from normalization, accepting redundancy and data dependencies to improve data performance. Data - Entity (instance, records)

Object Properties

Object properties:

  • Encapsulation: Objects hide their attributes, state, and behavior from other objects.
  • Inheritance: An object can inherit attributes and behavior from other objects.
  • Overriding: The ability to change or modify inherited attributes or behavior.
  • Composition: An object can be composed
...
Continue reading "Component Architecture: Layers, Objects, and Associations" »

CPU Registers: Functions, Types, and Architecture

Computer science3.31 KB

What Are CPU Registers?

Registers are very small but very fast memory units located inside the CPU. They are used to store data temporarily during the execution of instructions.

Whenever the CPU processes operations like addition, subtraction, or fetching data from memory, it uses registers to hold the data in between. You can imagine registers like a small notepad that the CPU uses to write down important information while working.

They are much faster than RAM and closer to the processing unit, allowing the CPU to read and write from registers instantly without wasting any time.

Types of CPU Registers

The CPU contains different types of registers, each with a unique function.

1. Accumulator (ACC)

  • This register is used to store the results of arithmetic
...
Continue reading "CPU Registers: Functions, Types, and Architecture" »

Mastering JavaScript Regular Expressions

Computer science5.38 KB

JavaScript Regular Expressions: An Introduction

This concise and clear introduction to Regular Expressions (RegExp) in JavaScript covers their usage, modifiers, patterns, methods, and string integration.

Regular Expressions are powerful patterns used to match, search, and manipulate strings. In JavaScript, regular expressions are objects used with string methods to perform pattern matching.


RegExp Syntax Fundamentals

You can define a regular expression using literal notation:

const pattern = /expression/modifiers;

Or by using the RegExp constructor:

const pattern = new RegExp("expression", "modifiers");

RegExp Modifiers (Flags) Explained

Modifiers change how a Regular Expression behaves:

ModifierDescription
gGlobal match (find all matches, not just the
...
Continue reading "Mastering JavaScript Regular Expressions" »