Computer Science Fundamentals Lecture Notes PDF
Document Details
Uploaded by FaithfulAntimony
Tags
Summary
These lecture notes cover computer science fundamentals including number systems (binary, octal, hexadecimal), conversions between them, and logical operations like XOR and XNOR. It also details computer networks, their topology, and logic gates. The document also includes diagrams showing timing diagrams for XOR gates and XNOR gates.
Full Transcript
# Computer Science Fundamentals ## Number Systems ### Converting Numbers * **Convert (941D3)<sub>16</sub> into binary and decimal** * (1001 0100 0001 1101)<sub>2</sub> (Binary) * = 9 x 16<sup>3</sup> + 4 x 16<sup>2</sup> + 13 x 16<sup>1</sup> + 3 x 16<sup>0</sup> = 372707 (decimal) * **Co...
# Computer Science Fundamentals ## Number Systems ### Converting Numbers * **Convert (941D3)<sub>16</sub> into binary and decimal** * (1001 0100 0001 1101)<sub>2</sub> (Binary) * = 9 x 16<sup>3</sup> + 4 x 16<sup>2</sup> + 13 x 16<sup>1</sup> + 3 x 16<sup>0</sup> = 372707 (decimal) * **Convert (11011111 11010101)<sub>2</sub> = (12.0... )<sub>8</sub>** * The fraction is converted by adding zeros to the right, and the integer part is converted by adding zeros to the left. * 1101 1101. 1101 0101 = 13 113. 113 5 * **Convert (2B6)<sub>16</sub>** * Binary: 0010 1011 0110 ### Combining Bits * Combine 001010110110 into 3 bit * 001 010 110 = 1 2 6 * **Convert (0.513)<sub>10</sub> to octal** * 0.513 x 8 = 4.104 * 0.104 x 8 = 0.832 * 0.832 x 8 = 6.656 * 0.656 x 8 = 5.248 * 0.248 x 8 = 1.984 * 0.984 x 8 = 7.872 * So (0.513)<sub>10</sub> = (0.4065113i...)<sub>8</sub> * This is done by taking the integer part of the result of multiplying the fraction by 8 and adding it to the right of the decimal point. The remaining fraction is then multiplied by 8 again, and the process is repeated until the desired accuracy is achieved. ### Decimal to Octal Conversion * To convert a decimal number to an octal number, the number is repeatedly divided by 8, and the remainder is added to the right of the octal number. * For example: * Convert (0.0110)<sub>2</sub> to decimal. * 0 x 2<sup>-1</sup> + 1x2<sup>-2</sup> + 1 x 2<sup>-3</sup> + 0 x 2<sup>-4</sup> = 0.375 ## Computer Networks * A **computer network** is a collection of computing devices that are connected in various ways to communicate and share information and resources. * **Classifications of Networks** * **Local Area Network (LAN)**: A network that covers a small geographical area, such as a building or a campus. * **Wide Area Network (WAN)**: A network that covers a large geographical area, such as a country or continent. * **Metropolitan Area Network (MAN)**: A network that covers a metropolitan area. ## Internet * What’s the difference between Internet and World Wide Web? ## Server Client Network * **"Server, Client"** * A Server has resources(Software) and sends it to the connected devices (Clients) through **packets**. * The packets connection between the servers and clients can be via **wires** or **wireless** ## Network Topology * **Topology** is the way devices in a network are connected. * **Bus Topology:** All devices are connected to a single cable. This is a very simple topology, but it is not very reliable. * **Star Topology:** All devices are connected to a central hub. This is a more reliable topology than bus topology, but it can be more expensive. * **Mesh Topology:** All devices are connected to each other. This is the most reliable topology, but it is also the most expensive. ## Logic Gates * **Logic gates** are electronic circuits that perform logical operations. * **Buffer** output is the same as the input, but it can drive a heavier load. ### Types of Logic Gates * **Inverter:** Inverts the input signal. * **AND Gate:** Outputs 1 only when both inputs are 1. * **NAND Gate:** Outputs 0 only when both inputs are 1. * **NOR Gate:** Outputs 0 only when both inputs are 0. * **XOR Gate:** Outputs 1 when inputs are different. * **XNOR Gate:** Outputs 1 when inputs are the same. ## Timing Diagram and XOR Gate * **Timing Diagram:** A timing diagram shows the relationship between the inputs and outputs of logic gates over time. * **XOR Gate Diagram:** <start_of_image> CIRCUIT DIAGRAM | X | Y | Z | Timing Diagram |---|---|---|--- | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | Timing Diagram | 1 | 1 | 0 | * **XNOR Gate Diagram:** CIRCUIT DIAGRAM | X | Y | Z | Timing Diagram |---|---|---|--- | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | Timing Diagram | 1 | 1 | 1 | * Timing Diagram of XNOR and XOR Gate | X | Y | XNOR | XOR | |---|---|---|---| | 0 | 0 | 1 | 0 | | 0 | 1 | 0 | 1 | | 1 | 0 | 0 | 1 | | 1 | 1 | 1 | 0 | Note: The "XOR" gate outputs a true value (1) when the inputs are different and a false value (0) when the inputs are the same. The "XNOR" gate is the opposite of the "XOR" gate.