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

Sort by
Subject
Level

8051 Microcontroller Architecture and Flip-Flop Types

Posted by Anonymous and classified in Computers

Written on in English with a size of 288.82 KB

SR Flip-Flop (Set-Reset Flip-Flop)

The SR flip-flop is one of the simplest sequential circuits and serves as a fundamental building block for more complex flip-flops. It is a 1-bit memory device with two inputs: Set (S) and Reset (R). It has two outputs, Q and its complement (Q with overline).

Logic Diagram and Working

An SR flip-flop can be constructed using two cross-coupled NAND gates (or NOR gates). Below is the working principle for the NAND-gate implementation:

  1. Set Condition (S = 0, R = 1):

    • When S = 0, the output of the top NAND gate (Q) is forced to 1 (since NAND is the inverse of AND).

    • This Q = 1 is fed into the bottom NAND gate with R = 1; the bottom gate's inputs become 1 and 1, so its output () becomes 0.

    • The circuit is now in the

... Continue reading "8051 Microcontroller Architecture and Flip-Flop Types" »

Cheat-Sheet Editor: Professional Document Formatting Tools

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.78 KB

  • File
  • Home
  • Insert
  • Options
  • Information

Editor Toolbar

Font and Paragraph Controls

Adjust your Font, Size, and Line Spacing. Use formatting options like Bold, Italic, Underline, Subscript, and Superscript. Align text or use lists (ordered and unordered) to organize your content.

Insert Elements

  • Table: Insert a table into the document.
  • Image: Include an image from a local file.
  • Link: Create a link for quick access to web pages.
  • Separator: Insert a horizontal line to divide sections.
  • Quote: Insert a blockquote.

Advanced Features

  • Search: Find documents on Wikiapuntes, xuletas.es, and wikiteka.com.
  • Compress: Reduce text size to occupy minimum space.
  • Preview: View how the cheat sheet looks when printed.
  • Install: Use the editor offline for better performance.

Print and

... Continue reading "Cheat-Sheet Editor: Professional Document Formatting Tools" »

Mastering Python Functions: Arguments, Scope, and Returns

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.65 KB

Keyword Arguments

Arguments are passed using parameter names, meaning the order does not matter.

Example

def func(name, age):
    return f"Hello {name}, you are {age} years old!"

result = func(age=18, name="John")
print(result)

Output: Hello John, you are 18 years old!


Default Arguments

Default values are assigned to parameters directly in the function definition.

Example

def func(name, greeting="Hello"):
    return f"{greeting}, {name}"

print(func("John"))
print(func("Nik", "Hi"))

Output:
Hello, John
Hi, Nik


Arbitrary Arguments

Used when the number of arguments passed to a function is unknown.

*args – Non-keyword variable length arguments

def sum_numbers(*args):
    return sum(args)

print(sum_numbers(1, 5, 10, 15))

Output: 31


**kwargs – Keyword variable

... Continue reading "Mastering Python Functions: Arguments, Scope, and Returns" »

Mastering MATLAB: Powering Technical Computing

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.61 KB

MATLAB stands for Matrix Laboratory. It is a high-performance programming language and software environment developed by a company called MathWorks. It is primarily used for technical computing, heavy mathematical calculations, data analysis, and algorithm development.

Here is a breakdown of what makes MATLAB unique and how it is used:

Core Capabilities of MATLAB

  • Matrix Math: Unlike traditional programming languages that work mainly with single numbers, MATLAB is specifically designed to operate on whole matrices and arrays at once. This makes solving complex mathematical and engineering problems much faster.
  • Data Visualization: It has powerful built-in tools for plotting data. You can easily create 2D and 3D graphs, charts, and custom visual representations
... Continue reading "Mastering MATLAB: Powering Technical Computing" »

C Language Fundamentals: Output, Control Flow, Strings, and Sorting

Classified in Computers

Written on in English with a size of 22.92 KB

C printf Function: Format Specifiers Explained

The printf function in C is used to display formatted output to the standard output (usually the console). It allows programmers to control how data is presented by using **format specifiers**. Format specifiers are placeholders that define the type of data being printed and how it should be formatted. They begin with a % symbol, followed by a character that specifies the data type.

Role of Format Specifiers

Format specifiers serve two main purposes:

  1. Data Type Identification: They inform the printf function about the type of data being passed as an argument. For example, %d is used for integers, while %f is used for floating-point numbers.
  2. Formatting Control: They allow customization of how the data
... Continue reading "C Language Fundamentals: Output, Control Flow, Strings, and Sorting" »

Core Concepts in Network Layer Protocols and Routing

Posted by Anonymous and classified in Computers

Written on in English with a size of 578.11 KB

1)A virtual-circuit network (VCN) is a hybrid network model that combines features of both circuit-switched and datagram networks. It provides a balance between connection-oriented and connectionless transmission methods :-Three Phases in a Virtual-Circuit Network In a virtual-circuit network, the communication between a source and destination involves three phases: setup, data transfer, and teardown. These phases ensure that a reliable path is established and maintained for the communication session. 1. Setup Phase: o The source and destination use their global addresses to establish a connection. During this phase, switches along the path create table entries to store information about the virtual circuit. This phase ensures that each switch... Continue reading "Core Concepts in Network Layer Protocols and Routing" »

Essential Concepts in Computer Networking and TCP/IP

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.97 MB

Network Delay and Performance Metrics

Understanding the components of network delay is essential for optimizing data transmission:

  • d-proc (Processing Delay): Checks for bit errors and determines the output link; typically less than a microsecond.
  • d-queue (Queuing Delay): Time spent waiting at the output link for transmission, heavily dependent on network congestion.
  • d-prop (Propagation Delay): Calculated as Link Length / (2 x 108).

Key Variables: a = average packet arrival rate, L = packet length, R = link bandwidth.

DNS Record Types

The Domain Name System (DNS) uses Resource Records (RR) in the format: (name, value, type, ttl).

  • Type A: Name is the hostname; value is the IP address.
  • Type CNAME: Name is an alias for a canonical name; value is the actual
... Continue reading "Essential Concepts in Computer Networking and TCP/IP" »

Mastering jQuery, Regex, and JavaScript Objects

Posted by Anonymous and classified in Computers

Written on in English with a size of 4.02 KB

jQuery: Simplify Your JavaScript

jQuery is a fast, small, and popular JavaScript library. Its motto is "Write less, do more." Before jQuery, writing plain JavaScript for interactivity required complex code that often behaved inconsistently across browsers. jQuery wraps these tasks into simple, short commands that work perfectly everywhere.

Think of it as a handy shortcut dictionary for JavaScript.

The Basic Syntax

Every jQuery command follows this pattern:

  • $: Points to jQuery, signaling its use.
  • (selector): Finds the HTML element to modify.
  • .action(): Defines the operation (e.g., hiding, styling, or animating).

1. jQuery Selectors

Selectors "grab" HTML elements using CSS-style syntax.

  • Element Selector: $("p") selects all paragraph tags.
  • ID Selector: $
... Continue reading "Mastering jQuery, Regex, and JavaScript Objects" »

Essential Linux Commands & File System Structure

Classified in Computers

Written on in English with a size of 7.16 KB

Linux File System Structure: An archive of Linux is associated with 3 parts: superblock, inode table, and data blocks.

Network Ports: To see the ports assigned to services.

Display Active TCP/IP Connections: netstat -a

User Management:

  • Create password: passwd (user)
  • Add user to group: usermod -g group_name
  • Disable: 60001
  • Enable: 60002

Practical Commands:

Add User: adduser

  1. Change folder privileges: chmod
  2. Check privileges: ls -de (see if you changed privileges)
  1. Create a user: useradd newuser
    passwd newuser
  2. Create a directory: The command mkdir is used to create directories:
    mkdir mydirectory
  3. Create a report: ps -aux >> reporte.txt
  4. Directories associated with the user: -d dirname
  5. Changing permission: chmod 744 file.txt /file.txt
  6. Change owner: chown
    Entering
... Continue reading "Essential Linux Commands & File System Structure" »

C TCP Sliding Window Client Example with Timeout

Classified in Computers

Written on in English with a size of 3.49 KB

C TCP Sliding Window Client Example

Source code with timeout and acknowledgment handling

Note: This example demonstrates socket programming in C using a sliding window and a receive timeout. It sends numbered frames, waits for acknowledgments, and resends frames on timeout.

Key points

  • Uses setsockopt to set a receive timeout (SO_RCVTIMEO)
  • Sends sequential frames and handles acknowledgments
  • Resends a window of frames when acknowledgments are not received
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <arpa/inet.h>
#define MAX 80
#define PORT 8080
#define SA struct sockaddr
... Continue reading "C TCP Sliding Window Client Example with Timeout" »