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

Microcontrollers: Architecture, Instruction Sets, and Interfacing

Computer science3.86 KB

Microcontrollers, Microcomputers, and Microprocessors

Microcontroller: Processor, memory, and I/O ports integrated on a single chip.

Microcomputer: A small computer.

Microprocessor: Example: Intel x86.

Von Neumann Architecture

Components:

  • Processor (Control Unit, ALU, Registers)
  • Memory (RAM - Volatile, ROM - Non-Volatile)
  • I/O

A single bus interconnects the processor, memory, and I/O.

RISC vs. CISC

FeatureCISCRISC
Instruction SetComplex Instruction Set ComputerReduced Instruction Set Computer
InstructionsMulti-cycle, complex instructionsMostly single-cycle, reduced instructions
Instruction TypesMany, varying lengthFew, fixed length
ComplexityHardwareSoftware
Code SizeSmallLarge
ExamplesIntel (x86), Freescale 9S12MIPS, ARM, SPARC, PowerPC

RAM vs. ROM vs. CPU Register

FeatureRAMROM
ElaborationRandom
...
Continue reading "Microcontrollers: Architecture, Instruction Sets, and Interfacing" »

Mastering Adobe Fireworks Layers and Masks

Computer science2.55 KB

Mastering Layers in Adobe Fireworks

Working with Fireworks layers is like having a transparent sheet over the canvas. You can place one or more objects on each layer according to your needs, as Fireworks doesn't limit the number of layers.

While you might not need many layers for your first designs, there will come a time when you'll start to make use of them. If you have many objects, layers will help you locate and manage them efficiently.

Before starting your design, you can determine the number of layers you'll need, or you can add them as you go to include more objects.

Accessing the Layers Panel

Where can you create these layers? Fireworks creates Layer 1 automatically when creating a document. You can view it in the Layers panel on the right...

Continue reading "Mastering Adobe Fireworks Layers and Masks" »

Database Essentials: Understanding Tables, Fields, and Queries

Computer science4.22 KB

Database Components: Fields and Records

What is a Table?

Tables are the most fundamental objects in a database. They are used to store data organized into specific categories, structured in rows and columns.

What is a Field?

A field is the most basic unit of a database, representing a single piece of data. The names of fields cannot start with a space or special characters. A collection of fields for a single item is called a record.

Common Database Field Types

Different types of fields are used to store various kinds of data:

  • Text: For alphanumeric characters, names, and descriptions up to 255 characters.
  • Memo (Long Text): Used to store text longer than 255 characters with rich formatting options. It is ideal for notes, long explanations, and formatted
...
Continue reading "Database Essentials: Understanding Tables, Fields, and Queries" »

Key Concepts in File Organization and Data Access Methods

Computer science3.37 KB

Internal vs. External Files in Data Processing

External File: A data structure used to store information in secondary memory (e.g., on a hard drive or SSD).

Internal File: A variable representing a data structure in main memory used to process information within an application.

Understanding File Organization Types

File organization refers to the way data records are stored on a storage medium. The type of organization is determined when the file is created. The primary types are:

  • Sequential Organization

    In a sequential file, records are written or recorded consecutively, often in adjacent physical positions, following the same order in which they were introduced. To access the n-th record, you must first read the preceding n-1 records. This results

...
Continue reading "Key Concepts in File Organization and Data Access Methods" »

Computer Software, GPS, and Internet Infrastructure

Computer science2.76 KB

Computer Software and Operating Systems

Software, the basic program that governs the operation of a computer, is the operating system installed on the hard disk of computers. Computers have a number of complementary programs, known as utilities, which are intended to keep the computer in an optimal functional state. They are part of software applications, all those programs whose mission is to facilitate the user in performing a task.

Satellite Positioning Systems

Positioning Systems: Satellite positioning systems are a new type of application of digital technology in telecommunications. These are systems of satellites in stationary orbit over the Earth, which emit signals in a coordinated way. These signals incorporate highly accurate information...

Continue reading "Computer Software, GPS, and Internet Infrastructure" »

Implementing Dijkstra's Algorithm in Java

Computer science2.71 KB

This implementation demonstrates how to find the shortest path from a source node to all other nodes in a graph using Dijkstra's Algorithm.

Core Components

  • minDist: Identifies the node with the minimum distance not yet included in the shortest path tree.
  • print: Displays the calculated shortest distances from the source.
  • dijkstra: The primary logic that updates distances based on the adjacency matrix.
import java.util.*;

public class Main {
    static int V;

    // Find the node with the minimum distance not yet in the shortest path tree
    int minDist(int dist[], Boolean boolset[]) {
        int min = Integer.MAX_VALUE, min_value = -1;
        for (int i = 0; i < V; i++) {
            if (!boolset[i] && dist[i] <= min) {
...
Continue reading "Implementing Dijkstra's Algorithm in Java" »

Control Flow Testing Techniques and Coverage Types

Computer science3.43 KB

Control Flow Testing is a white-box testing technique that focuses on the logical flow of a program. It checks whether all the statements, branches, and paths in the code are executed at least once during the testing process. By analyzing the control flow, this method helps uncover logical errors, unreachable code, and unexpected behavior in the program.

Types of Coverage in Control Flow Testing

Statement Coverage

  • What it does: Ensures that every line of code or statement is executed at least once.
  • Why it's useful: It helps identify if any statements have been missed during testing, ensuring no part of the code is skipped.
  • Example: In a block of code with if (x > 10) { print("X is large"); }, statement coverage would check that both the if condition
...
Continue reading "Control Flow Testing Techniques and Coverage Types" »

Array and String Algorithms: Core Problem Solutions

Computer science6.48 KB


Longest Substring Without Repeating Characters

This problem involves finding the length of the longest substring in a given string that does not contain any repeating characters. A common approach uses a sliding window technique with a Set to efficiently track unique characters.

Strategy:

  • Utilize a Set to store characters within the current window.
  • Iterate through the string with a right pointer, adding characters to the Set.
  • If a duplicate character is encountered, move the left pointer forward, removing characters from the Set, until the duplicate is no longer present.
  • At each step, update the maximum length found.

Java Implementation Snippet

class Solution {
    public int findLongestSubstringWithoutRepeatingCharacter(String str) {
        Set&
...
Continue reading "Array and String Algorithms: Core Problem Solutions" »

Understanding Data Storage and Binary Number Representation

Computer science221.76 KB

Data Storage Conversion:

  • 1 gigabyte (GB) equals 1,024 megabytes (MB).
  • 1 megabyte (MB) equals 1,024 kilobytes (KB).
  • To convert gigabytes to kilobytes, multiply by 1,024 twice. For example: 1 GB = 1,024 MB * 1,024 KB = 1,048,576 KB.
  • To convert gigabytes to megabytes, multiply by 1,024. For example: 1 GB = 1,024 MB
  • To convert 20 megabytes to bytes: 20 MB = 20 * 1,024 KB * 1,024 bytes = 20,971,520 bytes
  • To convert 2 gigabytes to kilobytes: 2 GB = 2 * 1,024 MB * 1,024 KB = 2,097,152 KB

Example: SHKRONJA A has a value of 1010, B - 1011, C - 1100, D - 1101, E - 1110, F - 1111.

Binary Number Representations

There are three main ways to represent signed numbers in binary:

1. Signed Magnitude

  • Positive Numbers: Standard binary representation.
  • Negative Numbers: The
...
Continue reading "Understanding Data Storage and Binary Number Representation" »

Introduction to PL/SQL: Features, Differences, and Advantages

Computer science3.98 KB

PL/SQL

PL/SQL is a procedural language designed specifically to embrace SQL statements within its syntax. PL/SQL program units are compiled by the Oracle Database server and stored inside the database. And at run-time, both PL/SQL and SQL run within the same server process, bringing optimal efficiency. PL/SQL includes procedural language elements like conditions and loops. It allows declaration of constants and variables, procedures and functions, types and variable of those types and triggers. It can support Array and handle exceptions (runtime errors).

Differences between SQL and PL/SQL

  • SQL is a single query that is used to perform DML and DDL operations.
  • PL/SQL is a block of codes that used to write the entire program blocks/ procedure/ function,
...
Continue reading "Introduction to PL/SQL: Features, Differences, and Advantages" »