Digital Computer fundamentals lecture notes

what is digital computer fundamentals and lecture notes on computer architecture and organisation | pdf free download
Dr.HenryEvans Profile Pic
Dr.HenryEvans,Germany,Professional
Published Date:10-07-2017
Your Website URL(Optional)
Comment
1 Name of the Course: PGDCA Title of the Paper: Digital Computer Fundamentals and Computer Architecture No. of Units: 5 Unit I: Lesson 1,2,3,4 Unit II: Lesson 5,6,7,8 Unit III: Lesson 9,10,11,12 Unit IV: Lesson 13, 14,15,16,17 Unit V: Lesson 18,19,20,21 Digital Computer Fundamentals and Computer Architecture PGDCA SDE 2 UNIT –I Lesson 1 : Binary Systems, Digital Computers and Digital Systems Contents: 1.0 Aims and Objectives 1.1 Introduction 1.2 Binary Systems 1.2.1 Digital Computers and Digital Systems 1.2.2 Binary Numbers 1.3 Let us Sum Up 1.4 Lesson-end Activities 1.5 Points for discussions 1.6 References 1.0 Aims and Objectives The main objective of this lesson is to learn the block diagram of a digital computer and various processing units in it. The concept of Binary numbers and its representation is discussed. 1.1 Introduction Digital computers have made possible scientific, industrial and commercial advancement rapidly. A program is a sequence of instructions. Discrete elements of information are represented in a digital system by physical quantities called signals. The representation of decimal numbers and binary numbers and the explanations of base or radix are given. 1.2 Binary Systems 1.2.1 Digital Computers and Digital Systems  A computer is a programmable device, usually electronic in nature that can store, retrieve, and process data.  A computer that stores data in terms of digits (numbers) and proceeds in discrete steps from one state to the next is called as digital computer.  The most striking property of a digital computer is a generality.  It can follow a sequence of instructions.  The user can specify and change programs and/or data according to the specific need.  As a result of this flexibility, general purpose digital computers can perform a wide variety of information-processing tasks. 3 Digital System  Characteristics of a digital system is its manipulation of discrete elements of information.  Such discrete elements may be electric impulses, the decimal digits, and the letters of an alphabet, arithmetic operations, punctuation marks, or any other set of meaningful symbols.  A sequence of discrete elements forms a language.  Early digital computers were used mostly for numeric computations.  In this case, discrete elements used are the digits.  Discrete elements of information are represented in a digital system by physical quantities called signals.  The signals in all present-day electronic digital system have only two discrete values and are said to be binary.  To make use of binary signals, digital system is constructed with transistor circuit that is either ON or OFF has two possible signal values and can be constructed to be extremely reliable.  To simulate physical process in a digital computer, the quantities must be quantized.  When the variables of the process are presented by real-time continuous signals, the latter are quantized by an analog-to-digital conversion device.  A physical system whose device is described by mathematical equations is simulated in a digital computer by means of numerical methods.  When the problem to be processed is inherently discrete, as in commercial applications, the digital computer manipulates the variables in their natural form. Control Unit  The control unit (often called a control system or central controller) directs the various components of a computer.  It reads and interprets (decodes) instructions in the program one by one.  The control system decodes each instruction and turns it into a series of control signals that operate the other parts of the computer.  Control systems in advanced computers may change the order of some instructions so as to improve performance. Memory, Processor, I/O Unit  The memory unit stores programs as well as input, output, and intermediate data.  The processor unit performs arithmetic and other data-processing tasks as specified by a program.  The input and output devices are special digital systems driven by electromechanical parts and controlled by electronic digital circuits.  An electronic calculator is a digital system similar to a digital computer, with the input device being a keyboard and the output device a numerical display.  A digital computer, however, is a more powerful device than a calculator. 4  A digital computer can accommodate many other input and output devices; it can perform not only arithmetic computations, but logical operations as well and can be programmed to make decisions based on internal and external conditions.  A digital computer is an interconnection of digital modules. Figure 1.1 A block diagram of the Digital Computer 1.2.2 Binary Numbers The number system followed by computers  Base is two and any number is represented as an array containing 1’s and 0’s representing coefficients of power of two.  Used in computer systems because of the ease of representing 1 and 0 as two levels of voltage/power – high and low Numbers can be expressed using many representations. For eg: 15 - Decimal 1111 – Binary F – Hexadecimal 17 - Octal Base or Radix of a number is the number of different digits which can occur at each position in the number system Counting is done with reference to a Base  Decimal has base of Ten  Binary has base of Two  Octal has base of Eight  Hexadecimal has base of Sixteen 5 Decimal 0,1,2,3….9 Octal 0,1,2,3,…..7 Binary 0,1 Hexadecimal 0-9,A-F Position value of a digit is determined by its position in the number. Position value of 1 in 100 is different from that of 1 in 10 In 1002, 1 is the most significant digit and 2 is the least significant digit Position values can be found by raising the base of the number system to the power of the position 3 Position value of 1 in 1002 is 10 A number with a decimal point is represented as A a a a a a a . a a a 6 5 4 3 2 1 0 - 1 - 2 - 3 Example : 3456.789 Decimal Binary Octal Hexadecimal 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 0011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F Table 1.1 Numbers with Different Bases 1.3 Let us Sum Up The block diagram of digital computer and its various units has been explained. The concept of binary term has been discussed as on or off state. The numbers with different bases has been depicted in the form of table. 6 1.4 Lesson-end Activities 1. With a neat diagram, explain the components of a digital computer. 2. Write short notes on number systems. 1.5 Points for discussions Various units of block diagram of digital computer. 1.6 References  http://poppy.snu.ac.kr/kchoi/class/lc_intro/number_sys.pdf.  http://www.ncb.ernet.in/education/modules/mfcs/resources/BinaryNumberSys tems.pdf.  http://www.danbbs.dk/erikoest/binary.htm 7 Lesson 2 : Number Base Conversions, Octal and Hexadecimal Numbers Contents: 2.0 Aims and Objectives 2.1 Introduction 2.2 Number Base Systems 2.2.1 Decimal Number Base Systems 2.2.2 Octal Number Base Systems 2.2.3 Hexadecimal Number Base Systems 2.2.4 Number Base Conversion 2.2.4.1 Decimal to Binary Conversion 2.2.4.2 Binary to Decimal Conversion 2.2.4.3 Binary to Octal Conversion 2.2.4.4 Octal to Binary Conversion 2.2.4.5 Octal to Decimal Conversion 2.2.4.6 Decimal to Octal Conversion 2.2.4.7 Hexadecimal to Binary Conversion 2.2.4.8 Binary to Hexadecimal Conversion 2.2.4.9 Hexadecimal to Decimal Conversion 2.2.4.10 Decimal to Hexadecimal Conversion 2.3 Let us Sum Up 2.4 Lesson-end Activities 2.5 Points for discussions 2.6 References 2.0 Aims and Objectives The aim of this lesson is to perform conversion between one base to another base and to gain knowledge about number system. 2.1 Introduction A binary number can be converted to decimal by forming the sum of powers of each part done separated of 2 of those co-efficient whose value is 1. The conversion from decimal to binary or to any other base-r system is more convenient if the number is separated into an integer part and a fraction part and the conversion 2.2 Number Base Systems 2.2.1 Decimal Number Base Systems The Decimal Number System uses base 10. It includes the digits from 0 through 9. The weighted values for each position is as follows: 104 103 102 101 100 10-1 10-2 10-3 10000 1000 100 10 1 .1 .01 .001 The number 123 represents: 1 102 + 2 101 + 3 100 = 8 1 100 + 2 10 + 3 1 = 100 + 20 + 3 = 123 Each digit appearing to the left of the decimal point represents a value between zero and nine times power of ten represented by its position in the number. Digits appearing to the right of the decimal point represent a value between zero and nine times an increasing negative power of ten. For example, the value 725.194 is represented as follows: 7 102 + 2 101 + 5 100 + 1 10-1 + 9 10-2 + 4 10-3 = 7 100 + 2 10 + 5 1 + 1 0.1 + 9 0.01 + 4 0.001 = 700 + 20 + 5 + 0.1 + 0.09 + 0.004 = 725.194 2.2.2 Octal Number Base Systems The Octal Number System:  uses base 8  includes only the digits 0 through 7 (any other digit would make the number an invalid octal number) The weighted value for each position is as follows: 85 84 83 82 81 80 32768 4096 512 64 8 1 2.2.3 Hexadecimal Number Base Systems When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal (base 16) numbering system solves these problems. Hexadecimal numbers offer the two features:  hex numbers are very compact  it is easy to convert from hex to binary and binary to hex. A different method is required to enter a hexadecimal numbers into the computer system. The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0, and we place an H at the end of the number to denote the number base. The Hexadecimal Number System:  uses base 16  includes only the digits 0 through 9 and the letters A, B, C, D, E, and F In the Hexadecimal number system, the hex values greater than 9 carry the following decimal value: 9 Binary Octal Decimal Hex 0000B 00Q 00 00H 0001B 01Q 01 01H 0010B 02Q 02 02H 0011B 03Q 03 03H 0100B 04Q 04 04H 0101B 05Q 05 05H 0110B 06Q 06 06H 0111B 07Q 07 07H 1000B 10Q 08 08H 1001B 11Q 09 09H 1010B 12Q 10 0AH 1011B 13Q 11 0BH 1100B 14Q 12 0CH 1101B 15Q 13 0DH 1110B 16Q 14 0EH 1111B 17Q 15 0FH 10000B 20Q 16 10H 10 2.2.4 Number Base Conversion 2.2.4.1 Decimal to Binary Conversion  Divide the decimal number repeatedly by 2  Reminders form the binary number  First reminder is the least significant digit (LSD) and last reminder becomes the most significant digit (MSD) Representation of 25 in binary system 10 25/2 = 12, reminder = 1 12/2 = 6, reminder = 0 6/3 = 3, reminder = 0 3/2 = 1, reminder = 1 1/ = 0, reminder = 1 25 = 11001 10 2 Decimal  Binary(base 2) e.g. convert (41.375)10 to binary representation 1. Integer part Method: Coefficients obtained from remainders of successive division by 2. The first remainder is the least significant bit(LSB) and the last remainder is the most significant bit(MSB). (41)10 = (101001)2 41/2 =20 rem 1 20/2 =10 rem 0 10/2 =5 rem 0 5/2 =2 rem 1 2/2 =1 rem 0 11 1/2 =0 rem 1 Hence result: (101001)2 2. Fractional part Method: Coefficients of binary fraction obtained by successive multiplication of decimal fraction by 2. Coefficient will appear as integer portion of successive multiplication. (.375)10 = (.011)2 .375 x 2 = 0.75 0 MSB .75 x 2 = 1.5 1 .5 x 2 = 1.0 1 LSB Hence result: (.011)2 In general: Decimal  Base r - whole number: repeated division by r - fractions : repeated multiplication by r 2.2.4.2 Binary to Decimal Conversion It is very easy to convert from a binary number to a decimal number. Just like the decimal system, we multiply each digit by its weighted position, and add each of the weighted values together. For example, the binary value 1100 1010 represents: 127 + 126 + 025 + 024 + 123 + 022 + 121 + 020 = 1 128 + 1 64 + 0 32 + 0 16 + 1 8 + 0 4 + 1 2 + 0 1 = 128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 = 202 2.2.4.3 Binary to Octal Conversion It is easy to convert from an integer binary number to octal. This is accomplished by: 1. Break the binary number into 3-bit sections from the LSB to the MSB. 2. Convert the 3-bit binary number to its octal equivalent. For example, the binary value 1010111110110010 will be written: 001 010 111 110 110 010 1 2 7 6 6 2 2.2.4.4 Octal to Binary Conversion It is also easy to convert from an integer octal number to binary. This is accomplished by: 1. Convert the decimal number to its 3-bit binary equivalent. 2. Combine the 3-bit sections by removing the spaces. 12 For example, the octal value 127662 will be written: 1 2 7 6 6 2 001 010 111 110 110 010 This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in our more readable format. 2.2.4.5 Octal to Decimal Conversion To convert from Octal to Decimal, multiply the value in each position by its Octal weight and add each value. Using the value from the previous example, 127662, we would expect to obtain the decimal value 44978. 185 284 783 682 681 280 132768 24096 7512 664 68 21 32768 8192 3584 384 48 2 32768 + 8192 + 3584 + 384 + 48 + 2 = 44978 2.2.4.6 Decimal to Octal Conversion To convert decimal to octal is slightly more difficult. The typical method to convert from decimal to octal is repeated division by 8. Repeated Division By 8 For this method, divide the decimal number by 8, and write the remainder on the side as the least significant digit. This process is continued by dividing he quotient by 8 and writing the remainder until the quotient is 0. When performing the division, the remainders which will represent the octal equivalent of the decimal number are written beginning at the least significant digit (right) and each new digit is written to the next more significant digit (the left) of the previous digit. Consider the number 44978. Division Quotient Remainder Octal Number 44978 / 8 5622 2 2 5622 / 8 702 6 62 702 / 8 87 6 662 87 / 8 10 7 7662 10 / 8 1 2 27662 1 / 8 0 1 127662 13 2.2.4.7 Hexadecimal to Binary Conversion To convert a hexadecimal number into a binary number, simply break the binary number into 4-bit groups beginning with the LSB and substitute the corresponding four bits in binary for each hexadecimal digit in the number. For example, to convert 0ABCDh into a binary value, simply convert each hexadecimal digit according to the table above. The binary equivalent is: 0ABCDH = 0000 1010 1011 1100 1101 1. Convert the Hex number to its 4-bit binary equivalent. 2. Combine the 4-bit sections by removing the spaces. For example, the hex value 0AFB2 will be written: A F B 2 1010 1111 1011 0010 This yields the binary number 1010111110110010 or 1010 1111 1011 0010 in our more readable format 2.2.4.8 Binary to Hexadecimal Conversion The first step is to pad the binary number with leading zeros to make sure that the the binary number contains multiples of four bits. For example, given the binary number 10 1100 1010, the first step would be to add two bits in the MSB position so that it contains 12 bits. The revised binary value is 0010 1100 1010. The next step is to separate the binary value into groups of four bits, e.g., 0010 1100 1010. Finally, look up these binary values in the table above and substitute the appropriate hexadecimal digits, e.g., 2CA. The weighted values for each position is as follows: 163 162 161 160 4096 256 16 1 It is easy to convert from an integer binary number to hex. This is accomplished by: 1. Break the binary number into 4-bit sections from the LSB to the MSB. 2. Convert the 4-bit binary number to its Hex equivalent. For example, the binary value 1010111110110010 will be written: 14 1010 1111 1011 0010 A F B 2 2.2.4.9 Hexadecimal to Decimal Conversion To convert from Hex to Decimal, multiply the value in each position by its hex weight and add each value. Using the value from the previous example, 0AFB2H, we would expect to obtain the decimal value 44978. A163 F162 B161 2160 104096 15256 1116 21 40960 3840 176 2 40960 + 3840 + 176 + 2 = 44978 2.2.4.10 Decimal to Hexadecimal Conversion The typical method to convert from decimal to hex is repeated division by 16. Repeated Division By 16 For this method, divide the decimal number by 16, and write the remainder on the side as the least significant digit. This process is continued by dividing the quotient by 16 and writing the remainder until the quotient is 0. When performing the division, the remainders which will represent the hex equivalent of the decimal number are written beginning at the least significant digit (right) and each new digit is written to the next more significant digit (the left) of the previous digit. Consider the number 44978. Division Quotient Remainder Hex Number 44978 / 16 2811 2 2 2811 / 16 175 11 B2 175 / 16 10 15 FB2 10 / 16 0 10 0AFB2 Examples 1 0 – 25 = 2 x 10 + 5 x 10 (decimal) 4 3 2 1 0 – 11001 = 1 x 2 + 1 x 2 + 0 x 2 + 0 x 2 + 1 x 2 (binary) 1 0 – 19 = 1 x 16 + 9 x 16 (hexadecimal) 1 0 – 31 = 3 x 8 + 1 x 8 (octal) 15 For floating points: 3 1 -2 -3 -(1010.011) = 2 +2 +2 +2 =(10.375) 2 10 2 -1 - (630.4) =68 +38+48 =(408.5) 8 10 2.3 Let us Sum Up This lesson has discussed various number systems with different base and the conversion from one base to another base has been discussed in detail with examples. 2.4 Lesson-end Activities 1. Convert i. 58.46 ii. 125.09 to binary, octal and hexadecimal number base 10 10 systems. 2. Convert i. 1011.011 ii. 11111.1101 to decimal, octal and hexadecimal number 2 2 base systems. 3. Convert i. 743 ii. 452.016 to binary, decimal and hexadecimal number base 8 8 systems. 4. Convert i. FF.AD ii. BC.EF to binary, octal and decimal number base systems. 16 16 5. Convert the Following 5.1 Binary to Decimal a. 101110 b. 1110101 c. 110110100 d. 1101101.1111 e. 10.100001 5.2 Decimal to Binary a. 1231 b. 673.23 c. 175 d. 1998 e. 12.45 5.3 Decimal to Octal a. 7562 b. 225.225 5.4 Octal to Decimal a. 623.77 5.5 Decimal to Hexadecimal a. 1938 b. 222.225 5.6 Hexadecimal to Decimal a. 2AC5.D 5.7 Hexadecimal to Octal and Binary a. F3A732 5.8 Octal to hexadecimal a. 623.77 5.9 Hexadecimal to octal a. 2AC5.D 16 2.5 Points for discussions  Conversion from one base to another base  Different number systems 2.6 References  http://poppy.snu.ac.kr/kchoi/class/lc_intro/number_sys.pdf.  http://www.ncb.ernet.in/education/modules/mfcs/resources/BinaryNumberSys tems.pdf.  http://www.danbbs.dk/erikoest/binary.htm 17 Lesson 3 : Complements, Binary Codes Contents: 3.0 Aims and Objectives 3.1 Introduction 3.2 Complements 3.2.1 Diminished Radix Complement 3.2.2 Radix Complement 3.2.3 Subtraction using R’s Complement 3.2.4 Subtraction using (R-1)’s Complement 3.2.5 Calculation of 2’s Complement 3.2.6 2’s Complement. 3.2.6.1 2’s Complement Addition 3.2.6.1 2’s Complement Subtraction 3.2.1.7 1’s Complement 3.3 Let us Sum Up 3.4 Lesson-end Activities 3.5 Points for discussions 3.6 References 3.0 Aims and Objectives The main objective of this lesson is to learn the concepts of complementary subtraction such as 1’s and 2’s 3.1 Introduction Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation. Various complementary methods are diminished radix and radix complement. The concept of 9’s, 10’s 1’s and 2’s complementary subtraction have been discussed in this lesson. 3.2 Complements Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation. There are two types of complements  Diminished Radix (or r-1’s) complement  Radix (or r’s) complement 3.2.1 Diminished Radix Complement Given an n-digit number, (N)r, its (r-1’s) complement is: n (r – 1) – N e.g. The (r-1’s) complement, or 9s complement of (15)10 is: 2 (10 – 1) – 15 = 99 – 15 = (84)9s 18 The (r-1’s) complement, or 7s complement of (327)8 is: 3 (8 – 1) – (327)8 = 777 – 327 = (450)7s 3.2.2 Radix Complement Given an n-digit number, (N)r, its r’s complement is: n r – N e.g. The r’s complement, or 10s complement of (15)10 is:10 – 15 = 100 – 15 = (85)10s Technique is use: (r-1’s) complement + 1 e.g. The 8s complement of (57)8 is: 2 (8 – 1) – (57)8 = 77 – 57 (7s complement) = (20)7s + 1 (add 1) = (21)8s (8s complement) 3.2.3 Subtraction using R’s Complement Technique: Given 2 unsigned base-r numbers, M & N, Subtraction of (M–N) is done by: n n 1. add M to the r-complement N: M + (r – N) = (M–N) + r n 2. if M = N, then there will be an end-carry r . So discard this end carry. 3. if M N, then there is no end carry. To get the normal form, take r’s n n complement to get: r - ((M-N) + r ) = N-M. Then put MINUS sign in front. e.g. 2 (33)10 – (22)10 = 33 + (10 - 22)10s = (33 + 78)10s = (111)10s (discard end carry) = (11)10 2 (10)10 – (22)10 = 10 + (10 – 22)10s = (10 + 78) 1 2 0 s = (88)10s (no end carry, so complement it) 2 2 = – (10 –88)10 = – (12)10 3.2.4 Subtraction using (R-1)’s Complement Technique: Given 2 unsigned base-r numbers, M & N, Subtraction of (M–N) is done by: n n 1. add M to the r-complement N: M + (r – 1 – N) = (M–N) + r n 1. if M N, then there will be an end-carry r . So discard this end carry and add 1 to get: (M–N–1) + 1 = M – N n 2. if M = N, then there is no end carry, but have –ve result(incl 0): (M-N-1)+ r n n n n To get the normal form, take (r-1) complement to get: (r – 1) – ((M–N) + r ) = N-M. Then put MINUS sign in front(if result is not 0). 19 e.g. (33)10 – (22)10 = 33 +(99-22)9s = (33 + 77)9s = (110)9s (discard end carry, add 1) = (10 +1)10 = (11)10 (10)10 – (22)10 = 10 + (99 – 22)9s = (10 + 77)9s = (87)9s (no end carry, so complement it) = -(99 – 87)10 = -(12)10 3.2.5 2’s Complement To calculate the 2's complement of an integer, invert the binary equivalent of the number by changing all of the ones to zeroes and all of the zeroes to ones (also called 1's complement), and then add one. For example, 0001 0001(binary 17) 1110 1111(two's complement -17) NOT(0001 0001) = 1110 1110 (Invert bits) 1110 1110 + 0000 0001 = 1110 1111 (Add 1) 3.2.6.1 2’s Complement Addition Two's complement addition follows the same rules as binary addition. For example, 5 + (-3) = 2 0000 0101 = +5 + 1111 1101 = -3 0000 0010 = +2 3.2.6.2 2’s Complement Subtraction Two's complement subtraction is the binary addition of the minuend to the 2's complement of the subtrahend (adding a negative number is the same as subtracting a positive one). 20 For example, 7 - 12 = (-5) 0000 0111 = +7 + 1111 0100 = -12 1111 1011 = -5 3.2.7 1’s Complement Given an n-bit number, x, its negative number can be obtained in 1s complement representation using: n –x = 2 – x –1 e.g. given an 8-bit number: – (01001100)2 = – (96)10 8 = (2 – 96 – 1) 10 =(159)10 =(10110011)1s Technique is INVERT all bits.(10 or 0 1) – (01010101)2 = (10101010)1s Note, given a positive n-bit binary number, its 1s complement representation is still the same as the binary number. e.g. +(00011001)2 = (00011001)1s 2s Complement Given an n-bit binary number, x, its negative number can be obtained in 2s complement representation using: n –x = 2 – x e.g. given an 8-bit number: – (01001100)2 = –(96)10 8 = (2 – 96)10 = (160)10 = (10110100)2s Technique is INVERT all the bits and ADD 1 e.g. –(01010101)2 = (10101010)1s (invert) = (10101011)2s (add 1) Note: Given a positive n-bit number, its 2s complement representation is still the same as the binary number. e.g. +(00100100)2 = (00100100)2s

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.