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

Sort by
Subject
Level

Operating Systems Memory Management and Bash Scripting

Classified in Computers

Written on in English with a size of 4.74 KB

Memory Allocation Strategies

🔹 First Fit

👉 Take the first block that fits.

Example:

Blocks: 120, 450, 300, 700, 200
Processes: 250, 100, 500, 180

Step by step:

  • 250 → goes into 450 → left: 200
  • 100 → goes into 120 → left: 20
  • 500 → goes into 700 → left: 200
  • 180 → goes into 300 → left: 120

Final memory:
20, 200, 120, 200, 200


🔹 Best Fit

👉 Use the smallest block that fits.

Same example:

  • 250 → 300 → left 50
  • 100 → 120 → left 20
  • 500 → 700 → left 200
  • 180 → 200 → left 20

Final:
20, 450, 50, 200, 20

👉 Note: Causes more fragmentation (many small pieces).


🔹 Worst Fit

👉 Use the largest block.

Same example:

  • 250 → 700 → left 450
  • 100 → 450 → left 350
  • 500 → ❌ no block large enough
  • 180 → 350 → left 170

🔹 Next Fit

👉... Continue reading "Operating Systems Memory Management and Bash Scripting" »

Hehhrhrhr

Posted by Anonymous and classified in Computers

Written on in English with a size of 9.2 KB

Sequential circuits are fundamental components of digital systems, defined by the fact that their output depends not only on the current inputs but also on the past history of inputs (i.E., their current state).
The most basic element of a sequential circuit is the Flip-Flop, which is a 1-bit memory cell.
Here is a detailed explanation of the basic Flip-Flops and their operation:
1. Latches vs. Flip-Flops
Both latches and flip-flops are 1-bit storage elements, but they differ in how they are controlled:
| Feature | Latch | Flip-Flop |
|---|---|---|
| Triggering | Level-triggered (Transparent) | Edge-triggered (Synchronous) |
| Control | Changes state as long as the Enable or Clock is HIGH (or LOW). | Changes state only at the rising edge or falling... Continue reading "Hehhrhrhr" »

Implementing POSIX Barriers and MPI Custom Data Types

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.96 KB

Custom POSIX Barrier Implementation

This structure defines a custom barrier for thread synchronization:

typedef struct {
    int total;          // Expected threads
    int count;          // Arrived threads
    int phase;          // Current phase (for reuse)
    pthread_mutex_t mutex;
    pthread_cond_t  cond;
} barrier_t;

Barrier Initialization and Destruction

  • Init: Sets the total thread count and initializes synchronization primitives.
  • Destroy: Cleans up mutex and condition variables.

Barrier Wait Logic

The barrier_wait function ensures all threads reach the synchronization point before proceeding, utilizing a phase-based approach to allow barrier reuse.

MPI Vector Types for Chessboard Patterns

Using MPI_Type_vector to handle non-contiguous memory... Continue reading "Implementing POSIX Barriers and MPI Custom Data Types" »

Managing Uncertainty in AI and Cognitive Computing

Posted by Anonymous and classified in Computers

Written on in English with a size of 273.79 KB

Understanding Uncertainty in Artificial Intelligence

Uncertainty arises when we are not 100% sure about the outcome of decisions. It appears in cases where conditions are neither completely true nor completely false.

Sources of Uncertainty in AI

  • Uncertain Data: Occurs when data is missing, noisy, inconsistent, ambiguous, or based on expert guesses.
  • Uncertain Knowledge: Occurs when knowledge has multiple causes/effects or causality is incomplete.

Reasons for Uncertainty

  • Partially observable environments: For example, hidden cards in a game.
  • Dynamic environments: Such as rapidly changing technology.
  • Incomplete agent knowledge: For example, unpredictable consequences.
  • Inaccessible environments: Such as unseen global events.

Ways to Handle Uncertainty

Uncertainty... Continue reading "Managing Uncertainty in AI and Cognitive Computing" »

Implementing Logic Functions with Decoders and MUXs

Classified in Computers

Written on in English with a size of 3.54 KB

Implementing Boolean Functions with Truth Tables

Problem 1: Implement the following function F(A, B, C) = Σ(2, 5, 6, 7) using a truth table with:

  • a. Decoder
  • b. Multiplexer

Truth Table for Function F(A, B, C)

ABCF
0000
0010
0101
0110
1000
1011
1101
1111

a. Decoder Implementation

A decoder is used to select one of the outputs based on the input combination. In this case, we have 3 inputs (A, B, C) and 8 possible combinations. The truth table shows that F = 1 for input combinations (010), (101), (110), and (111), and F = 0 for all other combinations. To implement this, we connect the corresponding decoder outputs to an OR gate.

b. Multiplexer Implementation

A multiplexer (MUX) selects one of the input lines and passes it to the output. The selection is controlled... Continue reading "Implementing Logic Functions with Decoders and MUXs" »

Software Categories and Windows Operating System Essentials

Classified in Computers

Written on in English with a size of 3.28 KB

1. Various Types of Software with Suitable Examples

Software is a collection of programs, data, or instructions used by computers to perform specific tasks. Software can be classified into different types:

1.1 System Software

System software is designed to manage and operate computer hardware, providing a platform for running application software.

  • Example: Operating systems like Windows, macOS, and Linux.

1.2 Application Software

Application software is designed to help users perform specific tasks, such as word processing, spreadsheet management, and graphic design.

  • Microsoft Word (for word processing)
  • Microsoft Excel (for spreadsheets)
  • Adobe Photoshop (for graphic editing)

1.3 Utility Software

Utility software helps maintain and optimize the performance

... Continue reading "Software Categories and Windows Operating System Essentials" »

Java AWT: Button Events and Arrow Key Shape Movement

Classified in Computers

Written on in English with a size of 3.75 KB

Button Click Action Events

import java.awt.*;

import java.awt.event.*;

public class ButtonClickActionEvents

{

public static void main(String args[])

{

Frame f=new Frame("Button Event");

Label l=new Label("DETAILS OF PARENTS");

l.setFont(new Font("Calibri",Font.BOLD, 16));

Label nl=new Label();

Label dl=new Label();

Label al=new Label();

l.setBounds(20,20,500,50);

nl.setBounds(20,110,500,30);

dl.setBounds(20,150,500,30);

al.setBounds(20,190,500,30);

Button mb=new Button("Mother");

mb.setBounds(20,70,50,30);

mb.addActionListener(new ActionListener()

{

public void actionPerformed(ActionEvent e)

{

nl.setText("NAME: " + "Aishwarya");

dl.setText("DESIGNATION: " + "Professor");

al.setText("AGE: " + "42");

}

});

Button fb=new Button("Father");

fb.setBounds(80,70,50,30);

fb.addActionListener(

... Continue reading "Java AWT: Button Events and Arrow Key Shape Movement" »

Core OS Concepts: Deadlocks, Memory, and Disk Storage

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.61 KB

1. Four Necessary Conditions for Deadlock

Definition: Deadlock is a situation in which two or more processes wait indefinitely for resources held by each other.

The four necessary conditions for deadlock are:

  1. Mutual Exclusion: A resource can be used by only one process at a time.
    Example: Only one process can use a printer at a time.
  2. Hold and Wait: A process holds one resource and waits for another resource.
    Example: A process holds a printer and waits for a scanner.
  3. No Preemption: A resource cannot be forcibly taken away from a process. It must be released voluntarily.
    Example: The OS cannot forcibly take a resource from a process in this condition.
  4. Circular Wait: A circular chain of processes exists in which each process waits for a resource held
... Continue reading "Core OS Concepts: Deadlocks, Memory, and Disk Storage" »

Essential Database Management System Concepts Explained

Classified in Computers

Written on in English with a size of 3.28 KB

Core Goals of a DBMS

A robust database management system (DBMS) provides software tools for the efficient storage, retrieval, manipulation, security, and administration of data. Key objectives include:

  • Ensuring data integrity and security
  • Supporting concurrent access
  • Providing data abstraction
  • Optimizing query processing

Entity Relationships and Cardinality

Strong vs. Weak Entities

An entity denotes a distinct object, while an entity type defines its category and an entity set aggregates objects belonging to that category. A strong entity has its own primary key, whereas a weak entity lacks its own and depends on a foreign key from a strong entity (e.g., order items for an order).

Cardinality

Cardinality represents the uniqueness and number of elements... Continue reading "Essential Database Management System Concepts Explained" »

TD MyAdvantage: Trip Management and Activation Steps

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.61 KB

Trip Details

  • On the Trip Details screen, you can view the specifics of your trip.
  • After reviewing the star rating, click View map and 3 events to see specific trip events.
  • The yellow icon on the map indicates a medium-severity event that impacted your trip score.
  • Click on an event to see more details.

Declining a Trip

  • Select Trips to Review.
  • Select Review for the trip you wish to address.
  • If you were not the driver for this trip, select No.
  • You have successfully declined the trip.

Accepting a Trip

  • From the TD MyAdvantage Dashboard, click Trips to Review.
  • Select Review for the trip you would like to process.
  • If you were the driver for this trip, select Yes.
  • You have successfully accepted the trip.

Activating on an iOS Device

  • To begin, select Activate from the
... Continue reading "TD MyAdvantage: Trip Management and Activation Steps" »