Notes, summaries, assignments, exams, and problems for Computer science

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

Computer Hardware and Operating System Fundamentals

Computer science1.98 KB

Microprocessor

A microprocessor is an integrated circuit with millions of tiny transistors that process instructions and data from memory.

  • Clock rate: The microprocessor's speed.
  • Number of bits: The amount of data a computer can process at once.

Memory

  • RAM: Main memory for temporary data storage.
  • ROM: Memory for startup programs and diagnostics.
  • Cache: Stores frequently used data for the microprocessor.

Storage

  • Hard disk: Device for permanent information storage.

Operating System

The operating system is a set of commands and programs that control basic computer processes and enable other programs to run.

  • Manages the microprocessor, coordinating computer work.
  • Manages memory and storage systems.
  • Provides a user interface.
  • Enables communication between applications
...
Continue reading "Computer Hardware and Operating System Fundamentals" »

C Programming Basics: Examples and Explanations

Computer science2.72 KB

C Programming Basics

Printing a Message

int main() { print("Hello!!!"); }

Variables and Mathematical Calculations

int main() // Main function

{

int a = 25; // Initialize a variable to 25

int b = 17; // Initialize b variable to 17

int c = a + b; // Initialize c variable to a + b

print("c = %d ", c); // Display decimal value of c

}

Floating-Point Math

int main() // Main function

{

float r = 1.0; // Set radius to 1.0

float c = 2.0 * PI * r; // Calculate circumference

print("circumference = %f \n", c); // Display circumference

}

Arrays

int main() // Main function

{

int p[] = {1, 2, 3, 5, 7, 11}; // Initialize the array

print("p[0] = %d\n", p[0]); // Display what p[0] stores

print("p[3] = %d\n", p[3]); // Display what p[3] stores

p[3] = 101; // Assignment

}

...
Continue reading "C Programming Basics: Examples and Explanations" »

Collaborative Study Guide: CSE 12 Complexity, Generics, Data Structures & Algorithms

Computer science64.95 KB

COLLABORATIVE SOLUTIONS FOR PRACTICE PROBLEMS

CSE 12

God help us all

ALL MIGHTY CS LORDS GIVE US MERCY


  • Use the google comment system to ask questions or leave comments on any answer

  • How to use comments: https://support.Google.Com/docs/answer/65129?Hl=en

  • When you write an answer, add the question along with the answer

  • Add an explanation for your answer

  • Always doubt everyone else’s answers until you confirm for yourself they’re correct

____________________________________________________________________________

Complexity Problems



  1. Consider a small array a and large array b. Accessing the first element of a takes more/less/the same amount of time as accessing the first element of b.


A. The same amount of time

B. Less time  

C. More time

Should be the same...

Continue reading "Collaborative Study Guide: CSE 12 Complexity, Generics, Data Structures & Algorithms" »

Understanding SDLC Models and System Analysis Techniques

Computer science94.48 KB

Define SDLC models? What are the most known SDLC model?

An SDLC model defines implementation of an approach to the project. It defines the various processes, and phases that would be carried out throughout the project to produce the desired output. There are a variety of SDLC models that exist catering to different needs and characteristics of a project. Some are of iterative nature (Prototyping), whereas some are sequential (waterfall).

Some of the well-known SDLC models are:
Waterfall model, Software prototyping, Rapid application development,

Extreme programming, and End user development. 

List Advantages of using system analysis and design techniques in approaching computerized info system?

  • Identifies and solves the right problems
  • Implement
...
Continue reading "Understanding SDLC Models and System Analysis Techniques" »

Understanding MapReduce Design Patterns

Computer science18.71 KB

MapReduce is a computing paradigm for processing data that resides on hundreds of computers, which has been popularized recently by Google, Hadoop, and many others. The paradigm is extraordinarily powerful, but it does not provide a general solution to what many are calling “big data,” so while it works particularly well on some problems, some are more challenging. This book will teach you what problems are amenable to the MapReduce paradigm, as well as how to use it effectively. At first glance, many people do not realize that MapReduce is more of a framework than a tool. You have to fit your solution into the framework of map and reduce, which in some situations might be challenging. MapReduce is not a feature, but rather a constraint....

Continue reading "Understanding MapReduce Design Patterns" »

CPU Scheduling: Understanding Processes and Threads

Computer science5.07 KB

1. Processes

A process is a program in execution. It is a unit of work within the system. A program is a passive entity, while a process is an active one. A process needs resources to accomplish its task (CPU, memory, I/O, files). Process termination requires the reclamation of any reusable resources. A single-threaded process has one program counter, specifying the location of the next instruction to execute. The process executes instructions sequentially, one at a time, until completion. A multithreaded process has one program counter per thread. Concurrency is achieved by multiplexing the CPUs among the processes or threads.

2. Process States

As a process executes, it changes its state:

  • New: The process is being created.
  • Running: Instructions
...
Continue reading "CPU Scheduling: Understanding Processes and Threads" »

MS-DOS Memory Management: Conventional, Upper, Expanded

Computer science3.53 KB

MS-DOS Memory Management

The memory management depends on the version of MS-DOS we use and the CPU that we have.

Processor Memory Limits

Processors have different address limits:

  • 8088 / 8086 (XT): handle up to 1 MB
  • 286 (AT): handle up to 16 MB
  • 386: handle up to 4096 MB

Conventional Memory

Conventional memory is where programs run; you must manage it properly and release memory when possible.

0 Kb

S.O.

Contains the interrupt table, computer specification, etc.

2 KB

Core MS-DOS Files

The core files include (examples by version):

  • IO.SYS (depending on the version)
  • MSDOS.SYS (system)
  • Other variable core components

Order File (CONFIG.SYS)

Configuration directives and settings found in CONFIG.SYS:

  • BUFFERS
  • FCBS
  • FILES
  • LASTDRIVE
  • STACKS

Device Drivers

Device drivers loaded via

...

Continue reading "MS-DOS Memory Management: Conventional, Upper, Expanded" »

Computer Architecture Fundamentals: CPU, Memory, Buses, and Addressing

Computer science3.52 KB

Core Computer Architecture Components

CPU Registers Explained

CPU registers are small, high-speed storage locations within the central processing unit (CPU) that hold data and instructions for immediate processing.

Accumulator Register

The Accumulator Register stores the results of executed operations. It connects to input registers for feedback in chained operations and also connects to the data bus for sending results to main memory or the control unit.

Program Counter (PC)

The Program Counter (PC) stores the memory address of the next instruction to be executed.

Instruction Register (IR)

The Instruction Register (IR) contains the instruction currently being executed.

Understanding Computer Buses

A bus is a channel or set of parallel connections that...

Continue reading "Computer Architecture Fundamentals: CPU, Memory, Buses, and Addressing" »

Operating Systems: Types, Processes, and Architectures

Computer science2.77 KB

Batch Processing Systems

5) For + d l sistma oprativo exploit. Two types are distinguished:

  • Processes by Lots: The following processes are followed:
  1. Load the data in a device (e.g., punched cards).
  2. Receive the magnetic tape CPU and processes, leaving the results on another magnetic tape.
  3. Other devices manage the processed data, leaving it for printing or visualization.

In this way, the CPU processes data only in intervals. This system is very slow because it takes time to load and remove the data. This is the oldest system used and the first structure supposed to be of the IT department, according to these functions. The operators entered and exited the CPU managers.

  • Real-Time:

The process is very different from the processes by lots, more prone to...

Continue reading "Operating Systems: Types, Processes, and Architectures" »