PENERBIT ILMU BAKTI SDN. BHD.
Topic 1 Computer System 1.1 System Concept 1 1.2 Number System and Representation 5 1.3 Information Coding System 16 1.4 Logic Gates and the Simple Logic Circuit 21 Summative Practice 1 36 16 pt Topic 2 Internet Technology 2.1 Basic Concept of Network 39 2.2 Network Architecture 50 2.3 Classification of Networks 54 2.4 Introduction to the Internet 57 2.5 The Broadband Internet Connection 61 2.6 The Internet Address 67 Summative Practice 2 71 Topic 3 Computer Ethics and Security 3.1 Areas of Computer Ethics 74 3.2 Netiquette 79 3.3 Computer Security Risks 83 3.4 Security Measures 86 Summative Practice 3 91 Sample Assignment Questions 93 Contents Topic 4 Multimedia 4.1 Multimedia 95 Summative Practice 4 105 Topic 5 Database 5.1 Basic Concepts of Database 108 Summative Practice 5 113 Topic 6 System Development Life Cycle (SDLC) 6.1 System Development Life Cycle 114 6.2 Phases of System Development Life Cycle 117 Summative Practice 6 125 Semester Examination 1 127 Semester Examination 2 136 Answers 144 ii PENERBIT ILMU BAKTI SDN. BHD.
Computer System TOPIC1 1 ● Explain the operations involved in the information processing cycle: input, process, output, storage. ● Analyse the use of information processing cycle in today’s technology. Learning Outcomes Information Processing Cycle 1 A computer system is an electronic device that can accept input, store data, retrieve and process data, and output information in a meaningful format. It is an integrated collection of hardware and software designed to perform specific tasks: (a) Computer hardware are the physical or tangible parts of a computer. They include input devices, output devices, the central processing unit and storage devices. (b) Computer software are sets of instructions that are used to operate computers, enabling them to perform specific tasks. They are also known as computer programs or applications. 2 The sequence of steps that a computer system performs to calculate or interpret information is known as the information processing cycle. The cycle is depicted in Figure 1.1. Figure 1.1 Four stages of the Information Processing Cycle Input Processing Output Storage 1.1 System Concept PENERBIT ILMU BAKTI SDN. BHD.
3 The four stages of the information processing cycle: (a) Input • The computer receives or accepts data and instructions into its memory. • This is the raw data which is entered for processing and obtaining information. • Data can be input through various devices such as keyboards, mouse, flatbed scanners, barcode readers, joysticks, digital data tablets (for graphic drawing), and electronic cash registers. (b) Processing • This refers to the activities of transforming data into useful information. • Once the input is provided, the raw data is processed. This is the most important step that produces processed data in the form of output which will be used further. • Processing is usually performed by the CPU (Central Processing Unit) of a computer. The CPU is the crucial component of any computer system for getting the operations done. It contains all the necessary circuitry needed to input, store and output data. (c) Storage • This is the physical location where a computer keeps data, information, programs, and applications. • It is the hardware component which stores data for future use. • Data can be stored in an external hard disk, inbuilt hard disk, USB flash drive, micro SD cards, and compact disks or even in registers in the CPU. (d) Output • The computer system produces output when data has been processed into a useful form. • This is the final outcome and the raw data provided in the first stage is now “processed” into a useful form. It is no longer called data; it is now called information. • Output can be displayed to the user by means of various devices such as a monitor, printer, speaker, headphones, etc. 4 Table 1.1 summarises the four stages of the information processing cycle. Table 1.1 The four main steps of the information processing cycle Operation General Explanation Input Computer system accepts or reads data or instructions entered by the user. Process Computer system performs operations on the data to produce information. Output Computer system presents or delivers the results of data processing to the user. Storage Computer system saves data, programs, or output for future use. 2 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
The Information Processing Cycle in Today’s Technology 1 Let us look at the information processing cycle in the operation of various systems or applications. (a) Spell check program Input Computer accepts a document Output Displays a list of any misspelled words Processing Spell-check program compares words in document to built-in dictionary Storage Stores final document to disk or drive (b) Computer calculator (Calculate the sum 3 + 5) Computer saves the output for future use Storage Computer adds up 3 and 5 Processing Computer displays the result 8 on the monitor Output Computer reads the numbers 3 and 5 entered by the user using a keyboard Input (c) Point of Sale (POS) system Storage • System stores item purchased • System stores updated stock quantity • System stores purchase transaction Processing • System computes price of each item • System organises data • System sums up all prices • System calculates change to customer Output • System produces cash register receipt • System displays balance 10101100110 Input • System reads barcode • System reads item purchased • System reads amount purchased by customer 3 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
(d) Automated Teller Machine (ATM) Storage • Machine saves the user’s account balance after the money is withdrawn Processing • System verifies card • System verifies pin number • System determines transaction type • System determines account type • System calculates balance Output • Machine dispenses money • Machine ejects the ATM card • Machine displays message • Machine issues receipt Input • Machine accepts card • System reads pin number from user • System reads amount from user Quick Check 1.1 1 Identify and describe the four processes involved in a computer-based information processing cycle. 2 Draw a diagram to show the information processing cycle. 3 Ahmad is travelling from Bukit Jalil to Putrajaya. When he reaches the Putrajaya toll gate, Ahmad taps his Touch ‘n Go card on the card reader. Identify two activities for each operation in the information processing cycle involved during the Touch ‘n Go transaction at the Putrajaya toll gate. Operation Activities Input (i) (ii) Process (i) (ii) Output (i) (ii) Storage (i) (ii) 4 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
4 A lecturer plans to calculate his students’ coursework marks at the end of each semester. Coursework marks are the total marks for quizzes, assignments and group projects. Based on the given scenario, explain the operations that takes place in the information processing cycle to display the coursework marks. Operation Explanation Input Process Output 1.2 Number System and Representation ● Explain data representation in computers (bit, byte). ● Describe number systems (binary, decimal, hexadecimal). ● Describe why binary and hexadecimal notations are used in data representation. ● Convert between binary and decimal whole numbers. ● Convert between hexadecimal and decimal. ● Convert between hexadecimal and binary. Learning Outcomes Data Representation 1 Data representation refers to the forms in which data is stored, processed and transmitted. 2 Computer systems can only handle data in digital formats. Data is stored in binary form represented by the digits 0 and 1. This is because in electronic circuitry, data is represented by anything that can be in two states, such as the ON or OFF state of a switch. 3 A bit is the smallest unit of data in a computer. (a) “Bit” is short for “binary digit”. A bit can hold only one of two values: 0 or 1. (b) In a computer program, values of 1 and 0 can be used to represent the conditions true/false, yes/no, on/off. 4 A group of 8 bits is a byte. (a) A byte can be used to represent an 8-digit binary number. Example: 011000102 (binary) is equivalent to 9810 (decimal). A computer’s circuit is made of billions of transistors. Transistors are tiny switches that are activated by electronic signals. The binary digits 1 and 0 reflect the ON and OFF states of a transistor. Smart Tips! 5 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
(b) A byte can also be used to represent a single character, such as the letter E, a comma, or a percentage sign. 5 Computer memory is organised in bytes. A byte is the smallest amount of data that a computer can read from (or write to) memory. You cannot read or write individual bits in memory. In a similar way, files are also organised in bytes. Number Systems 1 Number systems are the techniques of expressing or representing numbers in computer system architecture. 2 Computer architecture supports the following number systems: (a) Decimal number system (b) Binary number system (c) Hexadecimal (hex) number system Decimal Number System 1 The decimal number system is the most commonly used number system. It a base 10 number system using ten digits from 0 to 9. Any numerical quantity can be represented using a combination of these ten digits. 2 The decimal number system uses a positional notation (or place-value system) where the value of a digit in a number depends on its position in the number. Each successive digit to the left represents increasing powers of 10: 105 (100 000) Hundred thousands 104 (10 000) Ten thousands 103 (1 000) Thousands 102 (100) Hundreds 101 (10) Tens 100 (1) Ones × 10 × 10 × 10 × 10 × 10 3 Each digit has a value expressed in powers of 10. For example, the decimal number 843 consists of the digit 3 in the units position, the digit 4 in the tens position and the digit 8 in the hundreds position. Example 843 = (8 × 102 ) + (4 × 101 ) + (3 × 100 ) = (8 × 100) + (4 × 10) + (3 × 1) = 800 + 40 + 3 4 In a positional notation system, the number base is called the radix. Thus, the base ten system that we use on a daily basis has a radix of 10. The terms “radix” and “base” can be used interchangeably. 6 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
5 It is customary to specify the radix using a subscript. So, the decimal number 843 can be written as 84310. Generally, if the radix is left off, it would be understood that the number has a base 10. 6 Early computers were designed around the decimal number system. Instructions are given through electric signals by varying the voltage of the signal. Having to use ten different voltages to implement the decimal number system was unnecessarily complex. So, other numbers systems that were simpler to implement were developed. Binary Number System 1 The simplest way to vary instructions through electric signals is through the two-state system (on and off). John von Neumann (a Hungarian-American mathematician and computer scientist) suggested using the binary number system to deal with the basic electronic states of on and off. His insight has greatly simplified the way computers handle data. 2 The binary number system is a base 2 number system having two digits, that are 0 and 1. Each binary digit of 0 or 1 is also called a bit. Every number (value) is formed from different combinations of the digits 0 and 1. 3 The binary number system is also a positional value system, where each digit has a value expressed in powers of 2, as displayed below: 25 (3210) 24 (1610) 23 (810) 22 (410) 21 (210) 20 (110) × 2 × 2 × 2 × 2 × 2 Example 1011012 = (1 × 25 ) + (0 × 24 ) + (1 × 23 ) + (1 × 22 )+ (0 × 21 ) + (1 × 20 ) = (1 × 32) + (0 × 16) + (1 × 8) + (1 × 4) + (0 ×2) + (1 × 1) = 32 + 8 + 4 + 1 = 4510 4 Why is binary notation used in data representation? (a) The binary number system is used in computing and electronics because it is the simplest counting method available. It has two distinct electrical states: 0 (off) and 1 (on). (b) If computers were to use the decimal system, there would have to be 10 different states and computers will have to work harder to process them. Binary numbers are easier for computers to process. (c) Binary numbers take up less space and the execution or access time is very much faster. (d) The binary number system can be used to code everything from memory to form images on the screen. Thus, it is the basis for the storage and transfer of data in most digital electronic devices. Using the binary number system, the state of “on” is represented as 1 and “off” as 0. However, 0 is actually a signal at a lower voltage. Smart Tips! 7 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Hexadecimal Number System 1 The biggest drawback to using the binary number system for computer operations is that programmers have to work with long and confusing strings of 1s and 0s. To reduce the confusion, the hexadecimal (base 16) number system is used as a shorthand to display the binary contents of primary and secondary storage. 2 The hexadecimal number system is a base 16 number system having 16 alphanumeric digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F). Here, A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15. 3 The hexadecimal number system is also a positional value system where each digit, read from right to left, has a value expressed in powers of 16: 165 164 163 162 161 160 × 16 × 16 × 16 × 16 × 16 4 The decimal equivalent of any hexadecimal number is the sum of the products of each digit with its positional value. Example 27FA16 = (2 × 163 ) + (7 × 162 ) + (15 × 161 ) + (10 × 160 ) = 8 192 + 1 792 + 240 + 10 = 10 23410 5 Why is the hexadecimal notation used in data representation? (a) When working with large values, binary numbers can become unmanageable. Hexadecimal numbers can represent binary values in a more compact and readable form. (a) Hexadecimals can be used to write large binary numbers with fewer digits and much less error. Hex numbers use less memory and so more numbers can be stored in computer systems. (c) The small size of hex numbers makes input-output processing easier compared to other number systems. (d) Hex numbers are also widely used in computer programming because it is easy to convert hexadecimal to binary and vice versa. Quick Check 1.2(a) 1 “Bit” is a shortened form of the term “binary digit”. Define a bit. 2 We count by using the ten digits of the decimal system (0 to 9). The computer, by contrast, uses a binary system because it only recognises two states of the number system. (a) What is bit? (b) What is byte? 8 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
3 Define the decimal, binary and hexadecimal numbering systems. 4 Data is represented in a computer by a series of numbers. Explain why computers represent data in binary form. 5 The hexadecimal system is a base-16 number system. Why are hexadecimal numbers so widely used in computing systems? Converting between Decimal and Binary Numbers Converting from Decimal to Binary 1 A decimal number can be converted into a binary number by repeated division: (a) Divide the given decimal number repeatedly by 2 until the final quotient is 0. (b) At each division, the remainder provides a digit of the converted number starting with the least significant digit. (c) Write these remainders in reverse order from the bottom to the top to get the binary number. Example 1 Convert 2210 to a binary number. 2 22 2 11 0 2 5 1 2 2 1 2 1 0 0 1 Write down the remainders from the bottom to the top Therefore, 2210 = 101102 Example 2 Convert 3710 to a binary number. 2 37 2 18 1 2 9 0 2 4 1 2 2 0 2 1 0 0 1 Write down the remainders from the bottom to the top Therefore, 3710 = 1001012 9 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Example 3 Convert 9310 to a binary number. 2 93 2 46 1 2 23 0 2 11 1 2 5 1 2 2 1 2 1 0 0 1 Write down the remainders from the bottom to the top Therefore, 9310 = 10111012 Converting from Binary to Decimal 1 The sum of the decimal values of the binary digits gives the decimal number. (a) Multiply the individual digits by the powers of 2 according to the position of the digits in the number. (b) Add up the products. Example 1 Convert 101102 to a decimal number. Place value 24 (16) 23 (8) 22 (4) 21 (2) 20 (1) Digit 1 0 1 1 0 101102 = (1 × 24 ) + (0 × 23 ) + (1 × 22 ) + (1 × 21 ) + (0 × 20 ) = 16 + 0 + 4 + 2 + 0 = 22 Example 2 Convert 10111002 to a decimal number. Place value 26 (64) 25 (32) 24 (16) 23 (8) 22 (4) 21 (2) 20 (1) Digit 1 0 1 1 1 0 0 10111002 = 64 + 16 + 8 + 4 = 92 10 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
2 There is a shortcut way to perform the calculations shown in the two examples above. Example 3 Convert 11101102 to a decimal number. 1 1 1 0 1 1 0 64 32 16 8 4 2 1 Write down the binary digits and the decimal value of each digit. Circle the decimal value for every binary digit 1. Add up the circled decimal numbers. 11101102 = 64 + 32 + 16 + 4 + 2 = 118 Example 4 Convert 1111002 to a decimal number. 1 1 1 1 0 0 64 32 16 8 4 2 1111002 = 64 + 32 + 16 + 8 = 120 Quick Check 1.2(b) 1 Convert the decimal number 62 to its binary representation. Show the steps. 2 Show the conversion of 21310 to a binary number. 3 Show the conversion of the decimal 202 to a binary number. 4 Show the conversion of 10111002 to a decimal number. 5 Show the conversion of 001110012 to a decimal number. 6 Show the conversion of 110001112 to a decimal number. Converting between Decimal and Hexadecimal Numbers Converting from Decimal to Hexadecimal 1 A decimal number can be converted into a hexadecimal number by repeated division: (a) Divide the given decimal number repeatedly by 16 until the final quotient is 0. (b) At each successive division, the remainder (a decimal number less than or equal to 15) provides a digit of the converted number. 11 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
(c) Write down these remainders in reverse order from the bottom to the top to get the hexadecimal number. (d) 0–9 are written as usual, while the letters A to F are equivalent to the numbers 10–15. Example 1 Convert 134110 to a hexadecimal. 16 1341 16 83 13 (D) 16 5 3 0 5 Write down the remainders from the bottom to the top Therefore, 134110 = 53D16 Example 2 Convert 86010 to a hexadecimal. 16 860 16 53 12 (C) 16 3 5 0 3 Write down the remainders from the bottom to the top Therefore, 86010 = 35C16 Example 3 Convert 202010 to a hexadecimal. 16 2020 16 126 4 16 7 14 (E) 0 7 Write down the remainders from the bottom to the top Therefore, 202010 = 7E416 Converting from Hexadecimal to Decimal 1 The sum of the decimal values of the hexadecimal digits gives the decimal number. (a) Multiply the individual digits by the powers of 16 according to the position of the digits in the number. (b) Add up the products. 12 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Example 1 Convert the hexadecimal AFB216 to a decimal number. Place value 163 (4 096) 162 (256) 161 (16) 160 (1) Digit A (10) F (15) B (11) 2 AFB216 = (10 × 163 ) + (15 × 162 ) + (11 × 161 ) + (2 × 160 ) = (10 × 4 096) + (15 × 256) + (11 × 16) + (2 × 1) = 40 960 + 3 840 + 176 + 2 = 44 978 Example 2 Convert the hexadecimal BA816 to a decimal number. Place value 162 (256) 161 (16) 160 (1) Digit B (11) A (10) 8 BA816 = (11 × 162 ) + (10 × 161 ) + (8 × 160 ) = (11 × 256) + (10 × 16) + (8 × 1) = 2 816 + 160 + 8 = 2 984 Example 3 Convert 7DE16 to a decimal number. 7DE16 = (7 × 162 ) + (D × 161 ) + (E × 160 ) = (7 × 256) + (13 × 16) + (14 × 1) = 1 792 + 208 + 14 = 2 014 Quick Check 1.2(c) 1 Convert the decimal number 414 to a hexadecimal number. Show your working. 2 The Internet Protocol address of a printer is 192.0.0.2 (consisting of four groups of decimals separated by dots). Convert the address to hexadecimal numbers. 3 Convert 6420610 to hexadecimal. Show your calculations. 4 Convert C216 to a decimal number. Show your calculations. 5 Express B1D16 as a decimal number. Show your calculations. 6 Convert F1FA16 to a decimal. Show your calculations. 13 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Converting between Hexadecimal and Binary Numbers Converting from Binary to Hexadecimal 1 There are two ways to convert a binary to a hexadecimal number: (a) Normal solution (convert from binary to decimal first, then convert the decimal to hexadecimal) (b) Using the 8421 technique 2 The following examples illustrate the two methods. Example 1 Convert 110102 to a hexadecimal number. METHOD 1 (NORMAL SOLUTION) 110102 = (1 × 24 ) + (1 × 23 ) + (0 × 22 ) + (1 × 21 ) + (0 × 20 ) = 16 + 8 + 0 + 2 + 0 = 2610 16 26 16 1 10 (A) 0 1 Write down the remainders from the bottom to the top Therefore, 110102 = 2610 = 1A16 METHOD 2 (8421 TECHNIQUE) 1 8 4 2 1 1 0 1 0 8 4 2 1 1 = 1 8 + 2 = 10 = A Divide the binary digits into groups of 4 digits, from the right to the left. Write 8421 below each group, and circle those digits under each binary value 1. Add up the circled digits in each group and convert to the equivalent hexadecimal digit. Therefore, 110102 = 1A16 Convert binary to decimal first. Then, convert decimal to hexadecimal. Example 2 Convert 1101011100011002 to a hexadecimal number. 1 0 0 0 8 4 2 1 8 0 1 1 0 8 4 2 1 4 + 2 = 6 1 0 1 1 8 4 2 1 8 + 2 + 1 = 11 = B 1 1 0 0 8 4 2 1 8 + 4 = 12 = C Therefore, 1101011100011002 = 6B8C16 14 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Converting from Hexadecimal to Binary 1 There are also two ways to convert a hexadecimal number to a binary number: (a) Normal solution (convert from hexadecimal to decimal first, then convert the decimal to binary) (b) Using 8421 technique 2 The following examples illustrate the two methods. Example 1 Convert 3FD16 to a binary number. METHOD 1 (NORMAL SOLUTION) Convert hexadecimal to decimal first. 3FD16 = (3 × 162 ) + (F × 161 ) + (D × 160 ) = (3 × 256) + (15 × 16) + (13 × 1) = 768 + 240 + 13 = 102110 Therefore, 3FD16 = 102110 = 11111111012 METHOD 2 (8421 TECHNIQUE) 3 F = 15 D = 13 3 15 13 8 4 2 1 8 4 2 1 8 4 2 1 0 0 1 1 1 1 1 1 1 1 0 1 Write 8421 below each hexadecimal digit. Circle those digits that will add up to give the hexadecimal value. Each circled digit converts 8 + 4 + 2 + 1 to the binary digit 1. = 15 2 + 1 = 3 8 + 4 + 1 = 13 Therefore, 3FD16 = 11111111012 Then, convert decimal to hexadecimal. 2 1021 2 510 1 2 255 0 2 127 1 2 63 1 2 31 1 2 15 1 2 7 1 2 3 1 2 1 1 0 1 Write down the remainders from the bottom to the top 15 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Example 2 Convert the hex number 3A4C16 into binary. 3 A 4 C 3 10 4 12 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 0 0 1 1 1 0 1 0 0 1 0 0 1 1 0 0 = 8 + 2 = 10 = 2 + 1 = 3 = 8 + 4 = 12 = 4 Therefore, 3A4C16 = 111010010011002 Quick Check 1.2(d) 1 Show the conversion of 1110102 to a hexadecimal number. 2 Show the conversion of 101001011002 to a hexadecimal number. 3 Show the conversion of 10011111011110112 to a hexadecimal number. 4 Show the conversion of A616 to a binary number. 5 Show the conversion of BC416 to a binary number. 6 Find the missing number in the sequence given below and give your answer in binary. 2316, 2916, ____ , 3516 1.3 Information Coding Scheme ● Describe how computers encode characters using Extended ASCII (8 bits), EBCDIC, Unicode. ● Calculate the total number of bits/bytes in a given word based on each coding scheme. ● Differentiate the coding system based on number of bits and total number of characters represented and context use. Learning Outcomes Coding Schemes 1 For computer systems to process text, the characters used in the written language (such as a letter, a number or a symbol) must be converted into numbers that the computer can read. The process of converting these characters and symbols to numbers is called character encoding. 16 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
2 To enable computers to store and exchange data with other computers and programs, there must be a standard coding scheme: An information coding scheme is a set of codes that tells the computer how to interpret digital data into letters, numbers and symbols. 3 The most common coding schemes are: (a) ASCII [American Standard Code for Information Interchange] (b) EBCDIC [Extended Binary Coded Decimal Interchange Code] (c) Unicode [Universal Character Encoding] 4 ASCII (a) ASCII (pronounced “ask-ee”) is the most widely used coding scheme to represent data. (b) It uses 8 bits to represent each character, up to a total of 256 (28 = 256) different characters. Eight bits can be stored in one byte of computer memory. (c) For example, the letter “A” is represented by the decimal number 65 (binary 10000001 or hex 41). The other ASCII character codes are listed in Table 1.2. (d) When data is stored or transmitted, its ASCII number is used, not the character itself. (e) ASCII is used in minicomputers, personal computers and computers that make information available on the Internet. 5 EBCDIC (a) EBCDIC (pronounced “ebb-see-dic”) is a coding scheme used by IBM mainframe computers and some IBM mid-range systems and high-end servers. (b) Like ASCII, it uses a 8-bit binary code to represent each of 256 (28 = 256) different characters. (c) EBCDIC is widely considered to be an obsolete coding system, but is still used in some equipment, mainly in order to allow for continued use of software written many years ago based on an EBCDIC communication environment. (d) Table 1.3 lists some EBCDIC character codes. 6 Unicode (a) Today, computers make international communication and business transactions possible with the Unicode coding system. (b) Unicode uses 16-bit encoding to represent 65,536 (or 216) different characters, and can symbolise all the world’s written languages. (c) Unicode is implemented in several operating systems including Windows, Mac OS, and Linux. (d) Figure 1.2 shows that we can pull up the Character Map in a Windows computer to see the Unicode symbols. The code is usually shown as U+hhhh where hhhh is the hexadecimal code of the character. The Unicode Consortium, a nonprofit organisation, maintains and coordinates development of Unicode. Members of the consortium are the main computer hardware/ software companies such as Adobe, Apple, Facebook, Google, IBM, and Microsoft. Smart Tips! 17 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Table 1.2 ASCII character codes with decimal, hex and binary forms Dec Hex Binary Char Dec Hex Binary Char Dec Hex Binary Char 0 00 00000000 NULL 43 2B 00101011 + 86 56 01010110 V 1 01 00000001 START OF HEADER 44 2C 00101100 , 86 57 01010111 W 2 02 00000010 START OF TEXT 45 2D 00101101 – 88 58 01011000 X 3 03 00000011 END OF TEXT 46 2E 00101110 . 89 59 01011001 Y 4 04 00000100 END OF TRANSMISSION 47 2F 00101111 / 90 5A 01011011 Z 5 05 00000101 ENQUIRY 48 30 00110000 0 91 5B 01011011 [ 6 06 00000110 ACKNOWLEDGE 49 31 00110001 1 92 5C 01011100 \ 7 07 00000111 BELL 50 32 00110010 2 93 5D 01011101 ] 8 08 00001000 BACKSPACE 51 33 00110011 3 94 5E 01011110 ^ 9 09 00001001 HORIZONTAL TAB 52 34 00110100 4 95 5F 01011111 _ 10 0A 00001010 LINE FEED 53 35 00110101 5 96 60 01100000 ' 11 0B 00001011 VERTICAL TAB 54 36 00110110 6 97 61 01100001 a 12 0C 00001100 FORM FEED 55 37 00110111 7 98 62 01100010 b 13 0D 00001101 CARRIAGE RETURN 56 38 00111000 8 99 63 01100011 c 14 0E 00001110 SHIFT OUT 57 39 00111001 9 100 64 01100100 d 15 0F 00001111 SHIFT IN 58 3A 00111010 : 101 65 01100101 e 16 10 00010000 DATA LINE ESCAPE 59 3B 00111011 ; 102 66 01100110 f 17 11 00010001 DEVICE CONTROL 1 60 3C 00111100 < 103 67 01100111 g 18 12 00010010 DEVICE CONTROL 2 61 3D 00111101 + 104 68 01101000 h 19 13 00010011 DEVICE CONTROL 3 62 3E 00111101 > 105 69 01101001 i 20 14 00010100 DEVICE CONTROL 4 63 3F 00111111 ? 106 6A 01101010 j 21 15 00010101 NEGATIVE ACKNOWLEDGE 64 40 01000000 @ 107 6B 01101011 k 22 16 00010110 SYNCHRONIZE 65 41 01000001 A 108 6C 01101100 l 23 17 00010111 END OF TRANS. BLOCK 66 42 01000010 B 109 6D 01101101 m 24 18 00011000 CANCEL 67 43 01000011 C 110 6E 01101110 n 25 19 00011001 END OF MEDIUM 68 44 01000100 D 111 6F 01101111 o 26 1A 00011010 SUBSTITUTE 69 45 01000101 E 112 70 01110000 p 27 1B 00011011 ESCAPE 70 46 01000110 F 113 71 01110001 q 28 1C 00011100 FILE SEPARATOR 71 47 01000111 G 114 72 01110010 r 29 1D 00011101 GROUP SEPARATOR 72 48 01001000 H 115 73 01110011 s 30 1E 00011110 RECORD SEPARATOR 73 49 01001001 I 116 74 01110100 t 31 1F 00011111 UNIT SEPARATOR 74 4A 01001010 J 117 75 01110101 u 32 20 00100000 SPACE 75 4B 01001011 K 118 76 01110110 v 33 21 00100001 ! 76 4C 01001100 L 119 77 01110111 w 34 22 00010010 “ 77 4D 01001101 M 120 78 01111000 x 35 23 00100011 # 78 4E 01001110 N 121 79 01111001 y 36 24 00100100 $ 79 4F 01001111 O 122 7A 01111010 z 37 25 00100101 % 80 50 01001000 P 123 7B 01111011 { 38 26 00100110 & 81 51 01010001 Q 124 7C 01111100 | 39 27 00100111 ‘ 82 52 01010010 R 125 7D 01111101 } 40 28 00101000 ( 83 53 01010011 S 126 7E 01111110 ~ 41 29 00101001 ) 84 54 01010100 T 127 7F 01111111 DEL 42 2A 00101010 * 85 55 01010101 U Table 1.3 EBCDIC character codes in decimal and hexadecimal forms Dec Hex Char Dec Hex Char Dec Hex Char 129 81 a 193 C1 A 240 F0 0 130 82 b 194 C2 B 241 F1 1 131 83 c 195 C3 C 242 F2 2 132 84 d 196 C4 D 243 F3 3 133 85 e 197 C5 E 244 F4 4 134 86 f 198 C6 F 245 F5 5 135 87 g 199 C7 G 246 F6 6 136 88 g 200 C8 H 247 F7 7 137 89 i 201 C9 I 248 F8 8 249 F9 9 64 40 BLANK 145 91 j 209 D1 J 76 4C < 146 92 k 210 D2 K 77 4D ( 147 93 l 211 D3 L 78 4E + 148 94 m 212 D4 M 79 45 | 149 95 n 213 D5 N 80 50 & 150 96 o 214 D6 O 90 5A ! 151 97 p 215 D7 P 91 5B $ 152 98 q 216 D8 Q 92 5C * 153 99 r 217 D9 R 93 5D ) 94 5E ; 96 60 - 97 61 / 162 A2 s 226 E2 S 107 6B , 163 A3 t 227 E3 T 108 6C % 164 A4 u 228 E4 U 109 6D _ 165 A5 v 229 E5 V 110 6E > 166 A6 w 230 E6 W 111 6F ? 167 A7 x 231 E7 X 122 7A : 168 A8 y 232 E8 Y 123 7B # 169 A9 z 233 E9 Z 124 7C @ 125 7D ‘ 126 7E = 127 7F “ 18 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Figure 1.2 The Character Map in Windows shows that the Unicode for the small letter “a” is “U+0061” 6 The 256 characters and symbols that are represented by ASCII and EBCDIC codes are sufficient for English and Western European languages. But they are not large enough to include the different alphabets and symbols of other languages (such as Latin, Arabic, Greek, Thai, Hangul, Chinese, and so on). 7 However, Unicode can represent up to 65 536 characters that include the world’s current languages, as well as classical and historical languages. It also includes many additional characters such as emojis and emoticons, and is designed for backward compatibility with older coding schemes like ASCII. 8 Table 1.4 summarises the differences between the ASCII, EBCDIC and Unicode character codes. Table 1.4 Differences between ASCII, EBCDIC and Unicode ASCII EBCDIC Unicode Uses 8 bits to represent a character Uses 8 bits to represent a character Uses 16 bits to represent a character Can represent up to 256 characters (28 = 256) Can represent up to 256 characters (28 = 256) Can represent up to 65 536 characters (216 = 65 536) Most widely used to support English characters Used mostly in IBM mainframe machines Used to support all world languages such as English, Chinese and Arabic Traditionally used on PCs and microcomputers Used on mainframe machines and high-end servers (such as the IBM mainframe) Newer code that is implemented in operating systems such as Windows, Mac OS, Linux 9 Since computers work in binary, all characters (whether letters, digits or punctuation) are stored as binary numbers. Figure 1.3 illustrates what happens when a user presses a character on the computer keyboard. 19 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
The user presses the letter A on the keyboard. A chip in the keyboard converts the electronic signal from the key into a special code called the scan code . After processing, the binary code for A is converted to an image for display on the monitor (output device). The scan code for the letter A is sent to the system unit of the computer. The system unit is the box-like case that houses the motherboard, CPU, RAM, etc. The scan code for the letter A is converted to its binary ASCII, EBCDIC or UNICODE and is stored in memory for processing. A A 0100 0001 Keyboard Monitor System unit Figure 1.3 Computers can only work with binary data Total Number of Bits/Bytes in a Word 1 Computer systems store data in bits and bytes, where groups of 8 bits together make 1 byte. 2 The bit stores either a 0 or 1. So, it is too small to be of much use. (a) In the 8-bit ASCII or EBCDIC schemes, a character (whether it is a letter, digit or punctuation) needs 1 byte of storage in memory. (b) In the 16-bit Unicode scheme, each character is 16 bits (or 2 bytes) wide. 3 We can calculate the number of bits or bytes in a word based on each coding scheme. Table 1.5 illustrates an example. Table 1.5 Counting the number of bits/bytes in a word How many bits/bytes are there in “www.google.com” ? ASCII EBCDIC Unicode Numbers of characters 14 14 14 Number of bits for a character 8 8 16 Number of bits 14 × 8 = 112 14 × 8 = 112 14 × 16 = 224 Number of bytes 112/8 = 14 112/8 = 14 224/8 = 28 Quick Check 1.3 1 Computers rely on logic circuits, which are controlled by electronic switches whose state can be on or off. Each switch on/off state is represented by one bit, whose value is either 0 or 1. Coding schemes translate real-world data into a form that computers can process easily. The following shows the steps when a letter “S” is converted to binary form and back. Rearrange the steps in the correct order. (i) The electronic circuitry in the computer converts the scan code for the capital letter “S” to its ASCII binary code. • 1 byte = 8 bits • In ASCII/EBCDIC: 1 character = 1 byte • In Unicode: 1 character = 2 bytes Recap! 20 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
(ii) Binary code for the capital letter “S” is converted to an image and displayed on the output device. (iii) When the user types the letter “S” on a keyboard, a chip in the keyboard converts the key’s electronic signal into a scan code. (iv) The scan code of the letter “S” is sent to the electronic circuitry in the computer. 2 Calculate the total number of bits for the following words using the EBCDIC information coding scheme. Word Total Number of Bits Total Numbers of Bytes (a) FACEBOOK (b) DATA RAYA! 3 Determine the number of bits and bytes needed to store the following words using the ASCII coding scheme: COMPUTER SCIENCE 4 (a) How many bits will be used to represent the characters shown below by the android OS? (b) Based on your understanding of ASCII and EBCDIC, are these coding schemes able to represent the characters shown above? (Answer Yes or No.) 5 How many bits and bytes have been used in the Unicode system to store the following words? “Selamat Hari Merdeka” 6 Based on your understanding of information coding, which scheme will be able to represent the characters below? Give a reason for your answer. 사랑 요 1.4 Logic Gates and the Simple Logic Circuit ● Identify logical operators (AND, OR, NOT) and symbols (gates) used to represent each of the operators (AND, OR, NOT). ● Identify combinations of different gates (NAND, NOR, XOR, XNOR). ● Derive Boolean expressions (and truth table) based on a given logic statement or logic circuit (AND, OR, NOT, NAND, NOR, XOR, XNOR). ● Construct a truth table based on a given logic statement or scenario (maximum 3 inputs). ● Draw a simple logic circuit for a given logic statement or scenario (AND, OR, NOT, NAND, NOR, XOR, XNOR). Learning Outcomes 21 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Logic Gates and Circuits 1 A logic gate is a device that performs basic logical operations that are fundamental to digital circuits. It is the basic building blocks of all electronic circuits and microprocessors. 2 Logic gates are implemented in a digital or logic circuit by using diodes or transistors acting as electronic switches. A computer is filled with millions of these switches that are constantly being turned on and off in specific patterns. 3 The inputs and outputs of a logic gate can switch between two distinct logical values of 1 and 0 that are actually represented by different voltage levels. They can also represent the two digital logic states of ON or OFF, HIGH or LOW, and TRUE or FALSE. Logic gates can be defined as electronic devices that are used to implement logic or Boolean expressions. 4 Boolean algebra is a branch of mathematics that deals with logical operations (rather than numerical operations) on binary variables. The values of a Boolean variable are the truth values, TRUE and FALSE, denoted as 1 and 0 respectively. 5 In elementary algebra, arithmetic operations such as addition and multiplication are used. In Boolean algebra, logical operators are used to evaluate Boolean expressions and determine whether a test condition is TRUE or FALSE. Depending on the result of the test, a digital circuit can decide to do one thing or another. 6 The three basic logical operators that are used in digital systems are NOT, AND and OR. All other logical operators can be derived from combinations of these three. Basic Logical Operators NOT Gate 1 The NOT gate is also known as an inverter as it produces an inverted version of the input as the output. The binary input state of 0 gives an output of 1 and the binary input state of 1 gives an output of 0. 2 The NOT gate has only one input. If the input variable is “A”, the output is “NOT A” (which can be denoted as A) or the complement of A (denoted as A'). 3 The function of the NOT operator is illustrated in Figure 1.4 with the aid of a truth table. If A is a Boolean variable and A is False, then A is True. But if A is True, then A is False. A Boolean expression is a logical statement that results in a Boolean value, i.e. True or False. Smart Tips! The truth table of a logic system maps out all the possible inputs to the circuit and their outcomes. Smart Tips! 22 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Logic gate symbol Circuits of NOT gate Truth table NOT gate Input Output A A 0 1 1 0 A NOT A If: A = 0 Then: A = 1 If: A = 1 Then: A ̅ = 0 A 0 A 1 A 1 A 0 A 1 A 0 A 0 A 1 Figure 1.4 The negation or NOT operator AND Gate 1 The AND gate has two or more inputs. The output from the AND gate is 1 if and only if all of the inputs are 1, otherwise the output from the gate is 0. 2 The output from the AND gate is written as A·B or A.B (where the dot can be written half way up the base line or on the line). 3 The function of the AND gate is shown in Figure 1.5 along with the truth table for a two-input AND gate. If A and B are two Boolean variables, then A.B is True only if A = B = True. Circuits of AND gate Truth table AND gate Input Output A B A·B 0 0 0 0 1 0 1 0 0 1 1 1 Logic gate symbol A B AND A·B 0 × 0 = 0 0 0 0 0 0 0 0 × 1 = 0 0 1 0 0 1 0 1 × 0 = 0 1 0 0 1 0 0 1 × 1 = 1 1 1 1 1 1 1 Figure 1.5 The conjunction or AND operator The NOT operator is the only unary operator with only one operand or input. Smart Tips! 23 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
OR Gate 1 The OR gate has two or more inputs. The output from the OR gate is 1 if any one of the inputs is 1. The output is 0 if and only if all the inputs are 0. 2 The output from the OR gate is written as A + B. If A and B are two Boolean variables, then A + B is True only if A = True, B = True or A = B = True. 3 The function of the OR gate is shown in Figure 1.6 along with the truth table for a two-input OR gate. Circuits of AND gate Truth table OR gate Input Output A B A + B 0 0 0 0 1 1 1 0 1 1 1 1 Logic gate symbol A B OR A + B 0 + 0 = 0 0 0 0 0 0 0 0 + 1 = 1 0 1 1 0 1 1 1 + 0 = 1 1 0 1 1 0 1 1 + 1 = 1 1 1 1 1 1 1 Figure 1.6 The disjunction or OR operator Combinations of Different Gates 1 The three basic logic gates (NOT, AND and OR) can be combined to provide more complex logical functions, such as NAND, NOR, XOR and XNOR. NAND Gate 1 The NAND gate is a combination of an AND gate followed by a NOT gate. It has two or more inputs. The output from the NAND gate is 0 if and only if all of the inputs are 1, otherwise the output is 1. 2 The output from the NAND gate is the inversion of A·B and this is written as A∙B. The Boolean expression A∙B is read as “A NAND B”. 3 The symbol of a NAND gate has a small circle on the output side to represent inversion. It is known as an invert bubble. The NAND gate is shown in Figure 1.7 along with the truth table for a two-input NAND gate. 24 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Truth table Input Output AND gate Output NAND gate A B A·B A∙B 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 Logic gate symbol A B NAND A∙B Figure 1.7 The NAND operator is a combination of an AND and NOT NOR Gate 1 The NOR gate is a combination of an OR and NOT gate. It has two or more inputs. The output from the NOR gate is 1 if and only if all of the inputs are 0, otherwise the output is 0. 2 The output from the NOR gate is the inversion of A+B and this is written as A+B. The Boolean expression A+B is read as “A NOR B”. 3 The symbol of a NOR gate is shown in Figure 1.8 along with the truth table for a two-input NAND gate. Truth table Input Output NOR gate Output NOR gate A B A+B A+B 0 0 0 1 0 1 1 0 1 0 1 0 1 1 1 0 Logic gate symbol A B NOR A+B Figure 1.8 The NOR operator is a combination of an OR and NOT Exclusive-OR (XOR) Gate 1 The exclusive-OR or XOR gate has two or more inputs. For a two-input XOR, the output is similar to that from the OR gate except it is 0 when both inputs are 1. 2 However, this cannot be extended to XOR gates comprising three or more inputs. 3 In general, an XOR gate gives an output value of 1 when there is an odd number of 1's on the inputs to the gate. The truth table for a three-input XOR gate in Figure 1.9 illustrates this. 4 The output from the XOR gate is written as A B which reads as "A XOR B". The symbol of a XOR gate is shown in Figure 1.9 along with the truth tables for a two-input XOR gate and a three-input XOR gate. 25 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Truth table for 3-input XOR Truth table for 2-input XOR Input Output A B C A B C 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 Input Output A B A B 0 0 0 0 1 1 1 0 1 1 1 0 Logic gate symbol A B XOR A B Figure 1.9 The XOR operation is shown by an encircled plus sign () Exclusive-NOR (XNOR) Gate 1 The exclusive-NOR or XNOR gate has two or more inputs. It does the opposite to the XOR gate. So, the output for a two-input XNOR is equivalent to inverting the output from the XOR gate. The output is 1 when both inputs are 1 (high) and if both inputs are 0 (low) 2 However, an XNOR gate for three or more inputs gives an output value of 1 when there is an even number of 1's on the inputs to the gate. The truth table for a three-input XOR gate in Figure 1.10 illustrates this. 3 The output from the XNOR gate is written as AB which reads "A XNOR B". The XNOR gate is drawn using the same symbol as the XOR gate with an invert bubble on the output line as shown in Figure 1.10. Truth table for 3-input XOR Truth table for 2-input XOR Input Output A B C ABC 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0 Input Output A B AB 0 0 1 0 1 0 1 0 0 1 1 1 Logic gate symbol A B XNOR AB Figure 1.10 The XNOR operator is a combination of XOR gate and the NOT gate 26 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Truth Tables for Combinational Logic Systems 1 Before we start building the truth table for a logic system to determine the outputs, we should consider the possible number of combinations of inputs. 2 Let us suppose that we want to build the truth table based on the Boolean expression X = A + B. Then, if N is the possible number of combinations of inputs: N = 2n = 22 = 4 Therefore, the truth table will have four rows of inputs. 3 One-input gates (a) If there is only one input (A), then there are only two possible combinations (logic 0 or logic 1). (b) N = 21 = 2 combinations/rows The truth table has two rows of inputs, namely 0 and 1. (c) So, we can start drawing up the truth table and filling up the rows of inputs as shown below. Input Output 0 1 4 Two-input gates (a) If there are two inputs (A and B), they can be combined in four different ways. (b) For the Boolean expression Z = A + B, we have N = 22 = 4 combinations (or rows). (c) So, we can draw up the truth table as follows. Input Output A B Z 0 0 0 1 1 0 1 1 5 Three-input gates (a) If there are three inputs (A, B and C), they can be combined in 8 different ways. (b) For the Boolean expression Z = A + B + C, there are N = 23 = 8 combinations (or rows). (c) So, we can draw up the truth table as follows. n = number of inputs (A and B) There are 4 possible combinations of inputs. Row 1 Row 2 Combination 1 Combination 2 Combination 3 Combination 4 In the Boolean expression X = A + B, the variables A and B are considered as two inputs. Smart Tips! 27 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Input Output A B C Z 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 6 From the truth tables above, a pattern can be seen. Starting with one input giving two combinations, you simply double the number of combinations each time an input is added. 1 input 2 combinations 2 input 4 combinations 3 input 8 combinations × 2 × 2 7 Therefore, we can work out the possible combinations of inputs for a truth table based on the circuit diagram. 8 For example, the following logic diagram has two logic gates. A B C D Z (a) There are three inputs, so this gives eight combinations in the truth table. We start with a truth table with 8 rows of inputs. (b) To complete the truth table: • STAGE 1 Draw up the results for point D. (This is the output from the AND gate, being fed by inputs A and B only.) • STAGE 2 Draw up the results for point Z. (This is the output from the OR gate, being fed by output D and input C only.) By following this technique, logic system problems can be solved easily. 8 combinations 28 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Quick Check 1.4(a) 1 Complete the table with the correct Boolean notation and gate symbol for each logic gate. Logic Gate Boolean Notation Gate Logic Symbol (a) NOT (b) AND (c) OR (d) NAND (e) NOR (f) XOR (g) XNOR 2 Complete the output of the truth table below for two inputs (A, B) for each logic gate. A B OR AND NOR NAND XOR XNOR (a) 0 0 (b) 0 1 (c) 1 0 (d) 1 1 3 Identify the name of the logic gate based on the given description. (a) This logical gate returns true if at least one or both of the inputs are true, else it returns false. (b) The output returns true when both inputs are true. If either one of the two inputs is false, the output will be false. (c) The output is 0 when any of its inputs are 1; otherwise, the output is 1 when all of its inputs are 0. (d) This is a unary operator and returns true when the input is false. (e) The output is true if either, but not both, of the inputs is true. The output is false if both inputs are false or if both inputs are true. (f) A signal passing through a gate is inhibited by sending a false signal into one of the inputs. (g) The gate's output requires both inputs to be the same to produce 1 for the output. Boolean Expressions Based on Logic Statements or Circuits 1 Each logic gate has a corresponding Boolean mathematical formula or expression. Using these expressions saves us from having to draw the logic diagrams. 2 For example, the inputs in the following logic circuit are A and B, while the output is Z. Boolean logic is named after George Boole (1815–1864), the English mathematician who developed the field of mathematical logic. Smart Tips! 29 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
A B Z To derive the Boolean expression based on the logic circuit: (a) Identify the number of inputs (A, B). (b) Identify each type of logic gates (NOT, AND). (c) Write down the output from each gate in the logic circuit based on the input(s). A B A.B B (d) Write the Boolean expression from the last gate (output): Z = A AND NOT B This means that we need a two-input AND gate, with B being fed through a NOT gate first. We can write the statement in shorthand Boolean as: Z = A.B Example In the following logic circuit, there are three inputs, A, B and C with one output, Z. Write down the Boolean expression for the output. A Z B C Solution: There are three inputs (A, B and C). There are three kinds of logic gates (NOT, AND, OR). 30 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
A B C A C (A.B.C) + (A.B.C) A.B.C A.B.C Therefore, the shorthand Boolean expression for this logic circuit is: Z = (A.B.C) + (A.B.C) Truth Tables Based on Boolean Expressions or Logic Circuits 1 Given a Boolean expression or a logic circuit, we can construct the truth table. The following examples illustrate the steps. Example 1 Truth table based on Boolean expression Construct the truth table based on the Boolean expression X = A+B.C'. Solution: STEP 1: There are 3 inputs. So, there are 23 or 8 combinations or rows of inputs. STEP 2: Draw the truth table with 8 rows of inputs. STEP 3: Check precedence of gates (NOT gate C' first, AND gate B.C' , then OR gate (A+B.C')). A B C C' B.C' X = (A+B.C') 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 0 1 Precedence of operators tells us which operator to get evaluated first in an expression with a combination of operators: Operator Precedence NOT High AND Medium OR Low Smart Tips! “NOT C” can be written as C'. Smart Tips! 31 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Example 2 Truth table based on logic circuit Construct the truth table based on the following logic circuit. A B Z Solution: STEP 1: There are 2 inputs. So, there are 22 or 4 combinations of inputs. STEP 2: Write the output for each gate to find the Boolean expression. A B (A.B) + (A+B) A.B A+B STEP 3: Draw the truth table with 4 rows of inputs. STEP 4: Check precedence of gates (AND gate (A.B) first, OR gate (A+B), then OR gate (A.B + (A+B)) A B A.B A+B A.B + (A+B) 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 1 1 1 1 1 Draw Logic Circuits from Given Scenarios Example 1 SCENARIO: Ali wants to print his assignment in the library. He can only do so when the ink is available and at the same time, the printer is NOT powered off. He must also be granted permission to do so by the library staff. (a) Write down the Boolean expression for this statement. (b) Create the logic gate schematic diagram for this scenario. Solution: (a) Let A = ink B = power C = permission granted by library staff X = print 32 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
Then, based on the given scenario, we can derive a Boolean expression: X = A.B.C As the power is off by default, a NOT gate is needed to make sure power is on. (b) From Boolean expression above, we can draw the logic circuit. A B C Z Example 2 SCENARIO: A burglar alarm system is to be triggered if a master switch is on and either a light beam is broken or a pressure pad is stood on. Draw (a) a logic diagram and (b) a truth table for this system. Solution: (a) From the description given, there are three inputs: (i) a master switch (M) (ii) a light sensor (L) (iii) a pressure pad (P). There is one output: an alarm bell (B). The bell should go to logic 1 if the master switch is at 1 and either the light beam goes to logic 0 or the pressure pad goes to logic 1. This can be written in Boolean as: B = M.(L+P) As the alarm has to be triggered when the light beam is broken, a NOT gate is needed. So, we need a two-input AND gate that is fed directly from M and also from a two-input OR gate that is fed from L (through an inverter) and P. The logic diagram is shown below. M P L L L+P B 33 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
(b) The truth table for this system is shown below: M L P L L+P B M . (L+P) 0 0 0 1 1 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 1 0 1 1 Again, all we have to do is read the specifications carefully and then read across each row, one at a time, and decide whether the bell should be ringing or not. There are some shortcuts. For example, in the first four rows the master switch is off; therefore, the bell must be at logic 0 – even if there is a burglar in the house. Quick Check 1.4(b) 1 Write a Boolean expression and build the truth table based each logic diagram below. (a) (b) (c) 2 Draw a circuit diagram corresponding to each Boolean expression: (a) Q = (A.B) + ((B + C).(B.C)) (b) Q = (A.B) + (A.C) A X B C A X B A B C X 34 Mid Semester Test 1 Topic 1 Answers Computer System PENERBIT ILMU BAKTI SDN. BHD.
3 Given the Boolean expression of D = A'B + (B+C)', (a) draw the logic circuit, (b) complete the truth table. A B C A' A'B (B+C)' A'B+(B+C)' 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 4 Based on the Boolean expression, Y = (A'C + BC')' , (a) construct the truth table, (b) illustrate the logic circuit. 5 During the COVID-19 pandemic, students who take online classes were allowed to come to the college to take their personal belongings if they do not reside in a Red zone, do not have any symptoms of fever, and they have completed the provided form. What is the Boolean expression that will represent the above scenario given the legend below? Y : Students can come to the college A : Students from the Red zone B : Students have symptoms of fever C : Students fill in the provided form 35 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Summative Practice 1 1 The following diagram shows an Information Processing Cycle. A B C D (a) Explain the meaning of component A. (b) Explain the meaning of component D. 2 Information processing is of vital importance in today's business activities. Miss Bella sells scarves to three customers. All of the customers make payment at the same time. The first customer deposits RM100 and the second customer deposits RM220 into Miss Bella’s account at two different ATM machines. Her third customer paid RM100 by cash at her shop. Miss Bella's account balance before those transactions is RM200. Analyse the process and storage of Miss Bella's bank account during that time. Information Processing Activity Process Storage 3 The receipt below shows a transaction made at a sport outfit outlet, Sport Planet Warehouse. Identify the suitable elements for the input, process and output of this transaction. Operation Element (a) Input (b) Process (c) Output SPORT PLANET WAREHOUSE SUBANG PARADE SUBANG JAYA 18/03/2024 Cashier:Ravi 15:30:08 No:0010018658 -------------------------------------- Item Qty Price Amt -------------------------------------- Round Neck Shirt 2 15.00 30.00 Total Qty 2 -------------------------------------- TOTAL AMOUNT : 30.00 CASH : 50.00 CHANGE : 20.00 GOODS SOLD ARE NOT RETURNABLE THANK YOU FOR YOUR PURCHASE 36 Mid Semester Test 1 Answers Topic 1 PENERBIT ILMU BAKTI SDN. BHD.
4 Eman parked his car at a shopping complex parking lot. Before leaving, he paid his parking fees using the auto-pay machine. Choose the best explanation of the input operation based on the above scenario. A The machine will read the card entered by user. B The machine will record the date and time accepted on the card. C The machine will accept the date and time recorded on the card. D The machine will capture the time entered and the time of exit on the card. 5 Explain briefly how digital data is being represented in a computer. 6 State three benefits of using binary digits to represent data in computers. 7 Rina wants to compress her 1110011012 MB file. Convert the size of her file to a decimal numbering system. Show your working. 8 Determine whether the given binary number 1100111002 is odd or even. Show your work. 9 Show the conversion of the decimal 155 to a binary number. 10 Show the conversion of the decimal 102 to binary number. 11 Convert 3563110 to hexadecimal. Show your calculations. 12 The decimal 205 in hexadecimal is A CD16 B BE16 C BD16 D CE16 13 Find the missing number from the given sequence of hexadecimal numbers. F116, F616, FB16 , , 10516 14 Convert A3D16 to a decimal number. Show your calculations. 15 Convert 11111012 to hexadecimal. Show your calculations. 16 Convert 1110111010101012 to hexadecimal. Show your calculations. 17 Convert 1FD16 to binary. Show your calculations. 18 Convert 4ECA16 to binary. Show your calculations. 19 Based on the words below, how many bits and bytes have been used in the ASCII system? Olympic Tokyo 2020! 20 Differentiate the three types of coding scheme based on number of bits, characters representation and their uses in computers. 37 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
21 In order for Ahmad to register for the Data Structure (C1) course, he must pass two prerequisite courses, Fundamental Programming (C2) and Object Oriented Programming (C3). However, he can register for Data Structure (C1) straight away if he has passed Advanced Programming (C4). (a) Derive the truth table from the above scenario. (b) Derive the Boolean expression from the above scenario. 22 Based on the following logic circuit, determine the Boolean expression. A B C Y 23 Based on Boolean expression R = (XY + Z)', find all possible input combinations of X, Y and Z that result in output R = 1. 24 The following diagram shows a logic circuit. F A B C Which of the following inputs of A, B and C will produce output 1 for F in the given circuit? A A = 1, B = 1, C = 0 B A = 0, B = 0, C = 1 C A = 0, B = 1, C = 1 D A = 1, B = 0, C = 0 38 Mid Semester Test 1 Answers Topic 1 Computer System PENERBIT ILMU BAKTI SDN. BHD.
Internet Technology TOPIC2 39 ● Explain the concept of network. UPS ● Identify examples of communication devices and types of transmission media used in a network. UPS ● Describe the advantages and disadvantages of a network. UPS Learning Outcomes 1 The Internet is a worldwide network of interconnected computers and other electronic devices, giving users access to a vast treasure trove of information. By subscribing to the services of an Internet Service Provider (ISP), we can connect our computers and mobile devices to the Internet. 2 Many other devices and appliances are embedded with sensors that transmit data to and from the Internet. The term Internet of Things (or IoT) refers to the network of connected devices and the technology that facilitates communication between the devices. These smart devices include smart TVs, smartwatches, fitness trackers, and home security systems. 3 To understand how Internet technology works, we should start with the basic concept of the “computer network”. 4 Computer networks allow computers and devices to share resources, such as hardware, software, data and information, with each other. A computer network refers to a set of computers and devices connected together via communications devices and transmission media. 2.1 Basic Concept of Network PENERBIT ILMU BAKTI SDN. BHD.
5 The interconnected devices can exchange data and share resources with each other over a communication system, as illustrated in Figure 2.1. Figure 2.1 A simplified example of a communication system Communications 1 The process in which two or more computers or devices transfer data, instructions and information is known as digital communications. Today, even the smallest computers and devices can communicate directly with one another, or with hundreds of computers on a corporate network, or with millions of other computers around the globe, often via the Internet. 2 While some communications involve cables and wires, others are sent wirelessly through the air. For successful communications, you need the following: (a) A sending device that initiates an instruction to transmit data, instructions, or information (b) A communications device that connects the sending device to transmission media (c) A transmission media, or a communications channel, on which the data, instructions, or information travel (d) A communications device that connects the transmission media to a receiving device (e) A receiving device that accepts the transmission of data, instructions, or information Sending device Communication channel or Transmission media Communication device Communication device Receiving device Figure 2.2 Communication system devices 1 4 5 6 7 8 3 2 Sending and receiving devices include: 1 servers, 2 desktops, 3 laptops, 4 tablets, 5 smartphones and headsets, 6 portable media players, 7 handheld game devices, and 8 GPS receivers in vehicles. Transmission media consist of: phone and power lines, cable television and other underground lines, microwave stations, and satellites. 40 Mid Semester Test 1 Topic 2 Answers Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
Communications Devices 1 There are different kinds of communications devices. Communications devices are any type of hardware capable of transmitting data, instructions, and information between a sending device and a receiving device. 2 Some common examples include modems, wireless access points (WAP), routers, network cards, and hubs or switches. These are briefly described here. Modems 1 Modems convert (or "modulate and demodulate") an analogue signal to and from a telephone or cable wire to a digital signal that a computer can recognise. The word "modem" is derived from the term "modulator-demodulator”. Figure 2.3 A modem transforms digital signals from a computer into analogue signals that can be sent through telephone lines, coaxial cabels and other types of wire 2 Figure 2.4 illustrates how modems can be used to connect your home to the Internet via a telephone connection. Computer Modem Telephone Modem Terminal Figure 2.4 Modems can send and receive data over telephone lines 3 Modems help to make connections with computers, or other hardware components like switches or routers, for linking to the Internet (as depicted in Figure 2.5). Internet Modem Router Phone Tablet Computer Figure 2.5 Modems link devices to the Internet (while the router is used to create a network in your home or office) 4 The different types of modem that may be used in computer networking are briefly outlined here: 41 Mid Semester Test 1 Answers Topic 2 Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
(a) Cable modem: A cable modem connects you directly to your ISP using a coaxial cable. (b) ADSL modem: ADSL stands for “Asymmetric Digital Subscriber Line” and it uses the telephone line for sending and receiving all information. (c) DSL modem: DSL stands for “Digital Subscriber Line”, and it is also known as “broadband modem“. DSL modems offer broadband services using different types of Internet connections. (d) ISDN modem: ISDN stands for “Integrated Services Digital Network”, and it provides communication standards for the use of digital transmission of voice, video data over wire or optical fibre. (e) External modem: An external modem is a standalone modem that does not contain a router. It can, but is rarely, attached directly to a computer via USB, Ethernet or sometimes Wi-Fi connection. Usually, it is attached to a separate router so you can share your connection with multiple network nodes around the home or office. (f) Router/Modem combo: A router/modem combo is a modem that is contained within a router, allowing multiple computers or devices to connect within one network. It is a fairly common technology nowadays as it means networks do not need a separate modem or router. (g) Wireless modem: This is a modem that bypasses the telephone system and connects directly to a wireless network, through which it can directly access the Internet connectivity provided by an Internet Service Provider (ISP). Wireless Access Points (WAP) 1 A wireless access point (WAP) is a central communications device that allows computers and devices to transfer data wirelessly among themselves or to a wired network using wireless technologies, such as Wi-Fi (wireless fidelity). 2 A wireless access point either connects to a router via an Ethernet or other cable, or is part of a router. Figure 2.6 A Wireless Access Point (WAP) is a device that allows wireless-capable devices to connect to a wired network Routers 1 A router is a communications device that connects multiple computers or other routers together and transmits data to its correct destination on a network. Figure 2.7 A router manages traffic between different computers or networks, enabling multiple devices to use the same Internet connection 42 Mid Semester Test 1 Topic 2 Answers Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
2 There are different types of routers: (a) A wireless router is a device that performs the functions of a router and also a wireless access point. (b) A broadband router is a device that performs the functions of a router and also a broadband modem. 3 Figure 2.8 illustrates how a router is used to allow different networks to use the same Internet connection. Internet Modem Combination modem / router /WAP Figure 2.8 Through a router, home and small business networks can share access to a broadband Internet connection, such as through a cable or DSL modem Network Cards 1 A network card enables a computer or device that does not have built-in networking capability to access a network. It is sometimes called a network interface card (or NIC, pronounced “nick”). 2 The network card coordinates the transmission and receipt of data, instructions and information to and from the computer or device containing the network card. Figure 2.9 A network card for a desktop computer lets the computer exchange data with a network Hubs or Switches 1 Hubs and switches are devices that provide a central point for cables in a network. It allows us to connect multiple PCs to a single network (as illustrated in Figure 2.10). Hub or switch Figure 2.10 A hub or switch is a central point that connects several devices in a network together, as well as connects to other networks 43 Mid Semester Test 1 Answers Topic 2 Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
2 A hub may be based on Ethernet, Firewire, or USB connections. However, unlike a router, a hub does not manage the traffic intelligently. A network hub has no routing tables or intelligence on where to send information; it broadcasts all network data across each connection. 3 A switch, on the other hand, connects devices on a computer network by using packet switching to receive, process, and forward data to the destination device only. It manages a network between multiple devices smartly. In contrast to the hub, it reviews the packets of data and directs them just to the right one. Hub Switch Figure 2.11 A hub transmits data from network to another in the form of binary bits but a switch transmits data in the form of packets Transmission Media 1 Transmission media refers to the material or substances that are capable of carrying one or more communication signals. 2 Transmission media generally fall into two categories: (a) Physical/wired transmission media (b) Wireless transmission media Physical/Wired Transmission Media 1 Physical/Wired transmission media use wire, cable, and other tangible materials to send communications signals. 2 Examples of wired transmission media include the following: (a) Twisted-pair cable A twisted-pair cable consists of one or more twisted-pair of wires bundled together. A twisted pair usually consists of two copper wires, each with plastic insulation, that are twisted together to reduce noise (electrical interference by adjacent wires). Figure 2.12 A twisted-pair cable consists of one or more twisted-pair wires (b) Coaxial cable A coaxial cable, often referred to as coax (pronounced KO-ax), consists of a single copper wire surrounded by at least three layers: (1) an insulating material, (2) a woven or braided metal, and (3) a plastic outer coating. Cable TV network wiring often uses coaxial cables as they can be cabled over longer distances than the twisted-pair cable. Data packets are chunks of data (small segments of a larger message) that are transferred through the best route available over a computer network. Smart Tips! 44 Mid Semester Test 1 Topic 2 Answers Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
Outer wrapper Braided shield Dielectric (insulating material) Main Foil shield (prevents electrical interference) Figure 2.13 Coaxial cables are used by cable TV companies to connect satellite antenna facilites to their customers (c) Fibre-optic cable A fibre-optic cable contains dozens or hundreds of thin strands of glass or plastic that transmit communication signals using pulses of light. Each strand, called an optical fibre, is as thin as a human hair. An insulating glass cladding and a protective coating surround each optical fibre. Buffer Coating Jacket Cladding Core Figure 2.14 A fibre-optic cable consists of very thin strands of glass or plastic fibres inside an insulated casing Table 2.1 summarises the advantages and disadvantages of fibre-optic cables compared to cables that use wire, such as the twisted-pair and coaxial cables. Table 2.1 Advantages and disadvantages of fibre-optic cables over wired media Advantages of fibre-optic cables • Capability of carrying significantly more signals than wire cables • Faster data transmission. • Less susceptible to noise (interference) from other devices, such as a copy machine. • Better security for signals during transmission because they are less susceptible to noise. • Smaller size (much thinner and lighter in weight). Disadvantages of fibre-optic cables • Costs more than twisted-pair or coaxial cables and can be difficult to install and modify. • Nevertheless, many phone companies replaced original analogue phone lines with fibre-optic cables, enabling them to offer fibre-optic Internet access to home and business users. Businesses also use fibre-optic cables in high-traffic networks or as the backbone of a network. Wireless Transmission Media 1 Wireless transmission media send communications signals through the air or space, for example, through radio waves. 45 Mid Semester Test 1 Answers Topic 2 Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
2 Many users opt for wireless transmission media as it is more convenient than installing cables. In addition to convenience, businesses use wireless transmission media in locations where it is impossible to install cables. 3 Examples of wireless transmission media include infrared, broadcast radio, cellular radio, microwaves and communication satellites. (a) Infrared waves Infrared (IR) is a wireless transmission medium that sends signals using infrared light waves. IR transmission uses line-of-sight propagation. Figure 2.15 A remote control is used to operate a television or other electronic equipment using infrared light (b) Broadcast radio Broadcast radio is a wireless transmission medium that distributes radio signals through the air over long distances, such as between cities, regions, and countries, and short distances such as within an office or home. Examples of broadcast radio transmission include Bluetooth, UWB, Wi-Fi, WiMAX. Figure 2.16 Radio broadcast towers convert audio and video signals from a TV or radio station into data streams that are beamed into the air on their assigned frequency or channel (c) Cellular radio • Cellular radio is a form of broadcast radio that is widely used for mobile communications, specifically wireless modems and mobile phones. • A mobile phone uses high-frequency radio waves to transmit voice and digital data messages. The area to be covered in a cellular radio system is divided into smaller areas called cells, with a radio base station located in each cell. This is illustrated in Figure 2.17. • Because only a limited number of radio frequencies exist, mobile service providers reuse frequencies or channels in different cells to accommodate a large number of users. Amplifiers or boosters are also installed to improve the signal strength. Infrared (IR) waves refer to electromagnetic waves having frequencies in the range of 300 GHz to 400 THz. Smart Tips! 46 Mid Semester Test 1 Topic 2 Answers Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
Base station Public switched telephone network Mobile telephone switching office (MTSO) Cell Cell Cell Calling party in car Figure 2.17 As a person with a mobile phone drives from one cell to another, the radio signals transfer from the base station (microwave station) in one cell to a base station in another cell (d) Microwaves • Microwaves are radio waves that provide a high-speed signal transmission. • Microwave transmission, often called fixed wireless, involves sending signals from one microwave station to another. • A microwave station is an earth-based reflective dish that contains the antenna, transceivers, and other equipment necessary for microwave communications (as depicted in Figure 2.18). • As with infrared, microwaves use line-of-sight transmission. To avoid possible obstructions, such as buildings or mountains, microwave stations often sit on the tops of buildings, towers, or mountains. • Microwave transmission typically is used in environments where installing physical transmission media is difficult or impossible and where line-of-sight transmission is available. For example, microwave transmission is used in wide-open areas, such as deserts or lakes, between buildings in a close geographic area, or to communicate with a satellite. Radio link Microwave link Base Station Figure 2.18 A microwave station is a ground-based reflective dish that contains the antenna, transceivers, and other equipment necessary for microwave communications 47 Mid Semester Test 1 Answers Topic 2 Internet Technology PENERBIT ILMU BAKTI SDN. BHD.
(e) Communications satellite • A communications satellite is a space station that receives microwave signals from an earth-based station, amplifies (strengthens) the signals, and broadcasts the signals back over a wide area to any number of earth-based stations. • These earth-based stations often are microwave stations. Other devices, such as smartphones and GPS receivers, can also function as earthbased stations. • Transmission from an earth-based station to a satellite is an uplink. Transmission from a satellite to an earth-based station is a downlink. • Applications such as air navigation, television and radio broadcasts, weather forecasting, videoconferencing, paging, GPS, and Internet connections use communications satellites. • With the proper satellite dish and a satellite modem, consumers can access the Internet using satellite technology. With satellite Internet connections, however, uplink transmissions usually are slower than downlink transmissions. Earth Earth stations Communications satellites have solar panels to harness the Sun’s energy. Satellite Figure 2.19 Communications satellites are placed 35 786 km (about 22 300 miles) above the Earth’s equator in a circular orbit Reasons to Use Networks 1 A network can be internal to an organisation or span the world by connecting to the Internet. Many home and business users create a network to facilitate communications, share hardware, share data and information, share software, and transfer funds. 2 Advantages of using networks (summarised in Figure 2.20): (a) Help people communicate efficiently and easily via email, online social networks, instant messaging and others. (b) Devices such as a printer can be shared and used by multiple users; thus, saving cost. (c) Files or documents stored on a network can easily be shared between users. (d) Users connected to a network can access shared software on the network. (e) Electronic funds transfer (EFT) allows users connected to a network to transfer money from one account to another such as online banking. (f) Data can be easily backed and stored on the file server. 48 Mid Semester Test 1 Topic 2 Answers Internet Technology PENERBIT ILMU BAKTI SDN. BHD.