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

FIR vs. IIR Filters: Advantages, Disadvantages, & Structures

Computer science14.44 KB

FIR Filters

A Finite Impulse Response (FIR) filter is characterized by its finite-duration impulse response, settling to zero in a finite time. Unlike Infinite Impulse Response (IIR) filters, which can have internal feedback and respond indefinitely, an Nth-order discrete-time FIR filter's impulse response lasts precisely N+1 samples. FIR filters are predominantly implemented in software and can be continuous-time analog or digital and discrete-time.

Transfer Function of FIR Filter

Z

Frequency Response

Z

IIR Filters

An Infinite Impulse Response (IIR) filter is a recursive filter where the output is calculated using current and previous inputs and outputs. This feedback mechanism within the filter structure is a defining characteristic. IIR filter design...

Continue reading "FIR vs. IIR Filters: Advantages, Disadvantages, & Structures" »

Java RMI Calculator Implementation

Computer science2.75 KB

1. CalculatorInterface.java

The following code defines the Remote Interface for the calculator application.

import java.rmi.*;

public interface CalculatorInterface extends Remote {
    public int add(int num1, int num2) throws RemoteException;
    public int subtract(int num1, int num2) throws RemoteException;
    public int multiply(int num1, int num2) throws RemoteException;
    public int divide(int num1, int num2) throws RemoteException;
}

2. ServerCalculator.java

This class implements the CalculatorInterface and extends UnicastRemoteObject to handle remote calls.

import java.rmi.*;
import java.rmi.server.*;

public class ServerCalculator extends UnicastRemoteObject implements CalculatorInterface {
    public ServerCalculator() throws RemoteException
...
Continue reading "Java RMI Calculator Implementation" »

Fundamentals of Internet Architecture and Java Programming Concepts

Computer science28.51 KB

Internet Architecture and Core Protocols

The Three Layers of Internet Architecture

The internet architecture can be broadly classified into three layers:

  1. Internet Backbones and High-Speed Network Lines: This first layer consists of Internet Backbones and very high-speed network lines. The National Science Foundation (NSF) created the first high-speed backbone in 1987 called NSFNET. It was a T1 line that connected 170 smaller networks together and operated at 1.544 Mbps (million bits per second). IBM, MCI, and Merit worked with NSF to create the backbone and developed a T3 (45 Mbps) backbone the following year. Backbones are typically fiber optic trunk lines. The trunk line has multiple fiber optic cables combined together to increase capacity.
...
Continue reading "Fundamentals of Internet Architecture and Java Programming Concepts" »

Excel 2016 Practice Questions and Answers

Computer science3.22 KB

Excel Practice Questions and Answers

  1. The ________ displays the current cell mode, the page number, and the zoom buttons.

    Answer: Status bar

  2. A text value in Excel is also referred to as a ________.

    Answer: Label

  3. When you type text in a cell, it is ________.

    Answer: Left-aligned

  4. Which of the following is NOT a way to create a formula?

    Answer: By using a Function button on the status bar

  5. ________ is a procedure that determines which digit to the right of a number will be the last to be displayed.

    Answer: Rounding

  6. Which of the following is NOT part of the Accounting Number Format?

    Answer: Three decimal places

  7. Tiny charts embedded in a cell that display a visual trend summary alongside your data are called ________.

    Answer: Sparklines

  8. What are the two contextual

...

Continue reading "Excel 2016 Practice Questions and Answers" »

Comprehensive Guide to Digital Certificates, Security Protocols, and Computer Architecture

Computer science6.87 KB

Data Items in a Digital Certificate

  • Serial Number
  • Certificate Authority (CA) that issued the certificate
  • CA Digital Signature
  • Name of company/organization/individual owning the certificate
  • Subject Public Key
  • Validity Period of the certificate
  • Hashing Algorithm

Conditions for Message Authenticity

  • Digital Certificate
  • Inclusion of Public Key
  • Use of Public Key to hash the received message and produce a message digest
  • Comparison of the generated hash to the digital signature

Usage of Encrypted Message Digest

  • Financial Transactions
  • Legal Documents
  • Software Distribution

Process of Digital Signature

  1. Software is put through a hashing algorithm.
  2. The hash total is encrypted with a private key.
  3. The software and encrypted digest hash/digital signature are sent.
  4. The receiver
...
Continue reading "Comprehensive Guide to Digital Certificates, Security Protocols, and Computer Architecture" »

C++ Queue Data Structure Implementation

Computer science6.1 KB

This document presents a C++ implementation of a Queue data structure, demonstrating its core functionalities and operations. The Queue is implemented using a linked list, adhering to the First-In, First-Out (FIFO) principle.

Queue Class Definition

The Queue class encapsulates the data members and member functions necessary to manage a queue. Note that the Node struct/class is assumed to be defined elsewhere, typically as struct Node { double info; Node* link; };.

class Queue
{
private:
    Node* front;
    Node* rear;
    int count;
    double info; // This member 'info' within the Queue class itself seems unused in the provided code.
public:
    // Constructor: Should be 'Queue();' without 'void'. Implementation is missing.
    Queue();
...
Continue reading "C++ Queue Data Structure Implementation" »

VHDL Code for SR, JK, and T Flip-Flops

Computer science8.25 KB

SR Flip-Flop Logic Diagram SR Flip-Flop Truth Table

VHDL Code for SR Flip-Flop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity SR_FF is
PORT( S, R, CLOCK: in std_logic;
      Q, QBAR: out std_logic);
end SR_FF;

Architecture behavioral of SR_FF is
begin
  PROCESS(CLOCK)
  variable tmp: std_logic;
  begin
    if(CLOCK='1' and CLOCK'EVENT) then
      if(S='0' and R='0')then
        tmp:=tmp;
      elsif(S='1' and R='1')then
        tmp:='Z';
      elsif(S='0' and R='1')then
        tmp:='0';
      else
        tmp:='1';
      end if;
    end if;
    Q <= tmp;
    QBAR <= not tmp;
  end PROCESS;
end behavioral;

JK Flip-Flop Logic Diagram JK Flip-Flop Truth Table

VHDL Code for JK Flip-Flop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library
...
Continue reading "VHDL Code for SR, JK, and T Flip-Flops" »

Operating System Core Functions and Digital Signature Essentials

Computer science3.12 KB

Operating System Core Functions

A program in execution requires resources for its tasks. The Operating System (OS) is responsible for managing these resources through various core functions.

Process Management

The OS is responsible for:

  • Creating and destroying processes.
  • Pausing and resuming processes.
  • Providing mechanisms to communicate and synchronize processes.

Memory Management

Memory is a table of words, each referenced using a unique address. The OS is accountable for:

  • Knowing which parts of memory are used and by whom.
  • Deciding which processes are loaded into memory when space is available.
  • Assigning and reclaiming memory space when needed.

Secondary Storage Management

Secondary storage is necessary because main memory is volatile and often too small...

Continue reading "Operating System Core Functions and Digital Signature Essentials" »

White Box Testing Techniques and Unit Testing Principles

Computer science8.98 KB

What is White Box Testing?

White Box Testing (also known as Clear Box, Glass Box, Structural, or Open Box Testing) is a software testing method where the internal structure, design, and implementation of the code are fully visible and known to the tester. Unlike Black Box testing, where you only focus on inputs and outputs, White Box testing requires you to look "under the hood." The tester inspects the actual source code, control flows, data structures, and logic paths to ensure everything operates correctly, securely, and efficiently.

The Need for White Box Testing

While Black Box testing ensures that the software satisfies the user's requirements, White Box testing is essential to guarantee internal code quality and stability. Here is why it...

Continue reading "White Box Testing Techniques and Unit Testing Principles" »

Graph Theory Fundamentals

Computer science3.51 KB

  • Graph (G): A pair (V, E) where V is a set of vertices and E is a set of edges connecting pairs of vertices.
  • Types of Graphs:
    • Simple Graph: No loops or multiple edges.
    • Multigraph: Multiple edges allowed.
    • Directed Graph (Digraph): Edges have directions.
    • Weighted Graph: Edges have weights.

Understanding Subgraphs

  • Subgraph: A graph H is a subgraph of G if V(H) ⊆ V(G) and E(H) ⊆ E(G).
  • Induced Subgraph: Formed by a subset of vertices and all edges between them in G.

Fundamental Graph Properties

  • Order: Number of vertices (|V|).
  • Size: Number of edges (|E|).
  • Degree: Number of edges incident to a vertex.

Common Graph Examples

  • Complete Graph (Kn): Every pair of vertices is connected.
  • Cycle Graph (Cn): Forms a closed loop.
  • Path Graph (Pn): A sequence of vertices connected
...
Continue reading "Graph Theory Fundamentals" »