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

Understanding Binary Adders and Race Conditions in Flip-Flops

Computer science4.17 KB

Binary Parallel Adder

A binary parallel adder is a digital circuit that adds two binary numbers in parallel, meaning all bits are added simultaneously. It typically consists of full adders arranged in parallel, with each full adder adding corresponding bits from the two input numbers.

BCD Adder

A BCD (Binary Coded Decimal) adder is a specific type of binary parallel adder designed to add two BCD numbers. BCD numbers are decimal digits encoded in binary, where each decimal digit is represented by its 4-bit binary equivalent.

Truth Table for a 4-bit BCD Adder

Here's the truth table for a 4-bit BCD adder:


Diagram


In the truth table:

  • A3 A2 A1 A0 represents the first BCD number (A).
  • B3 B2 B1 B0 represents the second BCD number (B).
  • Cin represents the carry-
...
Continue reading "Understanding Binary Adders and Race Conditions in Flip-Flops" »

Software Engineering Core Concepts: SDLC, Architecture, VCS

Computer science5.66 KB

Software Engineering Fundamentals and Principles

Desired Software Attributes

  • Maintainability
  • Dependability
  • Efficiency
  • Usability

Major Challenges in Large Programming

  • Complexity
  • Change

The 5 C's (Collaboration Framework)

Key elements often cited in successful team environments:

  • Collaboration
  • Communication
  • Coordination
  • [Note: The original source implies additional C's beyond the listed three.]

Core Activities of Software Engineering (SE)

  • Defining
  • Managing
  • Describing
  • Designing
  • Implementing
  • Testing
  • Deploying
  • Maintaining

The 4 P's of Software Engineering

  • People
  • Process
  • Project
  • Product

Software Development Lifecycle Phases (SDLC)

  1. Requirements Planning
  2. High-Level Design (Architecture Design)
  3. Low-Level Design
  4. Development (Implementation)
    • Note: Unit testing is typically performed during
...
Continue reading "Software Engineering Core Concepts: SDLC, Architecture, VCS" »

Understanding Computer Viruses and Network Topologies

Computer science5.9 KB

A computer virus is a type of computer program that, when executed, replicates itself by modifying other computer programs and inserting its own code.[1] When this replication succeeds, the affected areas are then said to be 'infected' with a computer virus.[2][3]

Virus writers use social engineering deceptions and exploit detailed knowledge of security vulnerabilities to initially infect systems and to spread the virus. The vast majority of viruses target systems running Microsoft Windows,[4][5][6] employing a variety of mechanisms to infect new hosts,[7] and often using complex anti-detection/stealth strategies to evade antivirus software.[8][9][10][11] Motives for creating viruses can include seeking profit (e.g., with ransomware), desire...

Continue reading "Understanding Computer Viruses and Network Topologies" »

Understanding Maps and Double Linked Lists in Java

Computer science8.4 KB

Map & Diccionarios

Import Statements

import java.security.InvalidParameterException;
import java.util.*;

RedCarreteras Class

public class RedCarreteras { 
    private Map<String, Map<String, Integer>> red;

    //CONSTRUCTORES
    public RedCarreteras() {
        red = new HashMap<>();// Nuevo dicc a 0
    }

    //METODOS
    private void validarTramo(String una, String otra, int distancia) {
        if (una == null || otra == null || una.equals(otra) || distancia < 1)
            throw new InvalidParameterException();
    }

    public Set<String> ciudades() {
        return red.keySet();
    }

    public int nuevoTramo(String una, String otra, int distancia) {
        validarTramo(una, otra, distancia);
...
Continue reading "Understanding Maps and Double Linked Lists in Java" »

Data Project Management: A Comprehensive Guide to DR, MVP, and Data Pipelines

Computer science3.25 KB

Data Project Management: A Comprehensive Guide

Goal Setting: The Foundation of Project Planning

Every project requires a clear destination to determine its success. Goal setting is the first step in project planning, providing a roadmap for the project's journey.

Tools & Skills: Assessing Project Resources

The upper blocks of DR (Data Requirements) focus on evaluating the resources necessary for data project implementation. These resources include:

  • Hard Resources: Data, software tools, processing
  • Soft Resources: Skills, domain expertise, human resources for execution

Process & Value: Implementation and Delivery

The lower blocks of DR concentrate on project implementation and delivery. DR serves as a planning tool, helping project managers:

  • Identify
...
Continue reading "Data Project Management: A Comprehensive Guide to DR, MVP, and Data Pipelines" »

Java HashSet1 Implementation Using HashTable

Computer science3.43 KB


public Class HashSet1

    implements IHashSet1

{   private IHashTable hashTable;

    private static final Object PRESENT = new Object();

    public HashSet1() {hashTable = new HashTable1();}

    public boolean add(Object o) {

        return hashTable.Put(o, PRESENT)==null;}

    public void clear() {hashTable.Clear();}

    public boolean contains(Object o) {

        return hashTable.ContainsKey(o);

}    public boolean containsAll(IHashSet1 s) {

        Iterator e = s.iterator();

        while(e.HasNext()) {

            if(!Contains(e.Next())) {

                return false;

            }

        }

        return true;

    }

    public boolean equals(Object...

Continue reading "Java HashSet1 Implementation Using HashTable" »

C Synchronization: Semaphores for Process Control

Computer science5.09 KB

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/sem.h>
#include <sys/wait.h>
#include <sys/time.h>

define DELAY_MICROSECONDS 1000 // Renamed ESPERA for clarity

int initialize_semaphore(int value); int operate_semaphore(int semaphore, int operation); int remove_semaphore(int semaphore); int semaphore_wait(int semaphore); // Corresponds to P operation int semaphore_signal(int semaphore); // Corresponds to V operation void execute_command(int semaphore, char* command); void custom_delay();

int main() { int sem = initialize_semaphore(1); if (sem == -1) { fprintf(stderr, "Failed to initialize semaphore.\n"); return 1; }

execute_command(sem, "clear");
execute_command(sem, "date");
execute_
...
Continue reading "C Synchronization: Semaphores for Process Control" »

Reverse Engineering Fundamentals: Process, Steps, and CAD Model Generation

Computer science2.76 KB

Forward Engineering Defined

Forward engineering is the traditional process of moving from high-level abstractions and logical designs to the physical implementation of a system.

Understanding Reverse Engineering

Reverse engineering (RE) is the process of duplicating an existing part, sub-assembly, or product without original drawings, documentation, or a computer model.

It is also defined as the process of obtaining a geometric Computer-Aided Design (CAD) model from 3-D points acquired by scanning or digitizing existing parts.

Alternative Name for Reverse Engineering

The process is often referred to as the Physical-to-Digital process.

Key Purposes of Reverse Engineering (RE)

Reverse engineering serves several critical functions, including:

  • The user
...
Continue reading "Reverse Engineering Fundamentals: Process, Steps, and CAD Model Generation" »

Understanding Operating Systems: Traps, Interrupts, System Calls, and Threads

Computer science3.94 KB

What is the Key Difference Between a Trap and an Interrupt?

A trap is caused by the program and is synchronous with it. If the program is run again and again, the trap will always occur at exactly the same position in the instruction stream. An interrupt is caused by an external event and its timing is not reproducible.

Why is the Process Table Needed in a Timesharing System?

The process table is needed to store the state of a process that is currently suspended, either ready or blocked. It is not needed in a single-process system because the single process is never suspended.

Is the Process Table Needed in Personal Computer Systems With Only One Process?

No, it is not needed in a single-process system because the single process is never suspended....

Continue reading "Understanding Operating Systems: Traps, Interrupts, System Calls, and Threads" »

Web Development Fundamentals

Computer science117.12 KB

Pseudo Classes

Pseudo classes are selectors that can be used to style elements based on their state or position in the document. For example, the :hover pseudo class can be used to style an element when the user hovers over it with the mouse.

:nth-of-type(an+b || even || a || an)

The :nth-of-type pseudo class is used to select elements based on their position in a group of siblings. It takes an argument that specifies which elements to select. The argument can be one of the following:

  • an+b: Selects every nth element, starting with the bth element. For example, 2n would select every other element, and 2n+1 would select every odd element.
  • even: Selects every even-numbered element.
  • odd: Selects every odd-numbered element.
  • a: Selects every element.

For...

Continue reading "Web Development Fundamentals" »