COS 101 Module 4, 5 & 6 PDF
Document Details
![FruitfulMesa](https://quizgecko.com/images/avatars/avatar-16.webp)
Uploaded by FruitfulMesa
Kwara State University
Tags
Summary
This document is a module for a computer science course, covering Machine Level Representation of Data, focusing on units of data, fundamental operations on bits, number bases, and types. Topics include bits, bytes, and measures of units of information, which helps facilitate data processing with a variety of methods.
Full Transcript
**Module4** Machine Level Representation of Data Units of Data and Fundamental Operations on Bits Number Bases and Types Representation of Non-Numeric Data, Records and Registers **Units of Data and Fundamental Operations on Bits** **1.0 Introduction** The main use of a computer is to proces...
**Module4** Machine Level Representation of Data Units of Data and Fundamental Operations on Bits Number Bases and Types Representation of Non-Numeric Data, Records and Registers **Units of Data and Fundamental Operations on Bits** **1.0 Introduction** The main use of a computer is to process data into information. Data refers to information in an unorganized and raw form. For the data to be processed, it has to be fed to the computer and then it is processed in batches. In this class, we shall be looking at the various units of data, starting from the smallest basic unit to the largest. We shall also introduce the fundamental operations that can be performed on the smallest unit of data. **1.1 Units of Information** Bits are the shortened form of the term binary digit and it represents information in two states only. The two states are zeros and ones (0 and 1). The 0 represents OFF or LOW states while the 1 represents ON or HIGH states. The two states can be likened to light in a room with two options only, the lights can be ON or OFF with no state in between. Two important factors of a bit are its duration and the difference in voltage levels between the 0 and the 1. Example 1: Figure showing a string of bits 10110 In example 1 is displayed a string of 5 bits. A +5v was used to represent the ON state (1) and 0v used for the OFF state (0). This is not fixed, and can be +5v for 1 and -5v for 0, +10v for 1 and +5v for 0. The duration of each bit in the example will depend on the duration of the pulse. If the pulse lasted for 10 seconds, the each bit will have a duration of 10/5 = 2 seconds. A group of eight bits put together is referred to as a byte. The amount of information contained increases as the number of bits increases. This is because each of the bits can be either LOW or HIGH and the different sequences of ONs and OFFs can be used to convey information. 8 bits put together can be used to represent the various characters in most languages, and this was then adopted to be 1 byte. Bits is usually represented with a lower case letter 'b', while the upper case later 'B' is used to represent a byte. Example 2: Figure showing one byte: 10110010 A computer has the capability to process large amount of data at a time. Feeding just 8 bits (1 byte) to a computer to process at a time is a waste of processing power. Just like tying a small bucket to a horse to pull. The number of bits a particular computer can process at a particular time is referred to as word. For example in a 32-bit computer, the word length is 32 bits and such a computer can address 32 memory locations for processing at a particular point of time. Other examples of word lengths are 64bits, 16bits etc. **1.2 Measures of Units of Information** Computers can process and store large amount of data and information. As such terms are used to refer to this large aggregate amount of bits or bytes. Table 1.1 shows the various units of information you need to comprehend. **Name** **Representation** **No of bits** **No of Bytes** ----------- -------------------- ------------------------------- ------------------------------------- 1kilobits 1kb 2^10^ = 1,024 1024/8 = 128 1megabit 1mb 2^20^ = 1,048,576 1048576/8 = 131,072 1gigabit 1gb 2^30^ = 1,073,741,824 1073741824/8 = 134,217,728 1terabit 1tb 2^40^ = 1,099,511,627,776 1099511627776/8 = 137,438,953,472 1Kilobyte 1KB 8 x 2^10^ = 8,192 8192/8 = 1,024 1Megabyte 1MB 8 x 2^20^ = 8,388,608 8388608/8 = 1,048,576 1Gigabyte 1GB 8 x 2^30^ = 8,589,934,592 8589934592/8 = 1,073,741,824 1Terabyte 1TB 8 x 2^40^ = 8,796,093,022,208 8796093022208/8 = 1,099,511,627,776 Table 1: The different units of information It is pertinent that you can comfortably transform one unit to the other. **Example 3:** Find the number of bytes in 7mb. To do this you will need to first find the number of bits in 7mb, which is 7 x 2^20^ = 7340032 bits. You then divide by 8 to find the number of bytes as 1 byte = 8 bits. Therefore, number of bits in 7mb = 7340032/8 = 917504 bytes. **Example 4:** A computer network has a download speed of 1MBps. What is the speed in mbps? Remember that B is for Bytes while b is used to represent bits. The given speed is therefore 1 Megabytes per second, and you are required to find the speed in megabits per seconds. Since 1 bytes is equivalent to 8 bits, 1MB = 8mb. Therefore the computer download speed of 1MBps is equivalent to 8mbps. **1.3 Basic Operations on Bits** During processing, a computer manipulates the bits to give a desired result. This manipulation can be a complex process comprising of basic simple operations on the bits. In this section, you will learn how to carry out basic operations of addition, subtraction, division, multiplication of bits and logical operations on bits. **Addition of Bits** The addition of bits is similar to the addition of decimal numbers, just that a 2 is treated as a 10, and 1 added to the next bit on the left. The steps you will follow to add to bits together are outlined: Step 1: Align the bits to be added to the right Step 2: Start by adding the bits to the far right column Step 3: Add the bits in each column together, using the rule (1+0 = 1, 0+0 = 0, 1+1=0 add 1 to the next column) Binary addition Binary no 1 Binary no 2 Addition Carry ------------- ------------- ---------- ------- 0 0 0 0 1 0 1 0 0 1 1 0 1 1 0 1 Example 5: Add this two bits 10010010~2~ and 11010111~2~ 10010010 \+ 101101001~2~ Example 6: Find the sum of these bits 10111001~2~,110101~2~, 10110~2~ 10111001 -1^st^ Bits \+ -2^nd^ Bits 11101110 -Sum of 1^st^ and 2^nd^ Bits \+ -3^rd^ Bits 100000100~2~ -Sum of 1^st^, 2^nd^ and 3^rd^ Bits **Subtraction of Bits** The subtraction of bits is achieved by adding the 2's complement the number to be subtracted to the other bit. The procedure for obtaining the 2's complement is: Turn all the 0 to 1, and the 1 to 0, Add 1 to the last bit on the right. After getting the complement, add to the other binary, but ignore any overflow bit. Overflow bit is the extra bit to the left after the addition. Binary subtraction Binary no 1 Binary no 2 Subtraction Borrow ------------- ------------- ------------- -------- 0 0 0 0 1 0 1 0 0 1 1 1 1 1 0 0 Example 7: Find 1100 -- 1001 Step 1: Find the 2's complement of 1001. Flipping all bits gives 0110 Step 2: Adding 1100 to the complement 0110. 1100 \+ 0010 0011 **Recall:** if there is a carry add the carry to the least significant bit Therefore 1100 -- 1001 = 0011. Example 8: Find 11001 -- 1110 Step 1: Find the 2's complement of 01110. Note that it was padded with a 0 to make it equal in length to 11001. Flipping all bits gives 10001 Step 2: Adding 11001 to the complement 10001. 11001 \+ 01010 [ ] 01011 **Recall:** if there is a carry add the carry to the least significant bit The last bit to the left is the overflow bit, which is ignored after the addition. Therefore 11001 -- 1110 = 1011. It can observed that the bit after the overflow bit in the two examples are 0. This indicates that the result is a positive number. If it is 1, then the result is a negative number. The following example demonstrates this result of getting a negative result. Example 9: Find 10010 -- 11001. Step 1: Find the 1's complement of 11001. Flipping all bits gives 00110 Step 2: Adding 10010 to the complement 00110. 10010 11000 Step 3 : Since the resultant does not have a carry then flip the resultant and add a negative sign(i.e find the 1's complement of the result which gives -00111 so final answer 10010-11001=-00111 **Division of Bits** The division of bits is done by a series of subtractions of the divisor from the dividend, noting the remainder which is added to the other bits of the dividend. To achieve this, the following steps should be followed: Step 1: Align the non-zero most significant bits of the divisor and the dividend. Step 2: Subtract the divisor from the most significant bits of the dividend Step 3: if a borrow was needed, then the quotient/result is 1, and is 0 if no borrow was needed. Step 4: If a borrow was needed in step 4, add the divisor to the result of the subtraction to restore the dividend and drop the next significant bit. If no borrow was needed in the subtraction, just drop the next most significant bit to the result of the subtraction. Step 5: Repeat steps 2 -- 4 until all the bits of the dividend have been dropped down and the divisor subtracted and the quotient updated. The quotient and remainder after the last bit is dropped is returned as the result of the division. Example: find 01111100 / 0010 Here the dividend is 01111100 and the divisor is 0010 Remove the zero's in the most significant bit in both the dividend and divisor that doesn't change the value of the number 111110 10 1111100 10 11 10 **11** **10** **11** **10** **10** **10** **0** **Multiplication of Bits** The multiplication of binary number can be achieved by a series of shifting and addition. This can be achieved by following these steps Step 1: The numbers to multiplied are aligned to the left Step 2: The first bit to the left of the second number is used to multiply through all the bits of the first number. Here 1 x 0 = 0, 0 x 1 = 0, 1 x 1 = 1. Step 3: You then multiply the second bit of the second number through all the bits of the first, shift the result one bit to the right, and place below the result of step 1. Step 4: Keep multiplying through until all the bits of the second number have multiplied the bits of the first number. Step 5: Sum together the results of the multiplication of each bits Binary multiplication Binary no 1 Binary no 2 multiplication ------------- ------------- ---------------- 0 0 0 1 0 0 0 1 0 1 1 1 Example: Multiply 101101 x 10101 101101 X 101101 000000 101101 000000 \+ [101101 ] 1110110001 **Number Bases and Types** **1.0 Introduction** In the previous unit, the bit was introduced to be the shortened form of the binary digit that can exist is two states, 1 and 0. This can be referred to as a base two number. The base of a number refers to the number of numerals or states that the number can contain. The common bases that are used to represent data to the computer system are the base 2 (binary), base 10 (decimal) and base 16 (hexadecimal). This unit will be focusing on the binary, decimal and hexadecimal number bases and the types of numbers. **1.1 Binary Numbers (Base two)** As previously explained, a base two number can only exist in two states, 0 and 1. Each of the numeral is referred to as a bit. Series of bits put together to represents data that have more than two states. Table 2.0 shows a string of four bits (known as a nibble, half of a byte) and the decimal equivalent of the various states. **State** **Binary** **Decimal Equivalent** ----------- ------------ ------------------------ 1 0000 0 2 0001 1 3 0010 2 4 0011 3 5 0100 4 6 0101 5 7 0110 6 8 0111 7 9 1000 8 10 1001 9 11 1010 10 12 1011 11 13 1100 12 14 1101 13 15 1110 14 16 1111 15 A string of 4 bits can be used to represent 16 states of information to the computer system. This is from the fact that 2^3^ = 16. The base is raised to power 3 because counting the number of bits from 0 (for the least significant bit) to 3 for the most significant bit. As such each bit in base two have a value that depends on its position in the binary stream. **Power of Base** 3 2 1 0 **Decimal Equivalent** ------------------- --- --- --- --- -------------------------------------------- **Binary Number** 1 1 1 1 1 x 2^3^+ 1 x 2^2^+1 x 2^1^+ 1 x 2^0^ = 15 1 0 1 0 1 x 2^3^+ 0 x 2^2^+1 x 2^1^+ 0 x 2^0^ = 10 0 1 1 0 0 x 2^3^+ 1 x 2^2^+1 x 2^1^+ 0 x 2^0^ = 6 As table 2.1 shows, conversion of binary numbers to decimal numbers involves numbering the bits from 0 for the least significant to most significant. The value of the bit is then used to multiply the base raised to power of the base. The higher the number of bits in the system, the greater the amount of states and then data that can be fed into the computer, processed and stored. Example: Convert 11001010 to a decimal. How many states of information can a byte contain? In the solution, a conversion table is filled and worked out **Power of Base** 7 6 5 4 3 2 1 0 **Decimal Equivalent** ------------------- --- --- --- --- --- --- --- --- ------------------------------------------------------------------------------------- **Binary Number** 1 1 0 0 1 0 1 0 1 x 2^7^+ 1 x 2^6^+0 x 2^5^+ 0 x 2^4^ + 1 x 2^3^+ 0 x 2^2^+1 x 2^1^+ 1 x 2^0^ = 203 For the number of states, all the bits are set to 1, that is 11111111 and when converted to decimal gives 255, but 1 is added to the 255 to compensate for the 0 state to give 256 states. **1.2 Decimal Numbers (Base 10)** Decimal numbers are the most common base that are used to represent data input to computers and the output of processing are usually in decimals. This base has ten states/numerals ranging from 0 to 9. The position of the numeral also determines its value. The position 0 is referred to as unit, position 1 as tens, 2 as hundreds, 3 as thousands. For example the number 529 has 9 units, 2 tens and 5 hundreds all added together. Since this base is quite common, much explanations will not be necessary, but the conversion of base 10 to base 2 will be concentrated upon. The conversion of a base 10 to base 2 involves series of division of the base 10 number by 2, recording the remainders from bottom to top yields the base 2 number. As an example, let's work out the conversion of 105~10~ to base 2. Divide Remainder 2 105 --- ----- --- 2 52 1 2 26 0 2 13 0 2 6 1 2 3 0 2 1 1 0 1 Reading the remainders upwards as shown by the arrow give 1101001~2~ as the solution. **1.3 Hexadecimal Numbers (base 16)** Hexadecimal numbers have 16 different states/numerals. It uses a combination of the first ten numerals of the decimal numbers and the first six alphabets. This shown in table 2.3 **State** **Hexadecimal** **Decimal Equivalent** **Binary Equivalent** ----------- ----------------- ------------------------ ----------------------- 1 0 0 0000 2 1 1 0001 3 2 2 0010 4 3 3 0011 5 4 4 0100 6 5 5 0101 7 6 6 0110 8 7 7 0111 9 8 8 1000 10 9 9 1001 11 A 10 1010 12 B 11 1011 13 C 12 1100 14 D 13 1101 15 E 14 1110 16 F 15 1111 A prefix of 0x before a number shows it is a hexadecimal number e.g. 0x3A7. The conversion of a binary number to hexadecimal involves dividing the binary number into a section of four bits and each nibble (4 bits stream) converted to its hexadecimal equivalent using table 2.4. For example a conversion of 11010011100100101011 to hex will involve the following Step 1: Segment the bit stream to 4 bits 1101 0011 1001 0010 1011 ---------------------------------------------- --------- ------ ------ ------ ------ Step 2: Convert each bit to Hex D 3 9 2 B Step 3: Join the hex together with 0x prefix 0xD392B Conversion to decimal will involve a numbering all the numerals, starting from 0 for the least significant bit. As an example table 2.4 shows the conversion of 0xD392B to decimal. **Power of Base** 4 3 2 1 0 **Decimal Equivalent** ------------------- --- --- --- --- --- ------------------------------------------------------------------------ **Binary Number** D 3 9 2 B D(13) x 16^4^ + 3 x 16^3^+ 9 x 16^2^+2 x 16^1^+ B(11) x 16^0^ = 866603 The conversion of decimal to hexadecimal, just like the conversion from decimal to binary, involves series of division (this time by 16) and remainders written from the last to the first gives the hexadecimal number. For example conversion of 734593 to hex is: Divide Remainder 16 734593 ---- -------- -------- 16 45912 1 16 2869 8 16 179 5 16 11 3 0 11 (B) From the table, 734593~10~ = 0xB3581. **1.4 Integers and Floating Point Numbers** There are a lot of different types of numbers and each is different from another, yet they may share some common characteristics. To help keep track of and understand the similarities and differences between numbers, mathematicians have developed a grouping system that categorizes and describes numbers based on their characteristics. Some of the most common groups in the system are: Natural numbers, Whole numbers, Integers, Rationals, Real numbers **Integers** An integer is a whole number (is not a fractional number) that can be positive, negative, or zero. Examples of integers are: -6, 2, 8, -95, and 2015. Examples of numbers that are not integers are: -2.37, 5/7, 3.142,.07, and 45.1. The set of integers, denoted ***Z***, is formally defined as follows: ***Z*** = {\..., -3, -2, -1, 0, 1, 2, 3 \...}. Integers are represented in computers using two notations: two's complement notation and the excess notation, both of which are based on binary numbers. In the two's notation, a fixed number of bits are used to represent the integers. The number of bits used determines the range of integers that the notation can represent. Today's computers use 32 bits to represent integers, but we shall be using a 4 bit system to explain how it works. The most significant bit (that is the rightmost bit is used to represent the sign of the number, a 0 is used to represent positive, while a 1 depicts a negative. The procedure for obtaining the 2's complement of a positive number is: First to get its binary equivalent, secondly flip all the bits (convert all the 0 to 1, and the 1 to 0) and finally add 1 to the last bit on the right. **Bit pattern** **Value represented** ----------------- ----------------------- 0111 7 0110 6 0101 5 0100 4 0011 3 0010 2 0001 1 0000 0 1111 -1 1110 -2 1101 -3 1100 -4 1011 -5 1010 -6 1001 -7 1000 -8 A four bit system can only represent the integers from +7 to -8, this is why todays computers use more bits to represent integers. For example, find how a computer would represent a -14 using its two's complement. Step 1: Obtain the binary equivalent of 14, this is 1101 Step 2: Add the sign bit, 01101 (it is zero for the positive 14) Step 3: Flip all the bits, this results in 10010 Step 4: Add 1 to the last bit, this results in 10011. Therefore the two's complement representation for -14 is 10011. To represent -14, a minimum of five bits is required. Integers can be represented also using another method known as the excess notation. To get this notation system, the bit pattern length to be used is identified and the different binary bit pattern listed from 0000.... Upwards. We then identify the point where the most significant bit changes sign, and assign 0 to that point. All bit patterns upwards of that point is positive, while those below represents negative integers. Table 2.7 shows a four bit length used to represent integers using the excess notation, the shaded portion represents the part with 1 as the most significant bit and therefore representing the positive integers. Excess Notation Integer Represented ----------------- --------------------- 1111 7 1110 6 1101 5 1100 4 1011 3 1010 2 1001 1 1000 0 0111 -1 0110 -2 0101 -3 0100 -4 0011 -5 0010 -6 0001 -7 0000 -8 **Floating Point Numbers** Floating point numbers refers to numbers that are not whole, but contain a part that is less than one (a fractional part). There is usually a decimal point between the part of the number greater than one and the part that is less. These numbers are represented to the computer in a form called floating point notation. The highest order bit is designated as the sign bit, a zero in this bit signifies a positive number, while a 1 is used to represent a negative number. The remaining bit is divided into two parts, the exponent (used to hold the part greater than one) and the mantissa (which holds the part less than one). For example, in an eight bit system, the first bit is used as a sign bit, the next 3 are the exponent and the last four used to hold the mantissa. For example, if a floating point notation contains 01011101, what is the binary number represented? What is the decimal equivalent of the notation? Break up the given bit stream to the three segments Sign Bit Exponent Mantissa ---------- ---------- ---------- 0 101 1101 The given stream represents a positive bit stream of 101.1101. To obtain the decimal equivalent, a conversion to decimal using the table below is necessary Sign bit Exponent Mantissa -------------------- ---------- ------------------------------------------------------------------------------------- ---------- --- ---- ---- ---- ---- Binary Number 0 1 0 1 1 1 0 1 Power of Base 2 1 0 -1 -2 -3 -4 Decimal Equivalent \+ 1 x 2^2^+ 0 x 2^1^+1 x 2^0^+ 1 x 2^-1^ + 1 x 2^-2^ + 0 x 2^-3^ + 1 x 2^-4^ = 5.8125 Therefore the bit stream 101.1101 represents 5.8125. The representation in the binary notation can introduce error into the system due to the limited number of bits used to hold both the exponent and the mantissa. This error is known as truncation error or round-off error. This error is reduced by using more bits to represent the mantissa field and in today's computers use at least 32 bits for storing values in the floating point notation instead of the 8 bits used in the examples. **Representation of Non-Numeric Data, Records and Registers** **1.0 Introduction** In the previous unit, number bases were introduced to be the number of numerals or states that the number can contain. The common bases that are used to represent data to the computer system are the base 2 (binary), base 10 (decimal) and base 16 (hexadecimal). This unit will be focusing on the representation of non-numeric data such as alphabets and special characters, and also records and registers will be introduced. **1.1 Representation of Non-numeric Data** Non-numeric data refers data that are not numbers and cannot be arranged sequentially based on their values. These cannot be added nor subtracted like numeric data and examples include alphabets, special characters, images and sound. The number bases explained earlier can be used to represent numeric data to computers, but the representation of non-numeric data makes use of a coded format. The coded format used for each type is different and can be varied. This unit will focus on the representation of alphabets and special characters. The American National Standards Institute (ANSI) can up with the American Standard Code for Information Interchange (ASCII) which have been adopted widely and used to code the representation of sletters. In this code seven bits are used to represent the upper and lower case alphabets, punctuation marks and other control functions on the keyboard such as the carriage return, tabs and backspace. Show in Table 3.1 is the ASCII representation for alphabets and special characters. From the sequence shown, the codes for the English letters are in the same sequence as their lexical order. As such the codes for alphabets can be determined if the codes for the lower and upper case of 'A' are known. C:\\Users\\Michael\\Documents\\Standard-ASCII-Table.jpg Table 3.1: Table of ASCII Codes Example: What will be the ASCII code (in binary) to represent CODeL! From the table, you can obtain the decimal code for each of the characters of the word CODel! Then convert each of the decimal code to binary. Note that the case of the letter matters as upper case codes defers from lower case codes. Letter C O D E l ! --------- --------- --------- --------- --------- --------- --------- Decimal 67 79 68 101 108 33 Binary 1000011 1001111 1000100 1100101 1101100 0100001 Therefore the ASCII code for CODel!is100001110011111000100110010111011000100001. The ASCII code is limited in the number of bits used in the coding. As such cannot be used to represent the alphabets of languages that have a large number of alphabets such as Chinese and Japanese. A more recent oding system known as the Unicode have been developed by leading computer manufacturers which uses 16 bits to represent each symbol, resulting in 65,536 unique different pattern that can handle languages with large number of alphabets. The International Organization for Standardization have also developed a code format that uses 32 bits for its encoding. This will be able to represent billions of different symbols. **1.2 Computer Records and Registers** Generally, a record is a combination of various [data](http://www.webopedia.com/TERM/D/data.html) [objects](http://www.webopedia.com/TERM/O/object.html) such as some [integers](http://www.webopedia.com/TERM/I/integer.html), [floating-point number](http://www.webopedia.com/TERM/F/floating_point_number.html)s, and [character string](http://www.webopedia.com/TERM/C/character_string.html)s that are arranged for processing by a program. A file contains multiple records and can also be referred to as a data set. The programming language and/or the application used determines the organization of data in the record. Typically, records can be of fixed-length or be of variable length with the length information contained within the record. A register is a memory that is built into the central processing unit to speed up its operations by providing access to commonly used values. They are usually of small value and can be accessed very quickly. They are made of semiconductor devices whose contents can be read and written to at extremely high speeds but the contents are held only temporarily, usually while in use or only as long as the power supply is on. Registers are the fastest way for the system to manipulate data and are at the top of the memory hierarchy. Registers are normally measured by the number of bits they can contain. Examples include an 8-bit register (can store 8 bits of data), a 32-bit register (can store 32 bit of data). There are basically two kinds of registers, a set of 32 registers that is accessible to a programmer (known as the General Purpose Registers) and another set of 6 registers not accessible to programmers that is used in interpreting and executing instructions. Data and instructions must be put into the system. So we need registers for this. The basic computer registers with their names, size (for an 8085 microprocessor) and functions are listed below, the size indicate can vary depending on the processor in questsion. +-----------------+-----------------+-----------------+-----------------+ | **Register Sy | | | | | mbol** **Regi | | | | | ster Name** | | | | | **Number of B | | | | | its** **Descr | | | | | iption** | | | | | ------------- | | | | | -------- ------ | | | | | --------------- | | | | | - ------------- | | | | | ------- ------- | | | | | --------------- | | | | | --------------- | | | | | --------------- | | | | | --------------- | | | | | --------------- | | | | | --------- | | | | | AC | | | | | Accumu | | | | | lator | | | | | 16 | | | | | One of | | | | | the Processor R | | | | | egister that ho | | | | | lds operands an | | | | | d the result of | | | | | arithmetic ope | | | | | rations | | | | | DR | | | | | Data R | | | | | egister | | | | | 16 | | | | | Hold me | | | | | mory data | | | | | TR | | | | | Tempor | | | | | ary Register | | | | | 16 | | | | | Holds t | | | | | emporary Data | | | | | IR | | | | | Instru | | | | | ction Register | | | | | 16 | | | | | Holds t | | | | | he current inst | | | | | ruction code be | | | | | ing execute | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AR | | | | | Addres | | | | | s Register | | | | | 12 | | | | | Holds m | | | | | emory address | | | | | PC | | | | | Progra | | | | | m Counter | | | | | 12 | | | | | Holds a | | | | | ddress of next | | | | | instruction, af | | | | | ter executing t | | | | | he current inst | | | | | ruction | | | | | INPR | | | | | Input | | | | | Register | | | | | 8 | | | | | Holds I | | | | | nput data | | | | | OUTR | | | | | Output | | | | | Register | | | | | 8 | | | | | Holds O | | | | | utput data | | | | +=================+=================+=================+=================+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ | | | | | +-----------------+-----------------+-----------------+-----------------+ **MODULE 5** **INTRODUCTION TO THE INTERNET** **APPLICATION OF INTERNET** **IMPACT OF THE INTERNET** **Unit 1: Introduction to the Internet** **1.0 Introduction** Imagine being the desk officer of KWASU CODeL(congregational delegation led by a member of congress) and you need to monitor the activities of other representative of the unit in various part of the country so as to know the details of the number of people who came to inquire about the activities of the unit, those who show interest in one activity or the other and the number of people who have officially registered as students in a program undertaken by the unit, by the various representatives of the unit. A possible solution is for the desk officer to visit the various representatives of the units at their various locations so as to obtain that information which may be tasking, tedious and time consuming. An alternative solution is to connect the various representatives' computers at different locations together through a network which allows them to communicate, share resources and information. This will facilitate you (the desk officer) to have access to all those information from your seat enhancing your productivity. Wow! Imagine how great that would be. You are worried that what is a network and how can it be established. You will find out in a short while. **What is a Network?** A network is a group of computers connected together\--wired or wireless\--by some special protocols so that they can communicate, share resources and enhance productivity. In a typical network, there are usually one or more dedicated computers that work as servers in storing, processing and routing data/information to other computers in the network. I.e. it provides services to other computers or clients in the network. Figure 1 illustrates the structure and interconnection of computers to form a network. It comprises of three computers named computer A, B and C respectively which are connected together via wired to a central server so as to communicate, exchange file, video, voice and data and also shared resources like the central copier and printer which any computer in the network can send documents to print. Figure1: An Illustration of a Typical Network **1.2 Types of Networks** Networks can be classified into four (4) main types based on their geographical coverage areas, equipment installation cost, as well as support tools and cost. The four types of networks are: i. **Local Area Network:** LAN is a computer network widely used for local communication. LAN connects computers in a small area like a room, building, office or a campus spread up to a few kilometers. They are privately owned networks, with a purpose to share resources and to exchange information. The computers in a LAN are generally connected using cables. LAN is different from other types of network since they share the network. The different computers connected to a LAN take turns to send data packets over the cables connecting them. This requires coordination of the use of the network. Some of the transmission protocols used in LAN are Ethernet, Token bus, and FDDI (Fiber distributed data interface) ring Star, Bus, and Ring are some of the common LAN networking topologies. LAN runs at a speed of 10 Mbps to 100 Mbps and has low delays. A LAN based on WiFi wireless network technology is called Wireless Local Area Network (WLAN). ii. **Campus Area Network:** this is a network that connects multiple local area networks. This type of network is larger than the LANs but smaller than the metropolitan area network. Example of such network is the type of network found in a university (KWASU ) which connects many LANs found in various schools and units together. It is abbreviated as CANs and requires more sophisticated equipment and cost to set up and maintain when compared to LAN. iii. **Metropolitan Area Network:** this is abbreviated as MAN, it is a high speed network that is larger than CAN and connects many LANs in a large and densely populated urban area to the internet. iv. **Wide Area Network:** this is a type of network that connects many LANs over very large group of cities through the internet or over the public switched telephone network. The MANs and WANs required more sophisticated networking equipment and cost to set-up and maintain. In addition, it requires on-site administrator and support staff. Having discussed what a network is and the different types of network, I know you kept wondering that what are the importance or benefits of this so called networks and what an internet means. You need not worry, sit back and continue to read through this unit as you will find out soon yourself. **NETWORK TOPOLOGIES** There are different types of network topologies that are used in a network. The network topologies in the structure or the layout of the different devices and computers connected to the network. The topologies commonly used in LAN are---Bus topology, Star topology, and Ring topology. **Bus Topology** ![C:\\Users\\user\\Pictures\\bus topology.png](media/image5.png) - All devices on the network are connected through a central cable called a **Bus**. - The data signal is available to all computers connected to the bus. - The point where a device connects to the central communication channel is referred to as **Node** - The data signal carries the address of the destination computer. - Each computer on the network checks the destination address as the data signal travels through the bus. The computer whose address matches makes a copy of the signal and converts it into data. The data signal on the bus does not get destroyed and still transmits along the bus, and is finally absorbed by the terminator attached to the end of the network. - Bus topology commonly makes use of Coaxial cable. - It is good for connecting 15--20 computers. - A single coaxial cable is generally used in bus topology, to which the computers or devices are connected. - Ethernet is a commonly used protocol in networks connected by bus topology. - Termination in bus topology simply means matching impedance at the end of the cable, which means two ends, the section which is also referred to has **segments** - Terminator is used to prevent signal reflection in bus topology which is found at both ends. - Hub helps to manage data flow in bus topology. **Advantages of Bus Topology** - Easy to implement(computers are connected linearly through the cable) - Easily extendable(new devices can be easily added) - Not very expensive **Disadvantages of Bus Topology** - If the cable gets damaged, the whole network collapses - A computer can transmit data only if network is not been utilized - Network slows down if additional computers are connected to the network. - Single point of failure. **Ring Topology** C:\\Users\\user\\Pictures\\ring topology.png - All devices in the network are connected in the form of a ring. - Each device has a receiver and transmitter to receive the data signals and to send them to the next computer, respectively. - Ring network does not have terminated ends, thus data signals travel in a circle. - Ring topology uses token passing method to provide access to the devices in the network. - The computers or devices are connected to the ring using fiber optic cable. - The protocols used to implement ring topology are Token passing and Fiber Distributed Data Interface (FDDI)s **Advantages of Ring Topology** - All computers in the ring have equal access to the ring - Each computer in the ring gets an opportunity to transmit data **Disadvantages of Ring Topology** - Adding or removing devices is difficult and affects the complete network - Failure in a node or the cable breaks down the ring and thus the network - The length of the ring and the number of nodes are limited. **Star Topology** ![C:\\Users\\user\\Pictures\\Star topology.png](media/image7.png) All devices are connected through a central link forming a star-like structure. The central link is a hub or switch. The computers commonly makes use of twisted pair cables for connection to the hub or switch. Star topology is the most popular topology to connect computer and devices in network, which is suitable for large networks with high traffic and data transmission requirement. The data signal is transmitted from the source computer to the destination computer via the hub or switch. i.e. it controls data flow. The common protocols used in star topology are Ethernet, Token Ring, and Local Talk. In addition to the bus, ring, and star topologies, there are complex topologies like the tree topology, and the mesh topology used for networking in LAN. - Note: when more devices are added to the network it decreases its performance. **Advantages of Star Topology** - Failure of a device attached to the network does not halt the complete network; only that device is down - Easily extendable -- by attaching a new device to the hub or switch - No disturbance when a new device is added or removed. - Easy to troubleshoot the network. - It is more resilient to cable fault and provides better reliability. **Disadvantages of Star Topology** - It is costly(higher cost) since each device on the network is attached by a single cable to the central link - Failure of the hub or switch breaks the complete network The International Standards Organization (ISO)in year 1984 has developed a seven-layer reference model for data networks, known as Open System Interconnection (OSI) model. The OSI model specifies the functions of each layer. It does not specify how the protocol needs to be implemented. It is independent of the underlying architecture of the system and is thus an open system. The seven layers of the OSI model are---(1) Physical layer, (2) Data link layer, (3) Network layer, (4) Transport layer, (5) Session layer, (6) Presentation layer, and (7) Application layer. The functions of the different layers are as follow Highest level s Lowest level **Physical Layer**---This layer specifies the basic network hardware. Some of the characteristics defined in the specification are---interface between transmission media and device, encoding of bits, bit rate, error detection parameters, network topology, and the mode of transmission (duplex, half-duplex or simplex). **Data Link Layer**---This layer specifies the functions required for node-to-node transmission without errors. It specifies the organization of data into frames, error detection in frames during transmission, and how to transmit frames over a network. **Network Layer**---The network layer specifies the assignment of addresses (address structure, length of address etc.) to the packets and forwarding of packets to the destination i.e. routing. **Transport Layer**---It specifies the details to handle reliable transfer of data. It handles end-to-end error control and flow control, breaking up data into frames and reassembling the frames. **Session Layer**---The session layer maintains a session between the communicating devices. It includes specifications for password and authentication, and maintaining synchronization between the sender and the receiver. **Presentation Layer---**This layer specifies the presentation and representation of data. Its functions include translation of the representation of the data into an identifiable format at the receiver end, encryption, and decryption of data etc. **Application Layer**---This layer specifies how an application uses a network. It deals with the services attached to the data. It contains the protocols used by users like HTTP, protocol for file transfer and electronic mail. **1.3 Importance of Networking** i. Facilitate data resource sharing: with the advent of computer networks, it makes information sharing between computers users on the network easy. Hence, making working together easy for network users and enhancing personal and collective productivity. ii. Enable users to share hardware resources: networking computers enables users to share hardware resources such as printers, copier and scanners. All users within the network can access these resources. iii. Sharing a high-speed Internet connection: all computers connected in a network can share high speed internet in communicating with other computers within the network and also connect to other outside networks via the internet. iv. Networks serve as a communication and support tools: computer networks serve as a communication tool in exchanging files and other information via the network. An example of such is the electronic mail (e-mail) **1.0 What is the Internet?** The internet can simply be defined as a network of networks using a common set of rules that govern the transfer of information and communication over the network known as Internet protocol (IP). The internet give you access to numerous information, files, voice and videos all over the world. A good illustration of the importance of the internet is you accessing this course material titled \"Introduction to Computing\" written for CODeL online irrespective of your location or receiving lecture online just by logging in to the internet and accessing the unit website wherein you then log in with your username and password. **1.1 History of Networking and the Internet** The origin of networking concept was dated as far back as 1962, when the concept of galactic network was proposed for social interaction by J.C.R Licklider of MIT who was also the first head of research computer program at Defense Advanced Research Projects Agency (DARPA), though then known as the Advanced Research Projects Agency (ARPA). The first major landmark towards networking computer was done in 1965 when computers were made to talk together by connecting a TX-2 computer in Mass to Q-32 in California which marks the first ever wide area network built using a telephone line but with a low speed dial-up. He proceeded to further explore this network concept by proposing the ARPANET in 1967 which, theoretically, connections would not be lost even in the failure or absence of one or more of the network components. In 1969, ARPANET has metamorphosed as a network of four computer making it the first ever internet built by the US department of defense. However, ARPANET first public demonstration took place at international conference on computer communications in 1972. The US internet supported about 11,000 servers in 1987 when they joined their Canadian counterpart. This figure increased drastically to about 200,000 servers by the end of 1989. Most countries\' individual networks were linked together to form one worldwide network of networks by early 1990s and over 1million servers were on the internet as at the end of the year 1992. As of today no one can predict the exact figure of how many computers and network users are on the internet that reflects how large the internet has become. However, it was estimated that over one (1) billion users and 500 million computers are on the internet. The internet today serves as the largest avenue for information sharing, business, entertainment and social networking. **REQUIREMENT FOR INTERNET CONNECTION** 1. A powerful computer machine 2. Windows operating system(I.e. any of the MS Windows versions ranging from windows 95 and above) 3. The Ram size of the window memory must be big 4. A large space must also be available on the Hard Disk. 5. A modem is also required to connect to the internet 6. A compatible pointing-device i.e. mouse to make operations easier. 7. An internet service provider (ISP) is also required. 8. A telephone line is necessary if the connection is meant to be on-line. **1.2 BASIC KEY WORDS IN INTERNET** **WWW**: This is an acronym for World Wide Web. It creates an access for information all over the globe. **WEB**: This is a part of a large group of connected computer called the internet; it enables people to see document in a richly formatted text and graphics. Web page is interesting to operate due to the fact that it contains hyperlinks.it is called links because the net already has plenty of hyperlinks. Web comes in varieties of forms, texts, videos and pages that enhance interaction with internet. Every web page has a name attached to it so that browser can find it. **ISP**: It stands for internet service provider. As the name implies, it provides internet services. It is a requirement necessary for internet connection. **E-MAIL:** This means electronic mail. Like every other mail services, E-mail is a way of sending messages. However. Unlike other mail services it is carried out in electronic form. Therefore, it makes interaction among people possible within a short period. For example, relationship between friends, relation and business partners among others are further facilitated all over the globe. However, before anybody can use e-mail to interact with others i.e. to send message(s),the person must open an e-mail account. **BROWSER**: This is the software that searches and gets web page and displays them on the computer screen if the computer is connected to the internet. There are two commonly known browsers, one came from the internet access provider and it is installed when internet software is being install. However apart from that one another one can be installed. **INTRANET**: This is a small version of internet that is used within an office. It is an ideal method of distributing information within an organization outside the office is called Extranet. **E-COMMERCE**: This means Electronic Commerce. It involves the buying and selling of goods and services through the internet. Some business tractions are carried out in the net with the aid of credit card serving as the means of payment. Things like books, cloths, shoes and videos among others can be sold and purchased through the internet. **1.3 THE ROLES OF INTERNET SERVICES** The introduction of internet services like the introduction of computer technology play a vital role in almost all area of human lives as well as their commercial activities. Some of such roles are outlined as follows: 1. It plays a very important role in tracking people as well as crime investigation. 2. Research on business, products and services can be carried out in the net within a short period. 3. In the area of education, Internet services enhance both young and adults education. Some schools even send admission letter to student through Internet services. 4. Marketing and other business traction are carried out in the net within a short period with the aid of credit cards. 5. Internet also provides better awareness to people all over the globe. 6. It is a very important research tool. 1. **Providing better access to health information and options.** Telemedicine can offer convenient, flexible, and more affordable care option to millions of Nigerians --especially those who lack accessible and quality healthcare in their region or need to stay at home due to health concerns or disabilities. While the benefits of this online tool are clear, they often go underutilized by the people who need it most due to lack of internet access. 2. **Making it easier to communicate with friends and family.** From video call platforms to social media outlets, friends and family can connect more easily than ever before. For people who are not physically located near their community or have family members in other countries, the internet provides a bridge of connection. 3. **Offering a wealth of online activities and experiences to enjoy remotely** For older adults or people who might have difficulty leaving the house, the digital word is a gateway to exploration and enjoyment. One of the CTN'S learners Brenda joyce, uses her tablet and digital skills to join virtual events, like collaging classes and the Frick Museum's Cocktails with a Curator. 4. **Promoting workforce development skills.** A report by Burning Glass Technologies found that more than 8 in 10 middle skill jobs require digital skills. With access to the internet and the knowledge to use it, people can work towards higher-paying jobs, develop new skills, and better participate in a digital work force. 5. **Increasing access to social services and benefits.** There are a lot of helpful resources available that people might not know about or access if they are not online. Benefits and social services- like the Affordable Connectivity Program-typically have portals, streamlined applications, and qualification info online. 6. **Decreasing isolation and loneliness** According to our partner Metta Fund, 7% of ilder adults spend one hour or less socializing with friends or family in one week. This is especially troubling when loneliness is linked to serious mental and physical health conditions. 7. **Empowering people with sense of agency** For Luis, one of CTN's Home Connect learners, the internet promoted a shift in his daily life. He uses his device to listen to music, audiobooks, and religious services. He was able to update his resume and apply for jobs. He even assisted others in getting registered online for vaccine appointments! With the tools of technology, older adults like Luis can independently pursue opportunities and interests online. 8. **Improving education and learning opportunities** The pandemic revealed just how essential internet access is for k-12 students, and its importance will not fade in the coming years. In a 2019 Gallup survey, an overwhelming majority of teachers (85%),principals (96%), and administrators (96%) favored increased use of digital learning tools. 9. **Searching and applying for jobs.** The internet is now essential for finding new job opportunities, writing resumes, and submitting applications. 10. **Maintaining curiosity, finding new interests, Sand pursuing hobbies.** 11. **Improving the economy for everyone** 12. **Strengthening communities and social ties.** The internet helps people organize, collaborate, and share information with large members of people. 13. **Creating a better world** The internet enables us to collaborate with people across the globe. This means we can highlight injustices, better understand needs, and connect with people we may have met before.we can therefore conclude that the internet has made society better. **MODULE 6** **COMPUTING DICIPLINE AND ITS SPECIALIZATION** **1.0 COMPUTING DICIPLINE AND ITS SPECIALIZATION** If you choose a computing major, what career options are open to you? We have provided information for each of the majors listed here: - **Computer Engineering** Computer engineering (CE) students study the design of digital hardware and software systems including communications systems, computers and devices that contain computers. For them, programming is focused on digital devices and their interfaces with users and other devices. An important area within computing engineering is the development of embedded systems. Devices such as cell phones, digital audio players, digital video recorders, alarm systems, x-ray machines, and laser surgical tools all require integration of hardware and embedded software, and are all the result of computer engineering. Computer engineering majors are offered by a fairly large number of universities, almost always within engineering. This major requires significant study of mathematics. - **Computer Science** Computer science (CS) spans the range from theory through programming to cutting-edge development of computing solutions. Computer science offers a foundation that permits graduates to adapt to new technologies and new ideas. The work of computer scientists falls into three categories: a\) Designing and building software; b\) Developing effective ways to solve computing problems, such as storing information in databases, sending data over networks or providing new approaches to security problems; and c\) Devising new and better ways of using computers and addressing particular challenges in areas such as robotics, computer vision, or digital forensics (although these specializations are not available in all computer science programs). Most computer science programs require some mathematical background. Let us consider what is involved in a career path in each area. **Career Path 1**: Designing and implementing software. This refers to the work of software development which has grown to include aspects of web development, interface design, security issues, mobile computing, and so on. This is the career path that the majority of computer science graduates follow. While a bachelor's degree is generally sufficient for entry into this kind of career, many software professionals return to school to obtain a terminal master's degree. (Rarely is a doctorate involved.) Career opportunities occur in a wide variety of settings including large or small software companies, large or small computer services companies, and large organizations of all kinds (industry, government, banking, healthcare, etc.). Degree programs in software engineering also educate students for this career path. **Career Path 2:** Devising new ways to use computers. This refers to innovation in the application of computer technology. A career path in this area can involve advanced graduate work, followed by a position in a research university or industrial research and development laboratory; it can involve entrepreneurial activity such as was evident during the dot-com boom of the 1990s; or it can involve a combination of the two. **Career Path 3**: Developing effective ways to solve computing problems. This refers to the application or development of computer science theory and knowledge of algorithms to ensure the best possible solutions for computationally intensive problems. As a practical matter, a career path in the development of new computer science theory typically requires graduate work to the Ph.D. level, followed by a position in a research university or an industrial research and development laboratory. **Career Path 4:** Planning and managing organizational technology infrastructure. This is the type of work for which the new information technology (IT) programs explicitly aim to educate students. Career paths 2 and 3 are undeniably in the domain of computer science graduates. Career paths 1 and 4 have spawned the new majors in software engineering and information technology, respectively, and information systems graduates often follow Career path 1, too. Computer scientists continue to fill these positions, but programs in software engineering, information technology, and information systems offer alternative paths to these careers. - **Information Systems** Information systems (IS) is concerned with the information that computer systems can provide to aid a company, non-profit or governmental organization in defining and achieving its goals. It is also concerned with the processes that an enterprise can implement and improve using information technology. IS professionals must understand both technical and organizational factors, and must be able to help an organization determine how information and technology-enabled business processes can provide a foundation for superior organizational performance. They serve as a bridge between the technical and management communities within an organization. What information does the enterprise need? How is that information generated? Is it delivered to the people who need it? Is it presented to them in ways that permit them to use it readily? Is the organization structured to be able to use technology effectively? Are the business processes of the organization well designed? Do they use the opportunities created by information technology fully? Does the organization use the communication and collaboration capabilities of information technologies appropriately? Is the organization capable of adapting quickly enough to changing external circumstances? These are the important issues that businesses rely on IS people to address. A majority of IS programs are located in business schools; however, they may have different names such as management information systems, computer information systems, or business information systems. All IS degrees combine business and computing topics, but the emphasis between technical and organizational issues varies among programs. For example, programs differ substantially in the amount of programming required. Traditionally, many graduates of IS programs have functioned in roles that are similar to the roles for which IT programs explicitly prepare their students. Information systems graduates continue to fill these roles, but the new programs in information technology offer an alternative path to these positions. - **Information Technology** Information technology (IT) is a label that has two meanings. In common usage, the term "information technology" is often used to refer to all of computing. As a name of an undergraduate degree program, it refers to the preparation of students to meet the computer technology needs of business, government, healthcare, schools, and other kinds of organizations. IT professionals possess the right combination of knowledge and practical, hands-on expertise to take care of both an organization's information technology infrastructure and the people who use it. They assume responsibility for selecting hardware and software products appropriate for an organization. They integrate those products with organizational needs and infrastructure, and install, customize and maintain those applications, thereby providing a secure and effective environment that supports the activities of the organization's computer users. In IT, programming often involves writing short programs that typically connect existing components (scripting). Planning and managing an organization's IT infrastructure is a difficult and complex job that requires a solid foundation in applied computing as well as management and people skills. Those in the IT discipline require special skills -- in understanding, for example, how networked systems are composed and structured, and what their strengths and weaknesses are. There are important software systems concerns such as reliability, security, usability, and effectiveness and efficiency for their intended purpose; all of these concerns are vital. These topics are difficult and intellectually demanding. - **Software Engineering** Software engineering (SE) is concerned with developing and maintaining software systems that behave reliably and efficiently, are affordable to develop and maintain, and satisfy all the requirements that customers have defined for them. It is important because of the impact of large, expensive software systems and the role of software in safety-critical applications. It integrates significant mathematics, computer science and practices whose origins are in engineering. Students can find software engineering in two contexts: computer science programs offering one or more software engineering courses as elements of the CS curriculum, and in separate software engineering programs. Degree programs in computer science and in software engineering tend to have many courses in common; however, as of Spring 2006 there are few SE programs at the bachelor's level. Software engineering focuses on software development and goes beyond programming to include such things as eliciting customers' requirements, and designing and testing software. SE students learn how to assess customer needs and develop usable software that meets those needs. Both computer science and software engineering curricula typically require a foundation in programming fundamentals and basic computer science theory. They diverge in their focus beyond these core elements. Computer science programs tend to keep the core small and then expect students to choose among more advanced courses (such as systems, networking, database, artificial intelligence, theory, etc.). In contrast, SE programs generally expect students to focus on a range of topics that are essential to the SE agenda (problem modeling and analysis, software design, software verification and validation, software quality, software process, software management, etc.). While both CS and SE programs typically require students to experience team project activity, SE programs tend to involve the students in significantly more of it, as effective team processes are essential to effective SE practices. In addition, a key requirement specified by the SE curriculum guidelines is that SE students should learn how to build software that is genuinely useful and usable by the customer and satisfies all the requirements defined for it. Most people who now function in the U.S. as serious software engineers have degrees in computer science, not in software engineering. In large part this is because computer degrees have been widely available for more than 30 years and software engineering degrees have not. Positions that require development of large software systems often list "Software Engineer" as the position title. Graduates of computer science, computer engineering, and software engineering programs are good candidates for those positions, with the amount of software engineering study in the programs determining the suitability of that graduate for such a position. Most IT professionals who have computing degrees come from CS or IS programs. It is far too soon for someone who wants to work as a software engineer or as an information technology practitioner to be afraid that they won't have a chance if they don't graduate from a degree program in one of the new disciplines. In general, a CS degree from a respected program is the most flexible of degrees and can open doors into the professional worlds of CS, SE, IT, and sometimes CE. A degree from a respected IS program allows entry to both IS and IT careers. Media attention to outsourcing, offshoring, and job migration has caused many to be concerned about the future of computing-related careers. It is beyond the scope of this web site to address these issues. The report of the British Computer Society addresses these issues as they impact the U.K. The Globalization Report of the ACM Job Migration Task Force reflects an international perspective, not just a U.S-centric one.