Introduction To Computing Sciences (COS 101) Lecture Note PDF

Document Details

Uploaded by Deleted User

Federal University of Kashere

Mr Isuwa J.

Tags

computer science introduction to computing computer fundamentals learning resources

Summary

These lecture notes provide an introduction to computer science. It discusses computer operations, characteristics, historical development, and other related topics. The document includes a course overview, prerequisites, materials, and course goals. It also covers the different units studied in the course.

Full Transcript

Introduction to Computing Sciences (COS 101) | Mr Isuwa J. INTRODUCTION TO COMPUTING SCIENCES (COS 101) Course Contents: Computer Operations, Characteristics of computer, Historical development of Computer system; Genera...

Introduction to Computing Sciences (COS 101) | Mr Isuwa J. INTRODUCTION TO COMPUTING SCIENCES (COS 101) Course Contents: Computer Operations, Characteristics of computer, Historical development of Computer system; Generation of Computer systems; Overview of the discipline of computer Science; General Structure of a computer system; Internal structure of computer Hardware, storage, manipulations, and Retrieval of Data. computer number system, computer arithmetic, computer data representation schemes, low and high languages, source and object programs, and translators. Internet and its facilities, basic file processing concepts. Introduction to Program development, flow charts, and algorithms using BASIC fundamentals. Course Coordinator: Name: Mr. Jeremiah Isuwa Office: Examination Office, Department of Computer Science Email: [email protected] 1 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. COURSE OVERVIEW Welcome to Introduction to Computer Science This course introduces learners to basic notions in Computer Science and computing. It covers topics such as the development of the history of computers and computing; the characteristics of computer systems; the organization of a computer system; the Von Neumann architecture, the history of the Internet; and basic software applications. It is designed for learners with little or no experience in computer use Prerequisites The module has no prerequisite. Learners can register for the course in their first year. Students MUST at the end of each week submit the completed LAB MANUAL Materials Refer to the below listed for more insights. Google Youtube Free Online AI educative platforms Course Goals Upon completion of this course, students should be able to: 1. Describe Computers and their types; 2. Distinguish elements of the Von Neumann Architecture; 3. Identify characteristics of Computers that made them useful and indispensable tools of our time; 4. Explain the functioning and application of the Internet; and 5. Use word processing, spreadsheet, and presentation software features effectively 6. Many more... 2 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 0: Module Content: Definition of a computer Data and Information Methods of data representation Data processing Objectives: 0.1 What is a Computer? A computer is defined as an electronic device designed for storing and processing data, typically in binary form. It is capable of: i. Taking input data through the keyboard (input unit), ii. Storing the input data in a diskette, hard disk, or other medium, iii. Processing it in the central processing unit (CPU) and iv. Giving out the result (output) on the screen or the Visual Display Unit (VDU). Figure 1: Computer Capabilities Now let’s Understand each of the Four (4) units shown above 1. Input: Input refers to the data or information that a computer receives from various sources. This can include text entered through a: 3 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. keyboard, mouse clicks, images from a camera, or any other information that the computer uses to perform tasks. 2. Output: Output is the result of a computer's processing. It includes the information, results, or actions that the computer presents to the user. This can be displayed on the screen, printed on paper, or heard through speakers, depending on the type of output. 3. Processing: Processing is the core function of a computer. It involves the manipulation and transformation of data or information. The central processing unit (CPU) is responsible for executing instructions and performing tasks, such as calculations, sorting, and running software applications. 4. Storage: Storage refers to the capability of a computer to save and retain data or information for future use. Computers have different types of storage, including primary storage (RAM) for temporary data access and secondary storage (hard drives, solid-state drives) for long-term data retention. Storage allows computers to store software, documents, and various files. Now let us Understand the Concepts of ‘Data’ and ‘Information’ Data: Data refers to raw facts, figures, or symbols that have not been processed or organized in a meaningful way. It can take various forms, such as numbers, text, images, or sounds. Data on its own lacks context or significance and may need processing to become useful. e.g. 4 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. name, age, complexion, school, class, height etc. Information: Information is data that has been processed, organized, or presented in a way that makes it meaningful and useful. When data is analyzed, structured, or contextualized, it becomes information. Information provides knowledge or answers to questions, enabling people to make informed decisions or understand a particular subject better. e.g. net pay of workers, examination results of students, list of successful candidates in an examination or interview etc. 0.2 Method of Data Representation Method of Data Representation refers to the way we express and convey data. It's like the language computers and people use to communicate information. Common methods include text, numbers, images, and sounds. Each method is like a different 'language' for data, allowing us to understand and work with information on a computer." i. Text Representation: Text representation is used to display and store letters, numbers, and characters. It's the most basic form of data and is used for documents, emails, code, and more. Text data is represented using characters and symbols like letters, numbers, and punctuation. 5 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. ii. Numeric Representation: Numeric representation is used for numbers and mathematical operations. Computers use numeric data to perform calculations and store values. This data can be integers (whole numbers) or floating-point numbers (numbers with decimal points). iii. Image Representation: Image representation is used to display and store visual information such as pictures and graphics. Images are made up of pixels, each containing color information. Common image formats include JPEG, PNG, and GIF. iv. Sound Representation: Sound representation is used for audio data, including music and voice recordings. Computers store sound data as a series of digital samples that represent changes in air pressure over time. Sound formats include MP3, WAV, and AAC. v. Video Representation: Video representation is used for moving images. Videos are a sequence of individual frames, each represented as an image. Video data requires large amounts of storage and is commonly used in movies, streaming, and video conferencing. 0.3 Data Processing Data processing: Is the manipulation and transformation of data into meaningful information. It involves a series of steps to collect, organize, analyze, and present data in a way that allows for decision-making or understanding of a specific problem or situation. 0.3.1 Procedures In Data Processing Here's a brief overview of the steps involved in data processing: 1. Data Collection: This is the initial step where raw data is gathered from various sources. It can include data entry, sensors, databases, or external data feeds. Data can be in the form of text, numbers, images, or other formats. 6 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 2. Data Entry and Validation: Data may need to be entered into a computer system and validated to ensure accuracy and completeness. This process can involve manual input or automated data capture. 3. Data Storage: Data is often stored in databases, files, or other data storage systems for easy access and retrieval. Organizing data helps in efficient processing. 4. Data Cleaning and Transformation: Data is cleaned to remove errors and inconsistencies. Transformation may involve converting data into a common format or performing calculations to derive new insights. 5. Data Analysis: Data is analyzed using various tools and techniques to extract patterns, trends, and useful information. This step may involve statistical analysis, machine learning, or data visualization. 6. Data Presentation: The results of data analysis are presented in a format that is understandable to humans. This can be through reports, charts, graphs, or dashboards. 7. Decision-Making: The processed information is used to make decisions, whether in business, science, or other fields. It can provide insights for problem-solving and future planning. Data processing is essential in various domains, including business, healthcare, research, and technology. It enables organizations and individuals to turn raw data into knowledge and make informed choices. 0.4 End of Module: Laboratory Work Complete: Week One: Fundamentals of a Computer System 7 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 1: Module Content: Characteristics of a Computer Applications of Computers Disciplines in Computer Science Intersection of Computer Science with Other disciplines. Objectives: 1.1 Characteristics of a Computer? Computers have several key characteristics that distinguish them from other devices. Here are the fundamental characteristics of a computer: 1. Processing Power: Computers are capable of processing and executing instructions at high speeds. This processing power is provided by the central processing unit (CPU). 2. Storage Capacity: Computers can store vast amounts of data and information, ranging from text and images to software programs and user files. Storage can be in the form of hard drives, solid-state drives, and various other storage devices. 3. Accuracy: Computers perform operations with a high degree of accuracy and consistency. They are not prone to human errors and can execute repetitive tasks reliably. 4. Versatility: Computers can perform a wide range of tasks, from word processing and data analysis to multimedia editing and gaming. They can be adapted for various applications. 5. Automation: Computers can automate tasks, reducing the need for manual intervention. This is particularly useful in repetitive and time-consuming processes. 6. Speed: Computers can process data and perform tasks much faster than humans. This speed is especially advantageous in complex calculations and data analysis. 7. Multitasking: Modern computers are capable of running multiple applications simultaneously, allowing users to switch between tasks and perform multiple functions concurrently. 8 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 8. Connectivity: Computers can be connected to networks and the internet, enabling communication and data exchange between devices and remote systems. 9. Memory: Computers have both primary (RAM) and secondary (storage) memory. RAM allows for quick data access, while storage memory retains data for the long term. 10. User Interaction: Computers provide various input and output options, allowing users to interact through keyboards, mice, touchscreens, and displays. Voice and gesture recognition are also becoming common. 11. Scalability: Many computers can be upgraded or expanded by adding more memory, storage, or other components to meet changing needs. 12. Software Compatibility: Computers run on software that can be easily updated or replaced, allowing for new applications and operating systems. 13. Digital Processing: Computers work with digital data in the form of binary code (0s and 1s). This digital nature allows for efficient data manipulation and storage. 14. Security: Computers can be equipped with security measures to protect data and information from unauthorized access, malware, and other threats. 15. Reliability: When properly maintained, computers are highly reliable machines. They can operate for extended periods without significant downtime. These characteristics make computers versatile and powerful tools used in a wide range of applications, from personal computing to scientific research, business, and entertainment. 9 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 1.2 Application of Computers? The importance of computer applications in our daily lives cannot be overstated. Computers have become indispensable tools that streamline and enhance numerous aspects of our existence. In personal and professional domains, they enable efficient communication, information access, and productivity. From managing finances and healthcare records to facilitating education and research, computers have revolutionized how we conduct our daily affairs. Their impact on society extends far and wide, shaping the way we work, learn, and interact, and underlining their enduring significance. Here are some common applications of computers: 1. Business and Finance: Accounting and financial management Inventory and supply chain management Data analysis and market research Online banking and e-commerce 2. Education: Online learning and virtual classrooms Educational software and simulations Research and data analysis for academic studies 3. Healthcare: Electronic health records (EHRs) Medical imaging and diagnostics Drug discovery and research Telemedicine and remote patient monitoring 4. Entertainment and Media: Video games and game development Video and audio editing Streaming services Digital art and animation 5. Science and Research: 10 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Data analysis and modeling Simulations and experiments Space exploration and climate modeling Bioinformatics and genomics 6. Communication: Email and instant messaging Social media platforms Video conferencing and collaboration tools 7. Manufacturing and Engineering: Computer-aided design (CAD) Process automation and control Quality control and testing 8. Government and Administration: Record-keeping and data management Geographical information systems (GIS) Defense and national security applications 9. Agriculture: Precision agriculture and crop management Weather forecasting and climate monitoring 10. Transportation: Traffic control and management systems GPS navigation and route optimization 11. Environmental Monitoring: Air and water quality monitoring Wildlife tracking and conservation efforts 12. Personal Use: Word processing and document creation Internet browsing and communication Entertainment and social networking 11 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 1.3 Disciplines in Computer Science? 1.3.1 What is Computer Science? Computer science is the study of computers and the principles that underlie them. It's like learning the language of computers. Is the scientific and mathematical approach to computation, specifically to the design of computing machines and processes. Computer Science is concerned with the application of scientific principles to the design, construction, and maintenance of systems based upon the use of computers. 1.3.2 Who is a Computer Scientist? A computer scientist is a professional who specializes in the study and application of computer science, which is the scientific and practical approach to computing and information technology. Computer scientists are involved in various aspects of computer technology, including designing, developing, and analyzing software and hardware systems, as well as solving complex problems related to computation. 1.3.3 Disciplines in Computer Science 1. Software Development: Creating and maintaining software applications, algorithms, and computer programs to perform specific tasks. 2. Hardware Development: Designing and building computer hardware components, such as processors, memory, and input/output devices. 3. Data Analysis and Machine Learning: Applying data analysis and machine learning techniques to extract insights and patterns from data. 4. Networks and Security: Managing and securing computer networks and information systems to protect against cyber threats. 5. Artificial Intelligence and Robotics: Researching and developing AI algorithms and robotic systems for various applications. 6. Database Management: Designing, implementing, and managing databases for efficient data storage and retrieval. 7. Theoretical Computer Science: Engaging in theoretical research to advance the fundamental principles of computation. 12 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 8. Software Engineering: Developing methodologies and best practices for software development, including project management and quality assurance. 1.3.4 Intersection of Computer Science with Other fields Computer science intersects with a wide range of other disciplines, and these intersections have led to significant advancements in various fields. Here are some notable intersections of computer science with other disciplines: 1. Bioinformatics: Computer science is used to analyze and model biological data, enabling advancements in genomics, proteomics, and drug discovery. 2. Computational Linguistics: It applies computer science techniques to study human language, leading to developments in natural language processing and machine translation. 3. Geographic Information Systems (GIS): Computer science and geography intersect in GIS, which is used for mapping, spatial analysis, and urban planning. 4. Digital Humanities: Computer science tools are applied to analyze and preserve cultural heritage, historical records, and literature. 5. Astronomy: Astronomers use computational techniques for data analysis, simulations, and the study of the universe. 6. Environmental Science: Computer science is vital for modeling and simulating complex environmental systems and analyzing climate data. 7. Economics and Finance: Computational methods are used for modeling economic systems, risk analysis, and high-frequency trading. 8. Psychology and Cognitive Science: Computer science contributes to the study of human cognition, artificial intelligence, and human-computer interaction. 9. Education: EdTech uses computer science to develop e-learning platforms, adaptive learning systems, and online educational resources. 10. Music and Arts: Computer science is used in music composition, digital art, and the creation of interactive installations. 11. Transportation and Urban Planning: Traffic management, smart cities, and autonomous vehicles rely on computer science and data analysis. 13 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 12. Environmental Conservation: Computer science is used for wildlife tracking, ecological modeling, and conservation efforts. 13. Social Sciences: It aids in data analysis and modeling of social and behavioral patterns. Figure 2: Intersection of Computer Science with other disciplines 14 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 2: Module Content: Historical Development of the Computer System Generations of Computers Objectives: 2.1 Historical Development of the Computer System? Even before humans could read or write, they needed to count. First, they used their fingers, but when they had to deal with figures over ten, a counting device became necessary. Pebbles and bits of wood arranged on the ground were used to count goods and to figure prices. The word computer was initially used to refer to human beings that perform calculations. Figure 3: When humans do the tasks that a computer now do 2.1.1 Brief History The historical development of the computer system has evolved through various stages, each marked by technological innovations. 15 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. It all began with simple counting devices like the abacus, which were used for arithmetic calculations as early as 3000 BCE. An Abacus These early mechanical tools, though basic, laid the foundation for more complex computing machines. Fast forward to the mid-20th century, and we witnessed the emergence of the First Generation of computers. These early machines, such as ENIAC (Electronic Numerical Integrator and Computer), were enormous and relied on vacuum tube technology, enabling complex calculations but being bulky and prone to technical issues. An ENAIC 16 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. This period marked the inception of digital computing, which has since evolved through the Second, Third, Fourth, and Fifth Generations, characterized by developments like transistors, microprocessors, integrated circuits, and the miniaturization of components. These advancements have led to the powerful, compact, and versatile computers that are integral to our lives today, showcasing the remarkable journey of computer system development. 2.1.2 The Von Nuemann Machine/Architecture The Von Neumann Machine, also known as the Von Neumann Architecture, is a foundational concept in computer science and architecture. It was developed by the mathematician and computer scientist John von Neumann in the 1940s. The Von Neumann Architecture is the basis for nearly all modern computers, from desktops and laptops to smartphones and servers. It offers a flexible and efficient approach to computing, where data and instructions can be stored and manipulated in a unified memory system, making it possible to execute a wide variety of tasks and run different programs on a single machine. This architecture serves as the basis for most modern computers and is characterized by the following key features: 1. Central Processing Unit (CPU): The CPU is the core component responsible for executing instructions and performing calculations. It includes the Control Unit (CU) and the Arithmetic Logic Unit (ALU). 2. Memory: Memory in a Von Neumann machine is used to store both data and program instructions. This is in contrast to earlier computer designs that used separate memory units for data and instructions. 3. Stored-Program Concept: In a Von Neumann machine, both data and program instructions are stored in memory, and the CPU can access and manipulate both. This concept allows for great flexibility in programming and the ability to change a computer's behavior by loading different instructions. 17 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 4. Fetch-Execute Cycle: The CPU follows a sequence of steps called the "fetch-execute cycle." It fetches instructions from memory, decodes them, executes the instructions, and then stores the results back in memory. 5. Sequential Execution: Instructions are executed one after another in a sequential manner, which is the fundamental principle of Von Neumann's architecture. 6. Binary Representation: Data and instructions are represented in binary form, which is the language that computers understand. 7. Control Unit: The Control Unit manages the execution of instructions, directing the flow of data between memory and the ALU, and ensuring that instructions are executed in the correct order. 8. Address Bus and Data Bus: The architecture uses separate buses for addressing memory (address bus) and transferring data (data bus) between memory and the CPU. Figure X: The Von Neumann Architecture 2.2 Generations of Computers The word generation is usually associated with the stage of computer development with a particular sort of technological innovation. Each innovation makes available certain techniques that were not available in the past. Computers were thus classified based on generations. 18 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 1. First Generation (1940s-1950s): In the 1940s, the first-generation computers were developed using vacuum tubes for electronic components. The Electronic Numerical Integrator and Computer (ENIAC), built in 1945, was one of the first general-purpose electronic digital computers. These early computers were large, slow, and consumed a lot of power. Figure 4: Vacuum Tubes 2. Second Generation (1950s-1960s): In the 1950s, transistors replaced vacuum tubes, making computers smaller, faster, and more reliable. The IBM 1401 and UNIVAC 1107 are notable examples from this era. Magnetic core memory was introduced for data storage, and assembly language programming became more common. Figure 4: Transistors 19 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 3. Third Generation (1960s-1970s): The 1960s saw the development of integrated circuits (ICs) and the invention of microchips, leading to smaller and more powerful computers. The IBM System/360, introduced in 1964, was a significant example of this generation. High-level programming languages like FORTRAN and COBOL made programming more accessible. Figure 5: Integrated Circuit 4. Fourth Generation (1970s-1980s): Microprocessors, which combined CPU functions on a single chip, were introduced in the early 1970s. Personal computers (PCs) emerged, with the Intel 4004 microprocessor (1971) being a key component. The Apple II (1977) and IBM PC (1981) brought computing to homes and businesses. 20 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Figure 6: Microprocessors 5. Fifth Generation (1980s-Present): The fifth generation brought advancements in parallel processing, artificial intelligence, and expert systems. Graphical user interfaces (GUIs) and the development of the World Wide Web in the late 20th century made computing more user-friendly and accessible. Modern computers use multi-core processors, solid-state drives, and cloud computing for enhanced performance and connectivity. Figure 7: Artificial Intelligence 21 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 3: Module Content: Computer Operations The Central Processing Unit (CPU) The Storage Objectives: 3.1 Computer Operations 3.1.1 Functional Units of a Computer The functional units of a computer are essential components that work together to execute instructions and perform various tasks. These units are responsible for different aspects of computing and play distinct roles in the overall operation of a computer. A computer is a device that operates upon information or data. It is an electronic device that accepts input data, stores the data, does arithmetic and logic operations, and outputs the information in the desired format. Even though the size, shape, performance, reliability, and cost of computers have been changing over the years, the basic logical structure proposed by Von Neumann has not changed. The internal architecture of computers differs from one system model to another. A block diagram of the basic computer organization specifying different functional units is shown below. Here the solid lines indicate the flow of instruction and data and the dotted lines represent the control exercised by the control unit. The primary functional units of a computer are as follows: 1. Central Processing Unit (CPU): The CPU is the core of the computer, responsible for executing instructions and performing calculations. It consists of the Control Unit (CU) and the Arithmetic Logic Unit (ALU). The CU manages the execution of instructions and data flow, while the ALU performs arithmetic and logical operations. 2. Memory Unit: 22 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. The memory unit includes both primary memory (RAM) and secondary memory (storage devices like hard drives or SSDs). Primary memory provides temporary storage for data and program instructions currently in use by the CPU. Secondary memory stores data and programs for long-term use. 3. Input Unit: The input unit collects data and instructions from external sources or user input. Input devices like keyboards, mice, and touchscreens allow users to interact with the computer and provide data for processing. 4. Output Unit: The output unit is responsible for delivering results to the user or external devices. Output devices like monitors, printers, and speakers present the processed information in a usable format. Figure 8: Functional Units of a Computer 23 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 3.1.2 Relationship among the four units of a computer The four functional units of a computer — the Central Processing Unit (CPU), Memory Unit, Input Unit, and Output Unit — are intricately interconnected to create a harmonious computing system. The CPU, often considered the computer's "brain," processes instructions and data from the Memory Unit. It communicates with the Input Unit to receive user input or data from external sources and generates output through the Output Unit. Memory serves as the bridge between these units, temporarily storing data and program instructions for the CPU to access. This close relationship allows for seamless data transfer and processing, ensuring that users can interact with the computer effectively. Together, these functional units enable the computer to perform a wide range of tasks, from executing programs and calculations to presenting results in a user-friendly manner. Figure 9: Functional Units of a Computer 3.2 The Central Processing Unit (CPU) The Central Processing Unit (CPU) in a computer can be thought of as the "brain" of the system. It's the component responsible for executing instructions and performing calculations. Just like our brains process thoughts and solve problems, the CPU processes data and runs programs. It consists of two main parts: the Control Unit (CU), which manages the flow of data and instructions, and the Arithmetic Logic Unit (ALU), which performs mathematical and logical operations. Essentially, the 24 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. CPU is where all the "thinking" and computation take place in a computer, making it a critical component for any computing task. Figure 10: The Central Processing Unit 3.2.1 Components of the CPU These CPU components work together seamlessly to process data, execute instructions, and perform all the tasks that make your computer run smoothly. 1. Control Unit (CU): Think of the Control Unit as the "traffic cop" of the CPU. It manages the flow of data and instructions inside the computer. It decodes instructions, directs where data should go, and controls the execution of tasks. 2. Arithmetic Logic Unit (ALU): The ALU is like the "math wizard" of the CPU. It performs all the mathematical and logical operations, such as addition, subtraction, multiplication, division, and comparisons. It's where the actual calculations happen. 25 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 3.2.2 Relationship between the CPU and Storage (Memory) The relationship between the CPU (Central Processing Unit) and memory is crucial to a computer's operation. The CPU needs to access and interact with memory to perform tasks. Here's a simplified explanation: The CPU is like the "brain" of the computer, responsible for executing instructions and calculations. It constantly needs data and instructions to work with. Memory, which includes RAM (Random Access Memory), is like the computer's "short-term memory." It provides a space where the CPU can quickly access and store the data and program instructions it needs. When the CPU runs a program, it fetches instructions and data from memory, processes them, and then stores the results back in memory. This back-and-forth interaction between the CPU and memory is fundamental to the computer's functioning. A computer with faster memory and efficient data access can perform tasks more quickly, making the CPU's job smoother and the computer more responsive. 3.3 The Storage Computer storage is like the digital memory of your computer. It's where your computer keeps all the data, files, and programs. There are two main types of computer storage: 1. Primary Storage: Primary storage is also known as RAM (Random Access Memory). Think of it as your computer's "working memory." When you open a program or file, it's loaded into RAM so the CPU can quickly access and work with it. RAM is fast but temporary; when you turn off your computer, everything in RAM is gone. Figure 11: The Random Access Memory 26 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 2. Secondary Storage: Secondary storage is where your computer keeps data for the long term. This includes your hard drive or SSD (Solid State Drive). These are like the "bookshelves" of your computer, where you store documents, pictures, music, and software. Unlike RAM, data in secondary storage stays even when you turn off your computer. Figure 12: Secondary Memories Summarily, Primary storage (RAM) is for quick access and processing, and Secondary storage (hard drive or SSD) is for keeping everything safe and accessible whenever you need it. 3.3.1 Characteristics of the Primary Memory (RAM) 1. Working Memory: RAM is like the computer's "working memory." It's where the CPU (Central Processing Unit) stores the data and program instructions that it's currently using. This allows the CPU to access this data quickly, which is essential for smooth and efficient operation. 2. Speed: RAM is incredibly fast, much faster than secondary storage devices like hard drives or SSDs. This speed is crucial for tasks that require rapid data access, such as running software applications, web browsing, and multitasking. 3. Volatile: Unlike secondary storage, RAM is volatile, which means it loses all its data when the computer is turned off or restarted. This is why it's called "temporary" storage. It's ideal for holding data that you're actively using but not for long-term data storage. 4. Determines Performance: The amount and speed of RAM in a computer have a significant impact on its performance. Having more RAM allows a computer to run more applications 27 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. simultaneously without slowing down, and it reduces the need for the CPU to continuously access data from slower secondary storage. 5. Upgradeable: In many cases, you can upgrade your computer's RAM by adding more modules or replacing existing ones with larger ones. This can improve your computer's performance, especially if you find it becoming slow when running multiple applications. 6. Other Examples: Cache Memory, Registers, ROM (Read-Only Memory), and Flash Memory. 3.3.2 Characteristics of the Secondary Memory (Hard drives and SSDs) 1. Long-Term Storage: Secondary storage serves as your computer's long-term memory. It's where you store all your files, documents, applications, and the operating system. Data on secondary storage remains intact even when you turn off your computer. 2. Types: Hard Disk Drives (HDDs): Traditional hard drives use spinning disks to store data. They offer high storage capacity but are relatively slower than SSDs. Solid State Drives (SSDs): SSDs use flash memory to store data. They are significantly faster and more durable than HDDs, making them a popular choice for modern computers. 3. Speed vs. Capacity: HDDs provide larger storage capacity at a lower cost, but they are slower in terms of data access. SSDs, on the other hand, offer much faster data access but may be more expensive for the same capacity. 4. Durability: SSDs are more durable than HDDs because they have no moving parts. This makes them less susceptible to damage from shocks or drops. 5. Boot Times and Application Launch: Computers with SSDs tend to boot up more quickly and launch applications faster compared to those with HDDs. SSDs are known for their speed in read and write operations. 28 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 6. Upgrading: Many computers allow you to upgrade or replace secondary storage. This is a common practice to improve performance and increase storage space. 7. Backup and Data Security: Secondary storage is essential for backing up important data. Regular backups ensure that your data is safe in case of hardware failure or other unforeseen events. 8. Data Organization: You can create folders and directories to organize your files on secondary storage, making it easy to locate and manage your data. 9. Other Examples: External Hard Drives, Network Attached Storage (NAS), Optical Discs (CDs, DVDs, Blu-ray), USB Flash Drives, Memory Cards (e.g., SD cards, microSD cards), Tape Drives, Cloud Storage, Network-Attached Storage (NAS), RAID Arrays (Redundant Array of Independent Disks). 3.4 End of Module: Laboratory Work Complete: Week Four: Input and Output Devices 29 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 4: Module Content: Classifications of Computers Hardware and Softwares Programming languages Objectives: 4.1 Computer Operations Computers can be classified into various categories based on their: 1. Types, 2. Size and 3. Purpose, 4.1.1 Classification Based on Types i. Analog ii. Digital iii. Hybrid These three classifications of computers based on data representation and processing techniques serve different purposes and have unique advantages and limitations. Digital computers are the most common and versatile, while analog computers are specialized for continuous data, and hybrid computers bridge the gap between the two, offering the best of both analog and digital worlds. i. Analog Computers: Analog computers are designed to process continuous data, often in the form of physical quantities like voltage, pressure, or temperature. They use analog components, such as analog circuits and sensors, to represent and manipulate data. Analog computers are well-suited for tasks like modeling physical systems, control systems, and scientific simulations where the input and output data are continuously varying. However, they are less common today and have largely been replaced by digital computers for most applications due to limitations in precision and flexibility. 30 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Examples Include: Analog Oscilloscope, Analog Hygrometer, Analog Thermometer Analog Thermometer ii. Digital Computers: Digital computers are the most prevalent type of computer and are based on the binary number system (0 and 1). They use digital components, such as transistors and microprocessors, to process discrete data and execute instructions in a sequential, logical manner. Digital computers are versatile and can perform a wide range of tasks, from calculations and data processing to running software applications and games. They are highly accurate, and reliable, and offer precise control over data and operations, making them suitable for various applications in business, science, and daily life. Examples Include: Desktop Computers, Laptops, Tablets, Smartphones, Digital Watches. Digital Computer 31 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. iii. Hybrid Computers: Hybrid computers combine features of both analog and digital computers to optimize performance for specific applications. They use analog components for some functions and digital components for others. Hybrid computers are often employed in tasks where analog data needs to be converted into digital form for processing and vice versa. For example, they are used in real-time control systems and scientific experiments. The combination of analog and digital elements allows hybrid computers to provide the benefits of both worlds, offering accuracy, speed, and adaptability. Examples Include: Digital Multimeters, Flight Control Systems, Medical Monitoring Equipment Digital Multimeter 4.1.2 Classification Based on Purpose Computers can be classified into two broad categories based on their intended use: i. Special-purpose computers and ii. General-purpose computers. Special-purpose computers excel at specific tasks but lack the flexibility of general-purpose computers, which are designed to handle a broad spectrum of applications and user needs. 32 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 1. Special-Purpose Computers: i. Single-Task Devices: Special-purpose computers are designed to perform specific tasks or functions. They are optimized for a single application and are not easily adaptable to other tasks. ii. Customized Hardware and Software: These computers often feature specialized hardware components and software tailored to the specific task they are designed for. iii. Examples: Digital Signal Processors (DSPs): Designed for processing digital signals in applications like audio and image processing. Point-of-Sale (POS) Terminals: Used in retail for transaction processing. GPS Navigation Systems: Built for GPS data processing and mapping. Gaming Consoles: Optimized for playing video games. 2. General-Purpose Computers: i. Multi-Tasking Capabilities: General-purpose computers are versatile and capable of performing a wide range of tasks. They can run various software applications and are not limited to a single function. ii. Standard Hardware and Software: They use standardized hardware components and general-purpose operating systems that allow users to install and run a variety of software. iii. Examples: Personal Computers (PCs): Including desktops, laptops, and tablets, these are used for a wide range of tasks, from web browsing and word processing to gaming and programming. Servers: General-purpose servers can be used for tasks like hosting websites, managing databases, and providing network services. Workstations: These are used for demanding tasks like 3D modeling, scientific simulations, and software development. Smartphones: While they serve specific communication and entertainment functions, they are also general-purpose devices with a wide range of apps. 33 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 4.1.3 Classification Based on Size Computers can be classified based on their sizes: i. Super ii. Mainframe iii. Mini and iv. Micro These categories are based on factors such as processing power, scale, and primary applications. Each type of computer serves specific needs, from highly specialized tasks to general-purpose computing for individuals and organizations. 1. Supercomputers: i. Purpose: Supercomputers are designed for high-speed and complex computational tasks, such as scientific simulations, weather forecasting, and nuclear research. ii. Performance: They are the most powerful and fastest computers available, with massive processing capabilities. iii. Examples: IBM Summit, Fugaku, and the Cray XT5. Super Computers 2. Mainframe Computers: i. Purpose: Mainframes are used in large organizations for data processing, business-critical applications, and database management. 34 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. ii. Performance: They offer high reliability, redundancy, and support multiple users concurrently. iii. Examples: IBM zSeries, UNISYS ClearPath, and HPE NonStop. Mainframe Computer 3. Minicomputers: i. Purpose: Minicomputers are less powerful than mainframes but still capable of handling significant data processing and applications. ii. Performance: They offer mid-range performance and are often used in scientific and industrial settings. iii. Examples: DEC PDP series and VAX series, Data General Nova. Mini Computers 35 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 4. Microcomputers (Personal Computers): i. Purpose: Microcomputers are designed for individual use and a wide range of tasks, from word processing to gaming. ii. Performance: They are generally less powerful than supercomputers, mainframes, and minicomputers but are highly versatile and accessible. iii. Examples: Desktop computers like the Apple iMac, Dell Inspiron, and laptop computers like the Lenovo ThinkPad, and home PCs. Micro Computers 4.2 Computer Hardware and Software 4.2.1 Hardware: Is the name given to all physical devices found in a computer system. All physical contents of the computer are hardware. This form is given to all electrical and mechanical devices attached to the computer for input, process, storage, and output operations. i. Primary Hardware: is the CPU and its other units i.e. circuits and ICs. ii. Secondary Hardware: is the memory or storage area of a computer. 4.2.1 Software Is a general term used for computer Programs. A computer program is a planned, step-by-step set of instructions that directs the computer on what to do and how to do it. It turns the data into information - that makes a computer useful. 36 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Generally speaking, software can be categorized as: i. Application Software ii. System Software 1. Application Softwares Application software are programs that help a user perform a specific job. For example, application software enables a user to write a letter or create a drawing. Some examples of application software include spreadsheets, database systems, desktop publishing systems, program development software, and games. Application software is generally what we think of when someone speaks of computer programs. This software is designed to solve a particular problem for users. It helps the user work faster, and more efficiently and thus provides more productivity than manual performance. Types of Application Software Application software can be grouped into two broad categories. i. General Purpose Softwares ii. Special/Specific Pursose Softwares i. General Purpose Softwares These are called package software or commercial software. A single software can be applied to a wide variety of tasks. By using such software a user can fulfill his or her general needs. General purpose software includes MS Office, Corel Draw, Page maker, Adobe Photo shop, etc. ii. Special Purpose Softwares The software that is designed to perform a specific task is known as special-purpose application software. This is also called Custom software. The Software can perform only one task for which it has been designed. Custom software for the tasks of a large organization may be extremely complex and take a lot of time to develop. For example, Software to process inventory 2. System Softwares System software acts as an interface between the hardware of the computer and the application software that users need to run on the computer. The diagram below illustrates the relationship between application software and system software. 37 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. System software falls into the following categories: i. Operating System ii. Language Translators i. Operating System Operating systems are the most important system software. An operating system is a set of programs that control and supervise the hardware of a computer and provide services to application software, programmers, and users of the computer. Without an operating system, a computer cannot do anything useful. A user cannot communicate directly with the computer hardware, so the operating system acts as an intermediary between the user of a computer and the computer hardware. The primary goal of an operating system is to make the computer convenient to use. The secondary goal is to use the computer efficiently. An operating system has the following main responsibilities: Managing Hardware Resources: The operating system manages the computer's hardware components, including the central processing unit (CPU), memory (RAM), disk drives, and peripheral devices. It allocates these resources to different programs and ensures they operate efficiently. 38 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Process Management: It oversees the execution of multiple programs or processes. This involves starting, pausing, resuming, and terminating processes to ensure they run smoothly without interfering with each other. Memory Management: The operating system manages system memory (RAM) to ensure that programs have the necessary memory to run. It allocates and deallocates memory as needed and uses techniques like virtual memory to optimize memory usage. File System Management: It handles files and directories, allowing users to create, read, write, and delete files. The operating system also manages file access permissions and organizes data on storage User Interface: The operating system provides a user interface that allows users to interact with the computer. This can be a graphical user interface (GUI) or a command-line interface (CLI). Security: It enforces security measures to protect the system from unauthorized access and data breaches. This includes user authentication, access control, and encryption. Error Handling: It detects and handles errors and exceptions, preventing system crashes and ensuring that programs continue to run in case of minor issues. Task Scheduling: The OS schedules tasks and processes to make efficient use of the CPU. It ensures Examples: Windows, Unix, Linux, Solaris, Apple, etc. ii. Language Translators The computer does not understand a programming language, because the computer only knows the machine language or binary language. A program must be translated into machine language before the machine can execute it. Software associated with programming languages includes language translators such as assemblers, interpreters, and compilers. Interpreters: o Interpreters are software programs that read, analyze, and execute high-level source code line by line. o They directly translate source code into machine code or an intermediate code and execute it immediately. o Interpreters are commonly used in languages like Python and JavaScript for fast code development, testing, and debugging. 39 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Compilers: o Compilers are software tools that translate entire high-level source code into machine code or an intermediate form before execution. o They perform an analysis and translation of the entire code at once, resulting in an executable file. o Compilers are used in languages like C and C++ to produce efficient, standalone applications. Assemblers: o Assemblers are a specific type of translator that converts low-level assembly language code into machine code. o They translate human-readable assembly instructions and symbolic names into binary code directly executable by a computer's central processing unit (CPU). o Assemblers are critical for low-level programming and hardware control, commonly used in embedded systems development and operating system kernels 4.3 Programming Languages Languages are used to communicate between different entities. Computer language makes it possible to talk to the computers and ask the computer to perform specific work. Computer language produces programs that are executed by the CPU, and then the CPU instructs all the other parts of computers to perform work accordingly. Computers only understand programs in their machine language. Machine language is the language of 0’s and 1’s. It is difficult to write programs in machine language so what is the solution to this dilemma? The answer is in what are called high-level languages i.e. Computer programming languages that look like natural language. 4.3.1 Machine Language Machine language, also known as machine code, is a low-level programming language that is directly understood and executed by a computer's central processing unit (CPU). It consists of a series of binary digits (0s and 1s) that represent individual instructions and data for the computer. Key points about machine language: i. Lowest-Level Language: Machine language is the lowest-level programming language. Each instruction corresponds to a specific operation that the computer's hardware can perform. 40 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. ii. Binary Representation: Instructions in machine language are represented in binary form, which is the native language of computers. For example, the instruction to add two numbers might be represented as a sequence of 0s and 1s that the CPU can understand. An illustration of a Machine Code 4.3.2 High-Level Languages (HLL) HLLs are programming languages that look like natural language text. Their advantages are: i. They make programming easier and more abstract, i.e. the programmer does not need to come up with detailed machine instructions ii. HLL programs are machine-independent. They can run on different hardware platforms (i.e. different computers with different instruction sets): Computer hardware can only understand machine language, therefore a high-level construct to a low- level machine language translator, or compiler, is needed. 41 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. An illustration of a compiler To run a HLL program on a specific machine, it has to be translated into its machine language. This is done through the use of a compiler. A Compiler is a program that translates a HLL program to a machine language program of a specific platform. The Machine language program produced by the compiler is usually referred to as the executable program. Hence by using the appropriate compiler, we can execute our HLL programs on any platform. Different types of high-level programming languages. Python, Java C++ etc. An illustration of Python codes 4.4 Source Program Vs. Object Program Source programs and object programs are two types of programs found in computer programming. A source program is typically a program with human-readable machine instructions written by a programmer. An object program is typically a machine executable program created by compiling a source program. 1. Source Program A source program is code written by a programmer usually using a higher-level language, which is easily readable by humans. Source programs usually contain meaningful variable names and helpful 42 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. comments to make them more readable. A source program cannot be directly executed on a machine. To execute it, the source program is compiled using a compiler (a program, which transforms source programs to executable code). 2. Object Program An object program is usually a machine executable file, which is the result of compiling a source file using a compiler. Apart from machine instructions, they may include debugging information, symbols, stack information, relocation, and profiling information. Since they contain instructions in machine code, they are not easily readable by humans. 4.5 End of Module: Laboratory Work 1. Complete: Week Two: The Operating System 2. Complete: Week Three: Application Systems 43 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 5: Module Content: The Motherboard Computer Data Representation Schemes Objectives: 5.1 The Computer Motherboard The motherboard serves as a single platform to connect all of the parts of a computer. A motherboard connects the CPU, memory, hard drives, optical drives, video cards, sound cards, and other ports and expansion cards directly or via cables. It can be considered as the backbone of a computer. 5.1.1 Description of the Motherboard The motherboard is mounted inside the case and is securely attached via small screws through pre- drilled holes. The motherboard contains ports to connect all of the internal components. It provides a single socket for the CPU whereas for memory, normally one or more slots are available. Motherboards provide ports to attach floppy drives, hard drives, and optical drives via ribbon cables. The motherboard carries fans and a special port designed for power supply. There is a peripheral card slot in front of the motherboard using which video cards, sound cards, and other expansion cards can be connected to the motherboard. On the left side, motherboards carry several ports to connect monitor, printer, mouse, keyboard, speaker, and network cables. Motherboards also provide USB ports which allow compatible devices to be connected in plug-in plug-out fashion, for example, pen drives, digital cameras, etc. 44 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. The Motherboards 45 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 5.1.2 Components of a Motherboard The computer motherboard comprises many components which include: 1. Clock Generator: is a component responsible for generating the clock signal of the system bus and front side bus clock of the motherboard. It controls the speed of components on the motherboard. 2. Cpu Socket: this is a slot into which the processor (CPU) can be inserted. 3. Memory Socket (Dimm (Dual Inline Memory Module) )Socket): This is a slot into which the RAM can be inserted. 4. Rom Bios: BIOS (Basic Input Output System) is a component that holds the startup instructions. BIOS will start to work immediately when the PC is powered on, BIOS will make the hardware ready and the IO (input-output devices) works at the initial state, Floppy disk 46 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. and CD-ROM able to read and boot, PC can detect the installed hard disk, the screen able to display, all this will help us to be able to install the Operating System or install Windows. 5. Cmos Ram: Every time the PC is powered on BIOS will use the above information, this information may be changed by the user and must retained in the memory even though the electric power is removed from the system, the memory that is used to store this information is called CMOS Ram, CMOS Ram is located on the mother board and will need the power from battery during PC powered off to retain the information. 6. Battery: the battery supplies the power to CMOS ram for CMOS ram to retain the information during the system is powered off, When the battery is weak the PC will show and inaccurate time of day clock, or show a CMOS checksum error message during boot, at this time the user-defined information in the CMOS ram may be lost, the PC may be still able to run by using the default value in the BIOS that was defined by manufacturer. 7. Chip Set: A Chipset is a set of ICs, that used to be many ICs working together to provide support to CPU and I/O ( input out device ) and make the whole system work, currently the chipset is integrated into very few large-scale ICs. 8. Expansion Slot: The expansion slot or Expansion bus is the slot that enables the user to add the adapter card for additional functions to the system for example, a Sound card or Multimedia card, LAN card, SCSI controller card, Internal Modem card, TV tuner card, Additional hard disk controller card and other special-purpose adapter card. 9. AGP Port: AGP (Accelerated Graphic Port) port is a high-speed data transfer port, this port is used by the display adapter card that demands so much data within a short time. The way the AGP port works is similar to the PCI bus, the AGP port runs at a clock speed of 66 Mhz, and within one clock cycle of AGP operation, the multiple of 32 bytes can be transferred. 10. Ide Ports: These are for connecting hard disk drives or IDE CD-ROM or IDE CD writer. 11. Floppy Disk Port: this is used to connect the Floppy disk to the motherboard. 47 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 12. IO Connector/USB Ports: used to connect peripheral devices like the keyboard, mouse, printer microphone, etc. to the motherboard. 13. Power Connector: this receives the Power supply connector from the power supply and delivers it to the motherboard 5.1.3 Features of a Motherboard i. Motherboard varies greatly in supporting various types of components. ii. Normally a motherboard supports a single type of CPU and few types of memories. iii. Video Cards, Hard disks, and Sound Cards have to be compatible with the motherboard to function properly. iv. Motherboards, cases, and power supplies must be compatible to work properly together. 5.2 Computer Data Representation Schemes Computers represent and store data in memory in bits. Common collections are single bits, groups of four bits (called nibbles), groups of eight bits (called bytes), and groups of 16 bits (called words). Bits, nibbles, bytes, words, and double words are units of data used in computing to represent and manipulate information. 1. Bit: A "bit" is the smallest unit of data in computing and digital communication. It can have one of two values: 0 or 1, representing the binary system at the most fundamental level. Bits are used to store and transmit data, as well as perform basic logical operations. A bit 48 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 2. Byte: A "byte" is a fundamental unit of data and memory storage in most computer systems. It consists of 8 bits, allowing for 256 different values (from 00000000 to 11111111) in binary. Bytes are used to represent characters, numbers, and a wide range of data types in computing. A byte 3. Nibble: A "nibble" is a group of four bits, often half of a standard 8-bit byte. It can represent 16 different values (from 0000 to 1111) in binary. Nibbles are used in various computer systems, especially in hexadecimal notation, which groups nibbles together to represent larger values efficiently. A Nibble 4. Word: The term "word" does not have a fixed size and varies depending on the computer architecture. In most modern systems, a "word" is 32 bits (4 bytes) or 64 bits (8 bytes) in length. Words are used for data processing, addressing, and memory management in the CPU. 5. Double Word (Dword): A "double word," often abbreviated as "Dword," is a data unit that is typically 32 bits or 4 bytes in length. It's twice the size of a standard word. 49 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Dwords are used in various data storage and manipulation operations in computing. The use of these units of data allows computers to represent and process information in a structured and organized manner. Bytes, words, and dwords are particularly important in memory and data processing, while bits and nibbles are essential for low-level data manipulation and communication. The specific sizes of words and dwords can vary between different computer architectures and systems. Data Representation 50 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 6: Module Content: Computer Number System Objectives: 6.1 The Computer Number System A number system in computer ideology is regarded as the method or system of numbering and representing digits in the computer's ‘inner’ system. In other words, it is a technique used in representing numbers in the computer system architecture. The digital computer represents all kinds of data and information in binary numbers. This implies every value/number that you are saving or feeding into/fetching from the computer system memory has a defined number system. The value/data feed in/fetch from can include but is not limited to audio, graphics, video, text files, numbers, etc. The total number of digits used in a number system is called its base or radix. The base is written after the number as a subscript; for instance 10001102 (1000110 bases 2), 5610 (56 to the base of 10), 718 (71 bases 8), etc. Computer architecture supports the following number of systems. i. Binary number system (Base 2) ii. Octal number system (Base 8) iii. Decimal number system (Base 10) iv. Hexadecimal number system (Base 16) 6.1.1 Binary Number System A Binary number system has only two digits, which are 0 and 1. Every number (value) is represented with 0 and 1 in this number system. The base of a binary number system is 2 because it has only two digits. Though DECIMAL (No 3) is more frequently used in Number representation, BINARY is the number system form that the system/machine accepts. 51 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 6.1.2 Octal number system The octal number system has only eight (8) digits from 0 to 7. Every number (value) is represented with 0,1,2,3,4,5,6 and 7 in this number system. The base of the octal number system is 8 because it has only 8 digits. 6.1.3 Decimal number system The decimal number system has only ten (10) digits from 0 to 9. Every number (value) is represented with 0,1,2,3,4,5,6, 7,8, and 9 in this number system. The base of a decimal number system is 10 because it has only 10 digits. 6.1.4 Hexadecimal number system A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F. Every number (value) represents 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F in this number system. The base of the hexadecimal number system is 16 because it has 16 alphanumeric values. Here, we have 0 to 9, representing 0 – 9 but from 10, we have A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15. The table above shows the sample representations : Binary 2 0,1 (11110000)2 Octal 8 0,1,2,3,4,5,6,7 (360)8 Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9, (F0)16 A,B,C,D,E,F 6.2 Number System Conversions There are three types of conversion: 1. Decimal Number System to Other Base 52 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. [for example: Decimal Number System to Binary Number System e.g. Base 10 to Base 2 etc.] 2. Other Base to Decimal Number System [for example: Binary Number System to Decimal Number System e.g. Base 2 back to Base 10 etc.] 3. Other Base to Other Base [for example: Binary Number System to Hexadecimal Number System e.g. Base 2 to Base 16 etc.] Let’s pick them one after the other to see how the computations are done and the underlying logic behind them! 6.2.1 Decimal Number System to Other Bases The under-listed are the steps/procedures: 1. Divide the Number (Decimal Number) by the base of the target base system (in which you want to convert the number to e.g. Binary (2), Octal (8) OR Hexadecimal (16)). 2. Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a Most Significant Bit (MSB); that is, write from down-up. Example 1: Convert 1234510 to Base 2 Solution 53 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Example 2. Convert 1234510 to Base 8 Solution Example 2. Convert 1234510 to Base 16 Solution 54 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 6.2.2 Other Base System to Decimal Number Base The procedures are spelled out thus: A. Determine the base value of the source Number System (that you want to convert), and also determine the position of digits from LSB (first digit’s position – 0, second digit’s position – 1, and so on). B. Multiply each digit with its corresponding multiplication of position value and Base of Source Number System’s Base. C. Add/Sum up the resulting value in step 2. Example 1: Binary to Decimal Conversion Convert 11011012 to Base 10 Solution: 55 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Example 2: Octal to Decimal Conversion Convert 538 to Base 10 Solution: Example 3: Octal to Decimal Conversion Convert 2948 to Base 10 Solution: 56 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Example 8: Hexadecimal to Decimal Conversion Convert 3F616 to Base 10 Solution: Example 9: Hexadecimal to Decimal Conversion Convert 2C4E16 to Base 10 Solution: 57 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 6.2.3 Other Base System to Decimal Number Base To execute this type of conversion, simply convert the given base to base ten, then convert to the target base. Example 1: Convert 100112 to base 8 Solution: Exercises (Not to be submitted) 1. Convert the following Base 2 numbers to Base 10: i. 11000011 ii. 1001111 iii. 01101111 2. Convert the under-listed Base 8 numbers to Base 10: i. 67 ii. 21 iii. 34 3. Convert the specified Base 16 numbers to Base 10: i. 2A5 ii.7E3D iii. 82CA 4. Convert the listed Base 10 numbers to Base 2, 8, and 16 i. 34 ii. 89 iii. 68 58 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 5. Convert: i. 1101102 to base 8 ii. 6789548 to base 16 6.3 Addition and Subtraction in Binary 6.3.1 Addition in Binary Addition is the same as in the decimal system, except, 1 + 1 = 0 with a 1 carried. Adding two binary numbers together is easy, keeping in mind the following four addition rules: 1) 0 + 0 = 0 2) 0 + 1 = 1 3) 1 + 0 = 1 4) 1 + 1 = 10 Example 1) Add, 0011010 + 111001 Exercise (Not to be submitted) Add the following 1) 10110101 + 11010101 2) 11110111 + 11000100 3) 11010001 + 11110111 6.3.2 Subtraction in Binary Example 59 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 1) Subtract 111001 from 1111001 6.3.3 Subtraction In Binary Using 2’s Complement 60 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Example 2: 1) Subtract 100100 from 11100010 using 2’s complement. So 100100 subtracted from 11100010 = 101111102 Exercise (Not to be submitted) 6.3.4 Multiplication In Binary The rules are the same as in decimal. 1) 0x0=0 2) 1x0=0 3) 1x1=1 61 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 6.3.5 Division In Binary The rules are the same as in decimal. 1) 0 ÷ 0 = 0 2) 0 ÷ 1 = 0 3) 1 ÷ 1 = 1 62 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 7: Module Content: File Processing Algorithms Flowcharts Objectives: 7.1 Basic File Processing Concepts In a computer system, a "file" is a fundamental unit used for storing and organizing data. It serves as a digital container for information, which can include text, images, documents, programs, and more. Files are crucial for managing and accessing data on a computer. Here are some key characteristics and functions of files in a computer system: 7.1.1 Operations on Files The operating system provides system calls to create, write, read, reposition, truncate, and delete files. The following sub-units discuss the specific duties a file system must do for each of the following basic file operations. 1. Creating a File When creating a file, a space in the file system must be found for the file and then an entry for the new file must be made in the directory. The directory entry records the name of the file and the location in the filesystem. 2. Opening a File Before using a file, a process must open it. The purpose of the OPEN call is to allow the system to fetch the attributes and list of secondary storage disk addresses into main memory for rapid access on subsequent calls. 3. Closing a File When all the accesses are finished, the attributes and secondary storage addresses are no longer needed, so the file should be closed to free up internal table space. Many systems encourage this by imposing a maximum number of open files on processes. 63 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 4. Writing a File To write a file, a system call is made specifying both the name of the file and the information to be written to the file. Given the name of the file, the system searches the directory to find the location of the file. The directory entry will need to store a pointer to the current block of the file (usually the beginning of the file). Using this pointer, the address of the next block can be computed where the information will be written. The write pointer must be updated ensuring successive writes that can be used to write a sequence of blocks to the file. It is also important to make sure that the file is not overwritten in case of an append operation,i.e. when we are adding a block of data at the end of an already existing file. 5. Reading a File To read a file, a system call is made that specifies the name of the file and where (in memory) the next block of the file should be put. Again, the directory is searched for the associated directory entry, and the directory will need a pointer to the next block to be read. Once the block is read, and the pointer is updated. 6. Repositioning a File When repositioning a file, the directory is searched for the appropriate entry, and the current file position is set to a given value. This file operation is also called file seek. 7. Truncating a File The user may erase some contents of a file but keep its attributes. Rather than forcing the user to delete the file and then recreate it, this operation allows all the attributes to remain unchanged, except the file size. 8. Deleting a File To delete a file, the directory is searched for the named file. Having found the associated directory entry, the space allocated to the file is released (so it can be reused by other files) and invalidates the directory entry. 9. Renaming a File 64 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. It frequently happens that the user needs to change the name of an existing file. This system call makes that possible. It is not always strictly necessary, because the file can always be copied to a new file with the new name, and the old file is then deleted. 10. Appending a File This call is a restricted form of WRITE call. It can only add data to the end of the file. Systems that provide a minimum set of system calls do not generally have APPEND, but many systems provide multiple ways of doing the same thing, and these systems sometimes have APPEND. The ten operations described comprise only the minimal set of required file operations. Others may include copying, and executing a file. Also of use are facilities to lock sections of an open file for multiprogramming access, to share sections, and even to map sections into memory or virtual-memory systems. This last function allows a part of the virtual address to be logically associated with the section of a file. Reads and writes to that memory region are then treated as reads and writes to the file. 7.2 Algorithms An algorithm is a step-by-step procedure or a set of rules for solving a specific problem or accomplishing a particular task. It provides a precise and unambiguous description of how to perform a computation or operation. An algorithm takes one or more inputs, performs a series of operations or computations, and produces an output or a result. The inputs represent the problem instance, and the output represents the solution or desired outcome Algorithms are composed of well-defined instructions or steps that are executable and can be followed by a computing device or a human. Each step specifies an action to be performed, such as arithmetic calculations, comparisons, conditionals, loops, or function calls. Algorithms must terminate after a finite number of steps. They should not run indefinitely or enter infinite loops. The algorithm's termination ensures that a solution or output is eventually obtained. An algorithm is considered correct if it produces the expected output for all valid inputs. Ensuring correctness involves rigorous testing, validation, and verification techniques. 65 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Algorithms aim to achieve efficiency in terms of time and space requirements. Time complexity refers to the amount of time an algorithm takes to run, often measured in terms of the number of operations. Space complexity refers to the amount of memory or resources an algorithm consumes. Example of an algorithm to add two numbers Now here is the python implementation with and without the use of a function 1. With function 2. Without function 66 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Quick Homework (Not to be submitted): 1. FUK CAR Parking System. This system allows only cars with a FUK sticker to park at a designated car park known as PARK 1. Stickers are categorized into senior stickers and junior stickers and are parked at marked spots labeled as S and J respectively. Cars without stickers would be registered at the gate and sent to a different car park known as PARK 2. Develop an algorithm using both of its representations to show the procedure for solving the problem. Afterward, implement in python using an IDE of your choice. 7.3 Flowchart From the algorithms, the programmer develops the flowcharts and graphic representations of the algorithms. The algorithms and the flowcharts are the final steps in organizing a solution. Using them, the programmer can test the solution for bugs and go on to code the problem into a computer language for entry into the computer. A flowchart will show errors in logic not readily visible in the other charts. Also, a set of data can be tested easily using a flowchart. Flowcharts are graphical representations or diagrams that illustrate the step-by-step flow of a process, algorithm, or system. They use various shapes, symbols, and arrows to depict the sequence of actions, decision points, inputs, outputs, and flow of control within a process. Flowcharts are commonly used in software development, business process modeling, problem-solving, and system analysis. Flowcharts provide a visual representation of a process, making it easier to understand, analyze, and communicate. They are especially useful for illustrating complex processes, decision-making logic, and the interaction between different steps or components. By following the flowchart, one can trace the flow of activities and identify potential bottlenecks, errors, or areas for improvement in a process. A flowchart shows the flow of the processing from the beginning to the end of a solution. Each block in a flowchart represents one instruction from an algorithm. Flowlines indicate the direction of the data flow. Most blocks have one or more entrances, and flowlines directing the flow of the data into the block. 67 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Most blocks have only one exit, flowlines directing the data out of the block, since, in most cases, data can flow to only one other block There are flowchart symbols for use with various types of processing. Figure XXX below shows and explains some general flowchart symbols. There are many specific symbols, such as printer output, monitor output, and so forth, that are used in system flowcharts. Figure XXX: Flowcharts Symbols 68 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Example of a flowchart from an algorithm to add two numbers Example of a flowchart from checking room temperature Quick Homework (Not to be submitted): 1. FUK CAR Parking System. 69 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. From the algorithm developed, draw the corresponding flowchart utilizing all necessary symbols discussed. 7.4 Pseudocode Pseudocode is similar to the algorithm without the numbers and somewhat condensed. Pseudocode is a high-level, informal, and human-readable description of a computer program or algorithm. It is not a specific programming language but rather a way to express the logic and structure of code using plain language and simple constructs. Pseudocode helps in planning, designing, and understanding algorithms before implementing them in a particular programming language. While pseudocode lacks strict syntax rules, it often uses common programming constructs like variables, loops, conditionals, and function calls to represent algorithmic steps. It focuses on expressing the logic and flow of an algorithm clearly and concisely. Example of a pseudocode from adding numbers In this pseudocode: The program starts with the "Start" statement. The "Read" statements prompt the user to input the values of num1 and num2. The "Set" statement calculates the sum of num1 and num2 and assigns it to the variable sum. The "Display" statement shows the value of the sum as the output. Finally, the program ends with the "End" statement. Note that this pseudocode focuses on expressing the logical steps of the algorithm in a human- readable manner. It doesn't include specific syntax or language rules since pseudocode is not 70 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. tied to a particular programming language. It serves as a blueprint for implementing the addition algorithm in any programming language later on. 71 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. Unit 8: Module Content: The Internet Objectives: 8.1 The Internet The Internet is a worldwide collection of networks that links millions of businesses, government offices, educational institutions, and individuals. Data is transferred over the Internet using servers, which are computers that manage network resources and provide centralized storage areas, and clients, which are computers that can access the contents of the storage areas. The data travels over communications lines. Each computer or device on a communications line has a numeric address called an IP (Internet protocol) address, the text version of which is called a domain name. Every time you specify a domain name, a DNS (domain name system) server translates the domain name into its associated IP address, so data can route to the correct computer. The internet is like a giant, global network of computers that are all connected. It's a bit like a massive library, but instead of books, it's filled with information, videos, pictures, and all sorts of things. You can use your computer or phone to explore this library, talk to people from all over the world, watch videos, play games, and even shop for things. It's like a magical place where you can learn, have fun, and connect with others, all from your device! 8.2 Ways to Access the Internet 1. You can access the Internet through an Internet service provider, an online service provider, or a wireless service provider. 2. An Internet service provider (ISP) provides temporary Internet connections to individuals and companies. 3. An online service provider (OSP) also supplies Internet access, in addition to a variety of special content and services. 72 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 4. A wireless service provider (WSP) provides wireless Internet access to users with wireless modems or Web-enabled handheld computers or devices. 5. Employees and students often connect to the Internet through a business or school network that connects to a service provider. For home or small business users, dial-up access provides an easy and inexpensive way to connect to the Internet. 6. With dial-up access, you use a computer, a modem, and a regular telephone line to dial into an ISP or OSP. Some home and small business users opt for newer, high-speed technologies. 7. DSL (digital subscriber line) provides high-speed connections over a regular copper telephone line. 8. A cable modem provides high-speed Internet connections through a cable television network. 8.3 Identifying A URL (Universal Resource Locator) The most widely used service on the Internet is the World Wide Web. The World Wide Web (WWW or Web) consists of a worldwide collection of electronic documents called Web pages. A browser is a software program used to access and view Web pages. Each Web page has a unique address, called a URL (Uniform Resource Locator) that tells a browser where to locate the Web page. A URL consists of a protocol, domain name, and sometimes the path to a specific Web page or location on a Web page. Most URLs begin with http://, which stands for hypertext transfer protocol, the communications standard that enables pages to transfer on the Web. Example https://fukashere.edu.ng/ Advantages of the Internet 1. Access to Information: The internet is a vast source of information on virtually any topic. It provides quick and easy access to educational resources, research materials, news, and more. 2. Communication: It enables instant communication with people worldwide through email, social media, video conferencing, and messaging apps, fostering global connections. 73 Introduction to Computing Sciences (COS 101) | Mr Isuwa J. 3. Online Learning: The internet has revolutionized education, making online courses and resources available to a global audience, promoting lifelong learning. 4. Convenience: Online shopping and e-commerce provide the convenience of purchasing goods and services from home, saving time and effort. 5. Entertainment: The internet offers a wealth of entertainment options, including streaming services, online gaming, and a variety of content platforms. 6. Business Opportunities: It has opened doors for online businesses, startups, and freelancers, creating economic opportunities and global markets. 7. Research and Collaboration: Researchers and professionals can collaborate and share data and findings, accelerating progress in various fields. 8. Social Connections: Social media platforms help people stay connected with friends and family, even across long distances. 9. Access to Services: The internet allows users to access various services, from banking and healthcare to government services and more, often 24/7. Disadvantages of the Internet 1. Cybersecurity Risks: The internet is susceptible to cyberattacks, including hacking, phishing, and malware, leading to privacy breaches and data theft. 2. Information Overload: With a vast amount of information available, it's easy to become overwhelmed, and misinformation can spread quickly. 3. Online Harassment and Bullying: The internet can be a platform for cyberbullying and harassment, negatively affecting mental health. 4. Digital Divide: Not everyone has equal access to the internet, creating a digital divide that limits opportunities for some. 5. Privacy Concerns: Personal data is often collected and used by online services and advertisers, raising privacy concerns. 6. Addiction: Internet addiction and excessive screen time can lead to health issues and affect real- world relationships. 7. Fake News: Misinformation and fake news can spread easily on the internet, potentially causing social and political unrest. 8. Loss of Productivity: While the internet offers numerous distractions, it can also lead to reduced productivity and procrastination. 74 Introduction to Computing Sciences (COS 101) |

Use Quizgecko on...
Browser
Browser