Introduction to Computer Architecture

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What does computer architecture primarily refer to?

  • The physical construction of computers only
  • The design of a computer system, including components and their organization (correct)
  • Networking protocols
  • Software development methodologies

What unit is a CPU's speed typically measured in?

  • Revolutions per minute (RPM)
  • Gigahertz (GHz) (correct)
  • Megabytes (MB)
  • Pixels

What is the main function of the ALU?

  • To store data
  • To display images on the screen
  • To perform arithmetic and logical operations (correct)
  • To control the operations of the computer

What is the role of the control unit in a CPU?

<p>Directing and coordinating operations (B)</p> Signup and view all the answers

Which of these is an example of an input device?

<p>Keyboard (C)</p> Signup and view all the answers

Which of the following is an example of an output device?

<p>Monitor (B)</p> Signup and view all the answers

What type of memory is RAM?

<p>Volatile (C)</p> Signup and view all the answers

Which type of memory is non-volatile?

<p>ROM (D)</p> Signup and view all the answers

What does the term 'bit' stand for?

<p>Binary digit (D)</p> Signup and view all the answers

What is a byte?

<p>A group of 8 bits (D)</p> Signup and view all the answers

What is the purpose of adapter cards?

<p>To connect the computer to peripherals (C)</p> Signup and view all the answers

What is the primary function of a video card?

<p>To generate output images for a display device (A)</p> Signup and view all the answers

What type of port is commonly used for connecting to networks?

<p>Ethernet (C)</p> Signup and view all the answers

Why is the von Neumann architecture important?

<p>It is a template for all modern computers. (D)</p> Signup and view all the answers

What is the role of registers in a CPU?

<p>Temporary storage of data and instructions (C)</p> Signup and view all the answers

What is an algorithm?

<p>A set of instructions for performing a task (B)</p> Signup and view all the answers

What is pseudocode?

<p>An informal way to describe an algorithm (D)</p> Signup and view all the answers

What is the purpose of a searching algorithm?

<p>To find a specific item in a collection (C)</p> Signup and view all the answers

What is a linear search?

<p>A search that checks each element sequentially (C)</p> Signup and view all the answers

What does a sorting algorithm do?

<p>Arranges elements in a specific order (C)</p> Signup and view all the answers

What is the name of the sorting algorithm, where successive elements are compared and swapped?

<p>Bubble sort (D)</p> Signup and view all the answers

What two values does binary representation use?

<p>0 and 1 (A)</p> Signup and view all the answers

How many bits are in a byte?

<p>8 (B)</p> Signup and view all the answers

Which logic gate produces a true output only when all inputs are true?

<p>AND gate (A)</p> Signup and view all the answers

What does a NOT gate do?

<p>Inverts the input (C)</p> Signup and view all the answers

What is the output of an OR gate when both inputs are false?

<p>False (B)</p> Signup and view all the answers

What output does a NAND gate produce if both inputs are high?

<p>Low voltage (0) (D)</p> Signup and view all the answers

What is the output of an XOR gate when the inputs are different?

<p>True (C)</p> Signup and view all the answers

What is a transistor?

<p>A semiconductor device used as a switch (D)</p> Signup and view all the answers

Which of the following data types stores whole numbers?

<p>int (B)</p> Signup and view all the answers

What is a 'string' in the context of data types?

<p>A collection of characters (C)</p> Signup and view all the answers

What base is the decimal number system?

<p>10 (C)</p> Signup and view all the answers

Which number system uses base 2?

<p>Binary (A)</p> Signup and view all the answers

What is ASCII used for?

<p>Representing text (D)</p> Signup and view all the answers

What is a file extension?

<p>The last few letters of a file name after the dot (A)</p> Signup and view all the answers

Which is an example of a plain text file type?

<p>TXT (B)</p> Signup and view all the answers

What is the purpose of file type markers?

<p>To uniquely identify the file's format (C)</p> Signup and view all the answers

What is the primary goal of file compression?

<p>To reduce file size (D)</p> Signup and view all the answers

What does lossless compression mean?

<p>The original file can be recovered with no data loss (A)</p> Signup and view all the answers

Which type of file compression reduces file size by removing data?

<p>Lossy compression (B)</p> Signup and view all the answers

What is the role of the program counter within the control unit?

<p>To hold the address of the next instruction to be executed (B)</p> Signup and view all the answers

According to the von Neumann architecture, where are both data and instructions stored?

<p>Memory (C)</p> Signup and view all the answers

What is the primary function of the motherboard?

<p>To connect and allow communication between various hardware components (B)</p> Signup and view all the answers

Which of the following is a characteristic of RAM?

<p>Volatile (B)</p> Signup and view all the answers

What is the purpose of a port on a computer?

<p>To provide a connection point for external devices or networks (A)</p> Signup and view all the answers

Identify the gate and match A, B, and Y in brackets to check.

<p>AND (A = 1, B = 1, Y = 1) (A)</p> Signup and view all the answers

The truth table for system of four NAND gates as shown in figure is

<br> **A** &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; **B** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **Y**<br> 0 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br> 0 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br> 1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br> 1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br> (A) Signup and view all the answers

To get an output 1 from the circuit shown in the figure, the input must be

<p>A=1, B=0, C=1 (C)</p> Signup and view all the answers

The truth table given in table represents:

<p>OR - Gate (B)</p> Signup and view all the answers

To get an output of 1 from the circuit shown in figure the input must be:

<p>a = 1, b = 0, c = 1 (C)</p> Signup and view all the answers

Which logic gate creates this truth table?

<p>AND (A)</p> Signup and view all the answers

Which logic gate creates this truth table?

<p>XOR (A)</p> Signup and view all the answers

Which logic gate creates this truth table?

<p>NAND (A)</p> Signup and view all the answers

Which logic gate has the following notation:
                      $\overline{A + B}$

<p>NOR (A)</p> Signup and view all the answers

Which logic gate has the following notation:
                      $\overline{A . B}$

<p>NAND (B)</p> Signup and view all the answers

Symbol C represents Logic Gate:

<p>NOT (C)</p> Signup and view all the answers

Flashcards

Computer architecture

The design of a computer system, including components and their organization. Encompasses hardware and software aspects.

Von Neumann architecture

Proposed by John von Neumann, it's a design architecture for an electronic digital computer with subdivisions of a processing unit.

Central Processing Unit (CPU)

Most of the decision-making, arithmetic, and data manipulation occurs here, performing billions of instructions per second.

Control unit

Directs and coordinates most of the operations in the computer.

Signup and view all the flashcards

Arithmetic Logic Unit (ALU)

Performs arithmetic, comparison, and other operations.

Signup and view all the flashcards

Registers

Temporary storage locations within the CPU

Signup and view all the flashcards

Machine cycle

The steps a computer’s processor executes whenever it receives a machine language instruction.

Signup and view all the flashcards

Memory addresses

Numerical identifiers specifying locations within a computer's memory.

Signup and view all the flashcards

Logical Addresses

Generated by the CPU to access physical memory; virtual address.

Signup and view all the flashcards

Physical Address

Identifies the physical location of required data in memory.

Signup and view all the flashcards

Adapter card

An internal expansion card that allows the computer to communicate with another peripheral.

Signup and view all the flashcards

Video Card

Generates output images for a display.

Signup and view all the flashcards

Sound Card

Provides input and output of audio signals.

Signup and view all the flashcards

Port

Physical or virtual interface enabling communication with peripherals or networks.

Signup and view all the flashcards

Monitor or Screen

Provide visual output to the user.

Signup and view all the flashcards

Mouse

A handheld hardware input device that controls a cursor in a GUI.

Signup and view all the flashcards

Keyboard

Input device that allows a person to enter letters, numbers and symbols into a computer

Signup and view all the flashcards

Algorithm

A finite set of precise instructions for performing a computation or solving a problem.

Signup and view all the flashcards

Pseudocode

High-level, informal programming language that combines elements of natural language and typical programming syntax.

Signup and view all the flashcards

Linear search

Sequentially checks each element in a data collection until it finds the target value or reaches the end of the collection.

Signup and view all the flashcards

Sorting algorithm

Algorithm to arrange elements in a specific order within a list or array.

Signup and view all the flashcards

Bubble sort

Simplest sorting algorithm; it takes successive elements and ‘bubbles’ them up the list.

Signup and view all the flashcards

Data representation

The process of encoding, storing and manipulating information within a computer system.

Signup and view all the flashcards

Bit

A computer’s smallest unit of data; a single binary value, either 0 or 1.

Signup and view all the flashcards

Byte

A group of 8 bits, serving as the fundamental storage unit.

Signup and view all the flashcards

Logic gates

Fundamental components of digital circuits; perform basic logical operations on binary inputs.

Signup and view all the flashcards

AND gate

Produces a true output only if all inputs are true.

Signup and view all the flashcards

NOT gate

Inverts the input, producing the opposite output.

Signup and view all the flashcards

OR gate

Output is true, if one or more inputs are true.

Signup and view all the flashcards

NAND gate

Outputs low (0) only if both inputs are high (1).

Signup and view all the flashcards

XOR gate

Produces a true output when the number of true inputs is odd.

Signup and view all the flashcards

Truth table

Shows outputs of a logical expression for all possible input combinations.

Signup and view all the flashcards

Adder

A fundamental digital circuit used to perform addition of binary numbers.

Signup and view all the flashcards

Half adder

Adds two single binary digits (bits) and produces a sum bit and a carry bit.

Signup and view all the flashcards

Full adder

A more complex circuit. It adds three binary digits – two from the inputs and one carry from the previous stage.

Signup and view all the flashcards

Integers (int)

Whole numbers.

Signup and view all the flashcards

Character (char)

Individual characters (e.g. ‘A’, ‘$’).

Signup and view all the flashcards

Floating-point number (float)

Numbers with decimal places.

Signup and view all the flashcards

String

A collection of characters (e.g. “Hello”).

Signup and view all the flashcards

ASCII

Uses 1 byte per character containing English letters.

Signup and view all the flashcards

Unicode

Defines a number for each character or code point and how stored in a file is called encoding.

Signup and view all the flashcards

File extension

Indicates the file’s format using the last few letters of its name after the dot.

Signup and view all the flashcards

File type markers

Sequences of bytes at the beginning of a file that uniquely identify the file’s format or type.

Signup and view all the flashcards

File compression

Reduces the size of files by eliminating redundancy in the data.

Signup and view all the flashcards

Lossless compression

A file compressed such that it can be compressed into a smaller file and later decompressed back into the original file with no data loss.

Signup and view all the flashcards

Lossy compression

A file compressed by removing data in a way that cannot be reversed.

Signup and view all the flashcards

Study Notes

  • Computer architecture includes the design of a computer system, its components, and their organization, covering both hardware and software.
  • Computer architecture influences computing systems' capabilities and limitations, affecting execution speed and application effectiveness.

History of Computing

  • Information technology (IT) involves using computers to store, retrieve, transmit, and manipulate data or information.
  • A computer is an electronic device controlled by instructions in its memory, accepting data (input), processing it, producing information (output), and storing it for future use.

Computer Hardware vs. Software

  • Computer hardware includes electronic devices, input/output, memory/storage, and networking/communication devices.
  • Computer software includes system software, operating systems, device drivers, and application software.

Von Neumann Architecture

  • The von Neumann architecture, proposed in 1945, is the template for modern computers.
  • The architecture includes a processing unit (ALU and registers), a control unit, memory for data and instructions, external mass storage, and input/output mechanisms.

Computer Hardware Components

Motherboard

  • A motherboard is a computer's primary printed circuit board (PCB) that connects hardware components like the CPU, memory, and storage devices.
  • It provides electrical connections and pathways for data transfer between components and includes interfaces for external connections.

Central Processing Unit (CPU)

  • A central processing unit (CPU) performs decision-making, arithmetic, and data manipulation by executing billions of instructions per second.
  • The CPU's operation is controlled by a program listing what to do.
  • CPU speed is measured in gigahertz (GHz), indicating clock frequency or rate.
  • A processor has three main components: a control unit, an arithmetic logic unit (ALU), and registers.
  • The control unit directs operations, the ALU performs calculations, and registers provide temporary storage.
  • A machine cycle has four basic steps: fetching data and instructions, decoding instructions and sending them to the ALU, performing calculations in the ALU, and storing results.

Memory

  • Memory encompasses various types of storage for temporarily or permanently holding data and instructions for processing.
  • Key types include RAM, ROM, cache memory, HDDs, and SSDs.
  • Memory impacts system performance and multitasking.
  • Memory can be either volatile, needing power to retain memory, such as RAM, or non-volatile, holding contents without power, such as ROM and flash memory.
  • RAM is fast, non-persistent and is used for processing, whereas ROM is persistent and is used to start up the computer.
  • Static RAM (SRAM) is expensive with low power, and Dynamic RAM (DRAM) is cheaper with higher power.
  • Flash memory acts like both RAM and ROM, allowing information writing and retaining data when powered off.

Memory Addresses

  • Memory addresses are numerical identifiers that specify locations within the computer's memory.
  • Each byte of memory has a unique address, allowing the CPU to access and manipulate stored data efficiently.

Logical Addresses

  • Logical addresses are generated by the CPU during program execution and serve as references to access physical memory.
  • Logical addresses are virtual and mapped to physical addresses using a memory management unit and a page table.

Physical Addresses

  • Physical addresses represent the physical location of data in memory accessible by the CPU through logical addresses.
  • The term physical address space refers to all physical addresses corresponding to logical addresses.

Peripherals

Internal Adaptation

  • Internal adaptation involves using adapter cards and ports to connect and interact with different components and peripherals.
  • Adapter cards extend functionality beyond built-in capabilities, while ports facilitate connections to external devices.

Adapter Cards

  • An adapter card is an internal expansion card that enables communication with peripherals, such as video and sound cards.
  • A video card generates output images for a display device and a sound card provides input and output of audio signals.

Ports

  • A port is a physical or virtual interface enabling communication with external peripherals or networks through specific connections, protocols, and data transfer rates.

Speed Comparisons

  • CPU registers have a latency of 1–3 nanoseconds and a capacity of less than 1 KB.
  • CPU caches have a latency of 2–12 nanoseconds and a capacity of 1–8 MB.
  • Main memory (RAM) has a latency of 10–60 nanoseconds and a capacity of 1 GB to 128 GB.
  • SSD using PCIe has a latency of ~25,000 nanoseconds and a capacity of 64 GB to 2 TB.
  • SSD using SATA has a latency of ~50,000 nanoseconds and a capacity of 64 GB to 2 TB.
  • Hard drive using SATA has a latency of ~1,000,000 to 10,000,000 nanoseconds and a capacity of 128 GB to 10 TB.

External Peripherals

  • External peripherals enhance functionality include input devices, output devices, storage devices, and networking devices.
  • Common examples of external peripherals are monitors, mice, and keyboards.

Topic 2: Computer Algorithms

  • Computer algorithms process input data through mathematical operations or logical operations, accessing memory, controlling hardware, and producing output results.
  • An algorithm is a finite set of precise instructions for performing a computation or solving a problem.
  • A program is a type of algorithm, but not all algorithms are programs.
  • Algorithms typically have input, output, definiteness, correctness, finiteness, effectiveness, and generality.
  • Pseudocode is a high-level, informal programming language used to express algorithms clearly without specific syntax constraints.

Searching Algorithms

  • A searching algorithm finds a specific item within a data collection, and examples include linear search, binary search, hashing, DFS, BFS, and interpolation search.
  • A linear search algorithm checks each element sequentially until it finds the target value.
  • If target value matches an element in the collection, its index (or position) is returned.

Sorting Algorithms

  • A sorting algorithm arranges elements in a specific order within a list or array.

Bubble Sort

  • Bubble sort algorithm takes successive elements and 'bubbles' them up the list.
  • It is among the simplest sorting algorithms.

Topic 3: Binary Representation

  • Data representation on computers involves encoding, storing, and manipulating information.
  • Binary representation uses bits (0 and 1) grouped into bytes (8 bits).
  • Computers use binary, decimal, octal, and hexadecimal systems for numbers.
  • Character encoding schemes like ASCII and Unicode map characters to numeric codes.
  • Computers handle non-textual data such as images, audio, and video using formats like JPEG or MP3.
  • Data structures like arrays and linked lists organize data in memory.

Logic Gates

  • Logic gates are fundamental components of digital circuits that perform basic logical operations on binary inputs to produce binary outputs.
  • Types of logic gates include AND, OR, NOT, NAND, NOR, and XOR gates.
  • Complex logical functions can be implemented by connecting logic gates.

Transistors

  • Transistors are semiconductor devices that control current flow based on applied voltage, arranged to create basic operations in logic gates.
  • PMOS transistors switch on with low voltage, and NMOS transistors switch on with high voltage.

Truth Tables

  • A truth table is a tabular representation showing the outputs of a logical expression or a combination of inputs.
  • Truth tables define the behavior of logic gates, expressions, and Boolean functions, providing clarity and systematic analysis.

Logic Gates

AND Gate

  • An AND gate produces a true output (1) only when all inputs are true.

NOT Gate

  • A NOT gate inverts the input signal; a logic high (1) becomes a logic low (0), and vice versa.

OR Gate

  • An OR gate produces a true output (1) when at least one input is true; otherwise, the output is false (0).

NAND Gates

  • NAND gate outputs a low voltage (0) if — and only if — both inputs are high voltage (1).

XOR Gate

  • An XOR gate produces a true output (1) if the number of true inputs is odd - the output is true (1) if the inputs are different (one true, one false).

Adders

  • An adder is a digital circuit used to perform addition of binary numbers.

Half Adder

  • A half adder adds two single binary digits, producing a sum bit and a carry bit.

Full Adder

  • A full adder adds three binary digits, producing a sum bit and a carry bit.

Representing Data

Data Types

  • Common data types include integers (int), characters (char), strings, floating-point numbers (float), and double-precision floating-point numbers (double).

Number Representation

  • Computers use the binary system (base 2) to represent data with 0s and 1s.
  • The hexadecimal number system (base 16) simplifies binary representation.

Text Representation

  • Text is represented in binary using standards like ASCII and Unicode.
  • ASCII uses 1 byte per character, while Unicode uses UTF-16 (2 bytes) or UTF-8 (variable bytes).

Image Representation

  • Images are displayed using pixels with three colors: red, green, and blue (sub-pixels).
  • Typically, 3 bytes per pixel are assigned, written in hex.

Topic 4: Data Storage

  • Data is stored in various file types, each identified by a file extension.
  • File type markers (magic numbers) are sequences of bytes at the beginning of a file that uniquely identify its format.
  • File compression reduces file size using algorithms and techniques.

File Compression

  • Lossless compression compresses files into smaller sizes without data loss, allowing them to be decompressed back to the original.
  • Lossy compression removes data in a way that cannot be reversed, such as in JPEG images and MP3 audio.
  • File compressibility depends on the algorithm, data patterns, and whether the file is already compressed.

Topic 1: Databases

  • A database is a structured data collection allowing access, retrieval, modification, and usage.
  • A database management system (DBMS) is software for creating and managing databases, acting as an interface between users and the database.
  • DBMS functionalities: data storage, transaction support, recovery, authorization, remote access, and constraint enforcement.
  • Main database types: relational (RDB), object-oriented (OODB), network, and non-relational (NoSQL).

Relational Databases

  • Relational databases organize data into tables with rows and columns, allowing efficient querying and manipulation using SQL.

Entity–Relationship Diagrams (ERDs)

  • An entity-relationship diagram (ERD) models the problem with symbols visualizing entities and their interrelationships.
  • Entities are drawn as rectangles, relations as diamonds, and attributes as ovals.
  • Relations can be one-to-many (1:M), many-to-many, or one-to-one.
  • It's useful to add a quantity attribute in the relationship between order and product; to reduce redundancies.

Adding Attributes

  • Attributes are information about the entity, drawn as ovals.
  • Unique attributes become primary keys, which are unique data identifiers.
  • Surrogate key is a number used as a primary key.

Adding Attributes to Relationships

  • Determine the attributes by asking what information you need about the customer, order, product, and brand.

Topic 2: Convert an ERD to Tables

  • Convert the ERD to tables to create the database.
  • Entities become tables with their attributes as columns.

Foreign Keys

  • A foreign key is an attribute in a database table that links to another table, representing a relationship between them through shared data
  • One-to-many relations have a foreign key in the "many" entity, referencing the primary key of the "one" entity.
  • Many-to-many relations require a junction table with primary keys of both related tables, acting as both foreign and primary keys.
  • Primary key with multiple columns is called a composite primary key.
  • One-to-one relations are possible and can be used for access control (confidential data) and table inheritance.

Topic 3: Create Tables Using SQL

  • Use Structured Query Language (SQL) to create tables within the database.

CREATE TABLE Syntax

  • The CREATE TABLE statement creates a new table by defining its structure, including column names, data types, constraints, and indexes.

INSERT INTO Syntax

  • The INSERT INTO command adds data to the created table.

Extract Data

  • We use SQL commands to extract data from the database.

SELECT Command

  • SELECT is the primary command that is used in SQL to retrieve data. Often with the WHERE keyword, to only show data if the expression is true

LIKE Operator

  • The LIKE operator checks if text matches a particular pattern.

IN Operator

  • The IN operator checks if a value is in a list of possible values.

ORDER BY

  • The ORDER BY keyword displays results in a particular order that can be either ascending, or descending.

AS (alias)

  • The AS keyword renames a column.

LIMIT and OFFSET

  • The LIMIT clause restricts the number of rows a select statement returns.
  • The OFFSET clause skips the offset rows before returning data from the rows.

Aggregate Data

  • Aggregate functions work over multiple rows and combine them, including count(), sum(), avg(), min(), and max().

HAVING Clause

  • The HAVING clause occurs after the aggregates have finished, similar to WHERE.

VIEW

  • View is a saved query that works like a regular table, except the rows are not able to be edited; it’s useful if there is a large and complex query.

View

  • A view is a saved query, with the rows not able to be edited.

Topic 4: Extracting Data From Multiple Tables

Combining Tables

  • Tables are often needing to be combined using a JOIN to connect the tables that contain primary and foreign keys. Also referred to as an ON Clause

ON Clause

  • ON clauses connect the primary and foreign keys

USING Clause

  • USING clause replaces ON clause, which only can work if the column is in two tables

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

Use Quizgecko on...
Browser
Browser