CA&OS Questions PDF
Document Details
Uploaded by ExuberantUnicorn
Tags
Summary
This document contains multiple-choice questions (MCQs) and open-ended questions related to computer architecture and operating systems. It covers topics such as logic gates, computer components, operating systems, and more.
Full Transcript
MCQs: What is a collection of bits called in Von Neumann architecture? Byte/Word Due to what technological advancements were personal computers made available? Microprocessor advancements What operating system was developed by Bell Labs in 1969? (I don’t remember the exact question, but it was phras...
MCQs: What is a collection of bits called in Von Neumann architecture? Byte/Word Due to what technological advancements were personal computers made available? Microprocessor advancements What operating system was developed by Bell Labs in 1969? (I don’t remember the exact question, but it was phrased somewhat trickily.) UNIX (It was developed by Ken Thompson, Dennis Ritchie, and others at Bell Labs.) Perform the XOR logic operation on the given binary numbers. Which operating system by Microsoft was first used by IBM? MS-DOS (Used by IBM PCs in 1981.) Which was the first operating system in the classic Mac OS family? System 1 (Released in 1984 with the first Macintosh.) Which logic operation is used to invert all the bits in MIPS? NOT operation (The NOT logic operation inverts bits.) What is the definition of a Program Counter? A register that holds the memory address of the next instruction to execute. Which was the first programmable computer? Jacquard Loom (1804) What was the first smallest computer? (I don’t remember it exactly, but it was related to the smallest computer.) IBM 5100 (Released in 1975, often considered the first portable computer.)? Which of the following is the first in the macOS family macOS X (Introduced in 2001, based on Darwin, BSD, and Mach.) eg hexa dec conversion, XOR calculation, XOR produces a high output (1) if inputs are different. some basic history question like which was the first programmable computer, Jacquard Loom (1804): Invented by Joseph Marie Jacquard. Mechanism using first punched cards, considered first programmable. MINIX layers Above the kernel: Servers, below the kernel: Drivers. Function of a program counter? To keep track of the next instruction in a program. What is above the kernel layer in MINIX 3 Servers (System servers handle processes above the kernel.) What is used at the end of each line in C Semicolon (;) One was related to XOR gate XOR produces a high output (1) if inputs are different. First OS by microsoft MS-DOS A group of bits are called in MIPS as ? Word A collection of sectors in a hard disk make? Cluster MCQ: "In Windows OS naming convention, which of the following is allowed to be used" (the answer was an underscore _ cause ;\/ cannot be used) Underscore (_) (Symbols like ;, /, \ are restricted.) MCQ: "About adding two binary numbers." Perform binary addition, carrying over as needed. MCQ: "Which was the first smallest computer or something" (Embedded Systems, IBM, Apple, another one) (I don't remember the exact question but I chose IBM for it.) Likely IBM 5100 (based on context). MCQ: "This was used to calculate numbers using movable beads which represented digits" Abacus MCQ: "What is the collection of services of Apple OS" ( Darwin, BSD, Mach, another one) Darwin (Core of macOS.) MCQ: "What is below the applications layer in the Android Operating System" (Application Framework, Android Runtime, Libraries, Linux Kernel) Libraries (Below applications but above the Linux kernel.) Got an mcq about which layer is above the kernel layer of minx 3, which are the drivers, not the servers. Servers (Not drivers; they are below the kernel.) How many numbers in hex Hexadecimal (base 16) has 16 symbols: 0-9 and A-F. What computers in 40s/60s - minicomputers btw Minicomputers were developed in the 1960s, using transistors and core memory. First programmable pc? The first programmable computer was the Jacquard Loom (via punched cards) or Colossus (for programming). What extension comes out of preprocessing -.i The extension generated by the C preprocessor is.i What Operating System did IBM PC have IBM PCs initially used PC-DOS, a version of MS-DOS. Open-Ended Questions: What is Assembly Language? Assembly language is a low-level programming language that provides a symbolic representation of machine code. It uses human-readable mnemonics instead of binary instructions, making it easier for programmers to write and debug. Assembly language is specific to a processor architecture and is often used for performance-critical or hardware-specific tasks. What is the OR logic gate? (x4) The OR logic gate outputs true (1) if at least one of its inputs is true. It performs a logical addition, where the result is 1 if either or both inputs are 1. If both inputs are 0, the output will be 0. Convert Hexadecimal 10D into Decimal. To convert 10D from hexadecimal to decimal: 10𝐷=(1×16^2)+(0×16^1)+(13×16^0) =256+0+13 =269 So, the decimal equivalent is 269. What are the five registers in the Von Neumann architecture? Program Counter (PC): Holds the memory address of the next instruction. Accumulator (ACC): Stores intermediate arithmetic and logic results. Memory Address Register (MAR): Holds the address of memory to be accessed. Memory Data Register (MDR): Holds data being transferred to/from memory. Instruction Register (IR): Stores the current instruction being executed. What is the difference between Darwin and macOS X? Darwin is the open-source core of macOS X, including the kernel, system libraries, and basic utilities. macOS X builds upon Darwin by adding proprietary components like the Aqua interface, Finder, and other user-level applications. While Darwin focuses on low-level functionality, macOS X provides a complete user-friendly operating system. Explain the MACH component of the macOS kernel. The MACH component of the macOS kernel provides the basic services for memory management, interprocess communication (IPC), and multitasking. It enables the separation of hardware-dependent and independent code, enhancing portability. MACH also implements virtual memory, allowing efficient resource management and application isolation. Minicomputers were made based on these two technologies for memory access and Logic circuits. Describe them. 10 points Minicomputers utilized magnetic core memory for storing data, offering reliable and fast memory access. For logic circuits, they employed transistors, which replaced vacuum tubes, allowing compact, efficient, and cost-effective designs. These advancements enabled the creation of smaller, powerful computing devices. Write assembly code for bitwise OR operation on $s2 and $s1, and store the result in $s3 (10 marks) OR $s3, $s2, $s1 This code performs a bitwise OR operation between registers $s2 and $s1, storing the result in $s3. describe the monolithic OS A monolithic OS is a system where the kernel contains all the essential services like memory management, process scheduling, and I/O operations in a single program. All kernel functions run in a single address space, improving performance but increasing the risk of system crashes. It provides direct communication between components, making it faster than microkernel architectures. convert binary to decimal For example, to convert binary 1010 to decimal: 1010=(1×2^3 )+(0×2^2)+(1×2^1 )+(0×2^0) =8+0+2+0 =10 The decimal equivalent is 10. name 4 tasks of the control unit Fetching instructions: Retrieves instructions from memory. Decoding instructions: Interprets the instructions into executable signals. Executing instructions: Directs components to perform operations. Managing data flow: Controls the data flow between CPU, memory, and I/O devices. What aspects of the file are managed by Operating System's libraries Operating system libraries manage aspects like file creation, deletion, opening, and closing. They handle file metadata, access permissions, and directory management. These libraries also ensure efficient data transfer between storage devices and applications. Name and explain 2 types of file directories Single-level directory: All files are stored in a single directory, making it simple but challenging for file organization in large systems. Hierarchical directory: Files are organized into a tree-like structure with directories and subdirectories, improving file management and access. 1- Describe Mach component of The OS X kernel The Mach component of the OS X kernel provides core functionalities such as virtual memory management, process scheduling, and interprocess communication (IPC). It separates hardware-specific and independent code, allowing for portability across platforms. Mach also supports multitasking and resource allocation, ensuring efficient system performance.Mach is a monolithic kernel. It handles talking between different programs, fixing problems, and dealing with what shows up on the computer screen. 2- Explain p-type doping P-type doping is a process where a semiconductor is infused with an element that has fewer valence electrons than the semiconductor. For example, adding boron (which has three valence electrons) to silicon creates "holes" (positive charge carriers) in the crystal lattice. These holes enhance the semiconductor’s ability to conduct current. 3- Explain the partition table of the hard disk A partition table is a data structure located on a hard disk that defines how the disk is divided into partitions. It stores information such as the size, location, and type of each partition. Common partition table formats include Master Boot Record (MBR) and GUID Partition Table (GPT), which help the operating system locate and manage partitions. 4- Explain the OR Gate (x3) The OR gate is a basic logic gate that outputs a true (1) signal if at least one of its inputs is true. Its behavior can be summarized by the logical expression 𝐴+𝐵, where the output is 1 if 𝐴 or 𝐵 (or both) are 1. If both inputs are 0, the output is 0. 5- Describe an instruction. Nook: An instruction is a command given to a computer processor to perform a specific operation or task. Instructions are the basic building blocks of computer programs and are typically represented in machine language, which is a binary code understood by the computer's central processing unit (CPU). Each instruction corresponds to a specific operation, such as arithmetic calculations, data movement, or control flow operations, and is executed sequentially by the CPU to carry out the desired task. Instructions are fundamental to the execution of computer programs and are responsible for the computer's ability to perform various functions and processes. An instruction is a command given to a computer’s processor to perform a specific task. It consists of an operation code (opcode) that specifies the operation and operands that provide the data or memory locations for the task. Instructions form the basis of programs executed by the CPU. 6- What aspects of the file are managed by Operating System's libraries(I think I messed this one up) Operating system libraries manage file-related aspects such as creating, deleting, opening, and closing files. They handle file metadata, including size, type, and permissions. Libraries also provide APIs for reading and writing data and ensure efficient communication between the application and the storage system. Explain N-Type doping in Semiconductors. N-type doping involves adding an element with more valence electrons than the base semiconductor, such as phosphorus (with five valence electrons) to silicon. The extra electrons become free charge carriers, enhancing the semiconductor's ability to conduct current through negative charge carriers (electrons). Explain Monolithic Operating Systems. In a monolithic operating system, the entire kernel, including core services like memory management, I/O operations, and process scheduling, runs in a single address space. This architecture enables fast communication between components but can increase complexity and risks if an error occurs. Disadvantages of Monolithic Operating Systems (x3) Complex debugging: Errors are harder to isolate due to the tightly coupled components. Stability risks: A failure in one kernel module can crash the entire system. Scalability issues: Adding new features requires extensive modifications to the kernel. Security concerns: Running all components in a single address space increases vulnerability. Explain Hierarchy directories. Hierarchical directories organize files into a tree-like structure with folders (directories) and subfolders. At the top is the root directory, and beneath it, files and subdirectories are arranged logically. This system simplifies file management by grouping related files and making navigation easier. What advantages did the innovation of transistors have over the previously used technologies in Computers (Like the vacuum tube computers) Transistors were smaller, consumed less power, and generated less heat compared to vacuum tubes. They were more reliable, had a longer lifespan, and allowed for the development of smaller and faster computers. These advantages paved the way for modern computing. Explain a mobile operating system and provide an example of a device that uses one. A mobile operating system is software designed to run on handheld devices, managing hardware and applications. It provides features like touch input, wireless connectivity, and app support. An example is Android, used in devices like the Samsung Galaxy smartphones. Explain mainframes (x4) Nook: **Mainframe: A high-performance computer system with large memory capacity, designed to handle billions of simple** tasks in **real-time** within specified timeframes. Mainframes are commonly used by organisations such as banks and insurance companies for **bulk data processing**. Reliability, Availability and Serviceability (RAS) 💡 are the main characteristics. IBM has **90%** market share in mainframe computing worldwide Mainframes are powerful computers used primarily by large organizations for critical applications like bulk data processing, enterprise resource planning, and transaction management. They are known for reliability, scalability, and the ability to handle thousands of users simultaneously. Explain MIPS principle "Simplicity favors regularity" and provide example (?). The principle "Simplicity favors regularity" emphasizes using a consistent and straightforward design in instruction sets to simplify implementation. For example, MIPS instructions often use a fixed format, reducing complexity and improving performance. While the OR instruction (or $s3, $s2, $s1) is valid, a more relevant example might involve simple address calculations in load/store instructions. Nook: The MIPS ISA, a RISC instruction set, is widely used in microprocessors for educational purposes and embedded systems. **MIPS Design Principles**: 1. **Simplicity Favours Regularity**: - the hardware can handle easier instructions with a consistent number of operands. 2. **Make the Common Case Fast**: - Frequently used instructions are optimised for speed. 3. **Smaller is Faster**: - A limited number of small, fast-access registers enhance performance. 4. **Good design demands good compromises:** Name the 4 steps to compiling a C-program. I just listed them without explanation cause y'know, "name them". The four steps to compiling a C program are: Preprocessing (handling directives like #include and macros), Compilation (converting code into assembly), Assembly (assembling code into machine language), Linking (combining object files into an executable). * explain different types of directories (x2) One-level directory: All files are stored in single directory, making it simple but unsuitable for organizing large amounts of data. Two-level directory: Each user has their own directory, improving organization but limiting collaboration. Hierarchical directory: Files are organized in a tree-like structure with folders and subfolders, allowing logical grouping and easier navigation. Acyclic graph directory: Supports shared files by allowing directories to have multiple parent directories * explain a mobile operating system (x4) A mobile operating system manages hardware and software resources on handheld devices, optimizing performance for portability and connectivity. It supports touch inputs, wireless communication, and app ecosystems. Examples include iOS (used in iPhones) and Android (used in devices like the Google Pixel). * CU in Von Neumman 4 responsibilities Fetches instructions from memory. Decodes instructions to determine operations. Directs data flow between components (e.g., ALU, memory). Controls timing and execution of operations. * explain how linked-list works A linked list is a dynamic data structure consisting of nodes, where each node contains data and a pointer to the next node. The structure allows efficient insertion and deletion but requires sequential traversal for access. Variants include singly linked lists (one pointer) and doubly linked lists (two pointers for forward/backward navigation). * XOR on two binary numbers (give example) The XOR operation outputs 1 when inputs differ and 0 when they are the same. Example: Input 1: 1010 Input 2: 1100 XOR Output: 0110 * Turn a binary number into decimal (x3) Multiply each bit by 2^𝑛, where ^𝑛 is the position from the right (starting at 0). (1×2^3 )+(0×2^2 )+(1×2^1)+(1×2^0)= 8+0+2+1 =11. Decimal: 11. * question about RAS RAS is a signal used in dynamic RAM (DRAM) to activate a specific row in the memory array. It reduces the need to specify a full memory address during read/write operations, improving efficiency. * question about minicomputers (transistor + the memory technology) Minicomputers utilized transistors for logic circuits, replacing vacuum tubes, which made them smaller, faster, and more reliable. For memory, they relied on core memory, a magnetic storage technology, which was more durable and faster than earlier memory systems. * ISA architecture question Instruction Set Architecture (ISA) defines the set of instructions a CPU can execute, including data types, registers, memory addressing, and operations. It serves as the interface between hardware and software, ensuring compatibility across systems using the same ISA (e.g., x86 or ARM). * what is the filetype that C preprocessor produces The C preprocessor produces an intermediate file with the extension.i, containing the expanded source code with all macros, includes, and directives processed but not yet compiled. 2 things linker does Combines multiple object files into a single executable program. Resolves external references between object files by linking library functions or other external code. describe the registers(x3) Registers are small, high-speed storage locations in a CPU that hold data, instructions, or addresses temporarily during processing. Types in Von Neumann include: Program Counter (PC): Tracks the next instruction. Instruction Register (IR): Holds the current instruction. Memory Address Register (MAR): Contains memory addresses to access data. Memory Data Register (MDR): Stores data fetched from or sent to memory. Accumulator (AC): Holds intermediate arithmetic or logic results. Describe tally stick and how it was used (6 marks) [i messed this one up, wrote wooden stick instead of bone] The tally stick, often made of bone, was an early tool used to record numbers. Marks or notches were carved to represent counts, typically for tracking debts, goods, or transactions. Split tally sticks were used to ensure authenticity, as each party retained half to prevent tampering. Two problems in monolithic OS (6 marks) (x2) **Pros:** - Fast execution speed, as it provides CPU scheduling, memory management, and file management. **Cons:** - Large kernel size. - Failure in one service within the OS can lead to the failure of the entire system. How RAID technology works (8 marks) **RAID** (Redundant Array of Independent Disks) **technology** It is a method of combining **multiple physical hard drives into a single logical unit for data storage**. The purpose of RAID is to improve data reliability and/or increase performance.- Redundant array of inexpensive disks.- Server distributes all data among the provided hard disks.- In case of a drive failure the server will re-build the data from the failed drive onto a new drive. RAID (Redundant Array of Independent Disks) combines multiple physical disks into a single logical unit to improve performance, redundancy, or both. Data is distributed across disks using techniques like striping (RAID 0), mirroring (RAID 1), or parity (RAID 5/6). Parity ensures data recovery if a disk fails, making RAID reliable for critical systems. List 5 von neumann registers (10 marks) Program Counter (PC): Tracks the next instruction. Instruction Register (IR): Holds the current instruction. Memory Address Register (MAR): Contains memory addresses to access data. Memory Data Register (MDR): Stores data fetched from or sent to memory. Accumulator (AC): Holds intermediate arithmetic or logic results. How binary numbers written in two's complement are turned into its minus form (8 marks) Invert all the bits (0 to 1, 1 to 0). Add 1 to the inverted binary number. Example: Binary 0110 (6 in decimal). Invert: 1001. Add 1: 1010 (-6 in decimal). Write assembly code for bitwise OR operation on $s2 and $s1, and store the result in $s3 (10 marks) explain how this is done or $s3, $s2, $s1 Explanation: $s1 and $s2 are source registers. $s3 is the destination register. The or operation computes the bitwise OR of $s1 and $s2, storing the result in $s3 Difference between Darwin and MacOS Darwin is the open-source core of macOS, providing the UNIX-based kernel and system services. macOS builds on Darwin, adding proprietary user interfaces like Finder, Dock, and features like iCloud, making it a complete consumer operating system. Explain what instructions are (x3) Instructions are commands executed by the CPU, defining operations like arithmetic, logic, data transfer, and control flow. They consist of an opcode (operation type) and operands (data or addresses). Instructions are fundamental to program execution. 4 Layers or Android Operating System Linux Kernel: Manages hardware and system resources. Libraries & Android Runtime: Provide core functionalities and a virtual machine for apps. Application Framework: Offers APIs for app development. Applications: User-facing apps like messaging and browsers Minicomputers , discrete transistors and core memory (x3) Minicomputers used discrete transistors for compact, efficient logic circuits, replacing vacuum tubes. They relied on core memory for durable and faster storage, enabling multitasking and real-time computing. Describe client server model (6 points) The client-server model involves a server providing services (e.g., data, processing) to multiple clients over a network. Clients send requests, and the server responds with the requested resources. This model is efficient for distributed computing. Name two main problems monolithic operating system (6 marks) Difficult to maintain due to tightly integrated components. Vulnerability to bugs or crashes that can affect the entire system. Describe Binary representation in two’s complements is turned to minus form (8 marks) To convert a positive binary number to its negative form: Invert all bits (flip 0 to 1 and 1 to 0). Add 1 to the inverted result. Example: 5 in binary 0101: Invert: 1010. Add 1: 1011 (-5 in decimal). Explain p-type doping in semi-conductor (how to make p-type doping semi-conductor), from which chemical elements and its electrical charge(positive or negative) and also the carrier of its electrical charge. (10 points) (x2) P-type doping introduces trivalent elements (e.g., boron) to silicon, creating "holes" (positive charge carriers). The absence of electrons in the lattice allows electrical conduction as electrons jump to fill the holes. P-type materials are essential for creating PN junctions in semiconductors. Explain the Mach component of the MacOs kernel. Describe two of its roles? (10 points)(x2) The Mach component of the macOS kernel is a microkernel that provides essential services like process management and inter-process communication (IPC). Process Management: Handles multitasking by managing the creation, execution, and termination of processes. Memory Management: Supports virtual memory, enabling efficient memory allocation and protection between processes. Define differences between Darwin OS and Mac Os X (x3) Darwin is the open-source foundation of macOS X, comprising a UNIX-based kernel and core system components. In contrast, macOS X is a complete operating system built on Darwin, incorporating a graphical user interface, proprietary applications, and consumer-focused features like iCloud and the App Store. Write a path to source file in assembly language.data source_path:.asciiz "/path/to/source/file.c" This defines a null-terminated string pointing to the source file's location. Explain a compilation process of C The compilation process of a C program involves four steps: Preprocessing: Handles directives like #include and #define, producing a.i file. Compilation: Converts preprocessed code into assembly language, generating a.s file. Assembly: Transforms the assembly code into machine code, creating an object file (.o). Linking: Combines object files and libraries into an executable program.