Presentation is loading. Please wait.

Presentation is loading. Please wait.

End Show UNIT – 2Data Representation and Internal Operations of the Computer.

Similar presentations


Presentation on theme: "End Show UNIT – 2Data Representation and Internal Operations of the Computer."— Presentation transcript:

1 End Show UNIT – 2Data Representation and Internal Operations of the Computer

2 End Show Unit 2 – Data Representation and Internal Operations of the Computer 2.1Introduction to Number SystemsIntroduction to Number Systems 2.2Data RepresentationData Representation 2.3Logic Gates and CircuitsLogic Gates and Circuits 2.4Boolean AlgebraBoolean Algebra

3 End Show Some ancient numerals

4 End Show Some ancient numerals

5 End Show Egyptian 3 rd Century BC

6 End Show Some ancient numerals

7 End Show Cretan BC

8 End Show Englands five-barred gate

9 End Show The Greek Numeral System

10 End Show Computation with Greek Numeral System Indo-Arabic

11 End Show Roman Numerals 1I20 XX 2II25XXV 3III29XIX 4IV50L 5V75LXXV 6VI100C 10X500D 11XI1000M 16XVI Now try these: 1. XXXVI 2. XL 3. XVII 4. DCCLVI 5. MCMLXIX

12 End Show 5 What is this ? This is also a symbol Why do we use this symbol ? To represent quantity Five (5)

13 End Show Symbols to represent certain quantities

14 End Show How do you represent this quantity on a spike abacus? 0 000

15 End Show 1 00 How do you represent this quantity

16 End Show How Represent This Quantity 200

17 End Show How Represent This Quantity 300

18 End Show How Represent This Quantity 400

19 End Show How Represent This Quantity 500

20 End Show How Represent This Quantity 600

21 End Show How Represent This Quantity 700

22 End Show How Represent This Quantity 800

23 End Show How Represent This Quantity 900

24 End Show How Represent This Quantity 900

25 End Show How Represent This Quantity 010

26 End Show How Represent This Quantity 010

27 End Show How Represent This Quantity 110

28 End Show How Represent This Quantity ……… 10 2

29 End Show Abacus Roman Abacus Chinese Abacus Japanese Soroban (Abacus) Abacus is a Latin word, related to the Greek abax, meaning table. The word `calculus originally meant pebble in Latin, used on the counting board.

30 End Show 2.1 – Introduction to the Number System A number system defines a set of symbols used to represent quantity. Quantifying values and items in relation to each other is helpful us to make sense of our environment. The study of number system is not just limited to computers. We use numbers every day. A computer manipulates and stores numbers inside the computer system.

31 End Show Why we learn it? These symbols are processed internally by components that can maintain a limited number of discrete states. To represent these states we have to use number systems. –Ex: The decimal digits 0,1,2, …..,9 provide 10 discrete symbols ( 10 digits )

32 End Show Decimal Number system – Place Values HundredsTensOnes We normally use the decimal number system to represent quantities and perform calculations. 3 x x 10 2 x 1 342

33 End Show HundredsTensOnes 3 x x 10 3 x 1 343

34 End Show HundredsTensOnes 3 x x 10 4 x 1 344

35 End Show HundredsTensOnes 3 x x 10 5 x 1 345

36 End Show HundredsTensOnes 3 x x 10 6 x 1 346

37 End Show HundredsTensOnes 3 x x 10 7 x 1 347

38 End Show HundredsTensOnes 3 x x 10 8 x 1 348

39 End Show HundredsTensOnes 3 x x 10 9 x 1 349

40 End Show HundredsTensOnes 3 x x 1 5 x

41 End Show Consider this number format The Base of the Decimal number here is 10 Normally we dont write base numbers in decimal form We can use digits 0 - 9

42 End Show Face Value and Place value Weighing Factor The weighing factor is the multiplier value applied to each column position of the number. For instance, a decimal has a weighing factor of TEN, in that each column on the immediate left indicates an increase in value by a multiple of 10. i.e.; each column moves to the left increasing by a multiple of = = 3 * * * 1 = 3 * * * 10 0 Weighing factors

43 End Show The decimal Number System: uses base 10 includes only the symbols 0 through 9 The weighed values for each position is as follows: Decimal Number System(cont..)

44 End Show This number system uses TEN different symbols to represent values. The set values used in decimal are Lowest valueHighest value Decimal number system (cont..) When doing a calculation, if the highest digit (9) is exceeded, a carry over transferred to the next column (to the left) occurs. Lets When 9 is exceeded, we reset (0), and carry a value of 1 to the next column on the left

45 End Show Binary number system TWO symbols are used to represent numerals in the binary number system. These have the values of, represents low value, and 1 represents high value. Positionx……………… Binary Value1………………11111 Decimal Value2 x-1 ………………

46 End Show More illustration….. The binary number system is also known as the base 2 number system. The values of the positions are calculated by raising 2 to some power. Why is 2 the base in binary numbers? Because we use 2 digits, the digits 0 and 1.1.

47 End Show Binary Number System (cont) The binary number system is also a positional numbering system. Instead of using ten digits, 0 - 9, the binary system uses only two digits, 0 and 1. Example of a binary number and the position values :

48 End Show 41 1 x x x x 2 3 Representation of the binary number 0101 Positionx4321 Binary Value10101 Decimal Value2 x

49 End Show uses base 2 includes only the digits 0 and 1 The weighted values for each position is as follows: Binary Number System(cont…)

50 End Show Octal number system The octal number system uses EIGHT symbols to represent numbers. The 8 distinct symbols are, With 0 having the lowest value and 7 having the highest value Columns are used in the same way as in the decimal system in that, the left most column is used to represent the greatest value Octal numbers are represented with the base 8

51 End Show 3 x x x x 8 3 Representation of octal number

52 End Show The Octal system is based on the binary system with a 3-bit boundary. The Octal Number System: uses base 8 includes only the symbols 0 through The weighted values for each position is as follows: Octal Number System

53 End Show Hexadecimal number system The hexadecimal number system uses SIXTEEN symbols to represent Numbers. The 16 distinct symbols are, A B C D E F, where A = 10, B = 11,.., F = 15 With 0 having the lowest value and F having the highest value. Hexadecimal numbers are represented with the base

54 End Show 1 x x 16 1 F(15) x x 16 3 Representation of hexadecimal number 34F

55 End Show The Hexadecimal Number System: uses base 16 includes only the symbols 0 through 9 and the letters A, B, C, D, E, and F to represent 10, 11, 12, 13, 14, and 15 respectively The weighted values for each position is as follows:

56 End Show Binary to Decimal Multiply each digit by its weighted position, and add each of the weighted values Number Base Conversion Example The binary value 1011 represents: 1x23 1x23 + 0x22 0x22 + 1x21 1x21 + 1x201x20 =1x8 + 0x4 + 1x2 + 1x11x1 = =11 (base 10)

57 End Show Converting from Binary to Decimal = = = = = = = 8 1 X = 1 0 X = 0 1 X = 4 1 X = 8 0 X = 0 0 X = 0 1 X =

58 End Show DivisionQuotientRemainderBinary Number 47 / Decimal to Binary (Repeated Division By 2)

59 End Show DivisionQuotientRemainderBinary Number 47 / / Decimal to Binary (Repeated Division By 2)

60 End Show DivisionQuotientRemainderBinary Number 47 / / / Decimal to Binary (Repeated Division By 2)

61 End Show DivisionQuotientRemainderBinary Number 47 / / / / Decimal to Binary (Repeated Division By 2)

62 End Show DivisionQuotientRemainderBinary Number 47 / / / / / Decimal to Binary (Repeated Division By 2)

63 End Show DivisionQuotientRemainderBinary Number 47 / / / / / / = Decimal to Binary (Repeated Division By 2)

64 End Show Ex. Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder 0

65 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1

66 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1

67 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1 31 / 2 gives 15 with remainder 1

68 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1 31 / 2 gives 15 with remainder 1 15 / 2 gives 7 with remainder 1

69 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1 31 / 2 gives 15 with remainder 1 15 / 2 gives 7 with remainder 1 7 / 2 gives 3 with remainder 1

70 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1 31 / 2 gives 15 with remainder 1 15 / 2 gives 7 with remainder 1 7 / 2 gives 3 with remainder 1 3 / 2 gives 1 with remainder 1

71 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1 31 / 2 gives 15 with remainder 1 15 / 2 gives 7 with remainder 1 7 / 2 gives 3 with remainder 1 3 / 2 gives 1 with remainder 1 1 / 2 gives 0 with remainder

72 End Show Lets find the binary equivalent of the decimal number / 2 gives 127 with remainder 0LSB 127 / 2 gives 63 with remainder 1 63 / 2 gives 31 with remainder 1 31 / 2 gives 15 with remainder 1 15 / 2 gives 7 with remainder 1 7 / 2 gives 3 with remainder 1 3 / 2 gives 1 with remainder 1 1 / 2 gives 0 with remainder 1MSB

73 End Show Binary to Octal Conversion It is easy to convert a binary number to an octal. This is accomplished by: Most Significant Bit (MSB) Least Significant Bit (LSB) 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 will be written:

74 End Show Conversion from Binary to Octal Convert to octal. Each octal digit is represented by 3 binary bits. Split the binary number into groups of 3 bits, starting from the right = 2= 6= 7 = 267 8

75 End Show OctalBinary (in 3 bits) Relationship between binary and octal

76 End Show Octal to Decimal Conversion To convert from Octal to Decimal, multiply the value in each position by its Octal weight and add each value. Example, convert this octal 342 to decimal, we can obtain the decimal value as follows: 3x823x82 4x814x81 2x802x80 3x644x84x82x12x = x x x

77 End Show Conversion from Octal to Decimal Convert to decimal. Each column represents a power of 8, 176 = 1 * * * 8080 = (1 (1 * 64) + (7 (7 * 8) + (6 (6 * 1)1) = = 126

78 End Show 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 the quotient by 8 and writing the remainder until the quotient is 0.

79 End Show 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 the quotient by 8 and writing the remainder until the quotient is 0. DivisionQuotientRemainder 87 / 8107

80 End Show 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 the quotient by 8 and writing the remainder until the quotient is 0. DivisionQuotientRemainder 87 / / 812

81 End Show 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 the quotient by 8 and writing the remainder until the quotient is 0. DivisionQuotientRemainder 87 / / / = 127 8

82 End Show Binary to Hexa Conversion It is easy to convert a binary number to hexa. 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 Hexa equivalent. For example, the binary value is written: AFB2

83 End Show Conversion from binary to hexadecimal Convert to hexadecimal. Each hexadecimal digit represents 4 binary bits. Split the binary number into groups of 4 bits, starting from the right =16 in hexadecimal

84 End Show Hexadecimal Binary (in 4 bits) Hexadecimal Binary (in 4 bits) A B C D E F1111 Relationship between Binary and Hexadecimal

85 End Show Hexa to Binary Conversion It is also easy to convert from an integer hexa number to binary. This is accomplished by: Convert the Hexa number to its 4-bit binary equivalent. Combine the 4-bit sections by removing the spaces. B This yields the binary number or in our more readable format. For example the hexa value B2 is written in binary:

86 End Show Hexadecimal to Decimal Conversion To convert from Hexa to Decimal, multiply the value in each position by its hexa weight and add each value. Using the value from the previous example, B2 16, we can obtain the decimal value as follows: B x x x 162 x = x x x x

87 End Show Conversion from hexadecimal to decimal Convert hexadecimal to decimal. Each column represents a power of 16, = (1 (1 * 16 2 ) + (7 (7 * 16 1 ) + (6 (6 * 16 0 ) = (1 * 256) + (7 * 16 )+ (6 * 1)1) = = 374

88 End Show Decimal to Hexa Decimal Conversion To convert decimal to hexa is slightly more difficult. The typical method to convert from decimal to hexa is repeated division by 16. Repeated Division By 16 For this method, divide the decimal number by 16, and write the remainder on the right hand 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.

89 End Show Ex: Convert decimal 2811 to hexa as follows: DivisionQuotientRemainder 2811 / = B

90 End Show DivisionQuotientRemainder 2811 / = B 175 / = F Ex: Convert decimal 2811 to hexa as follows:

91 End Show DivisionQuotientRemainder 2811 / = B 175 / = F 10 / = A Ex: Convert decimal 2811 to hexa as follows:

92 End Show DivisionQuotientRemainder 2811 / = B 175 / = F 10 / = A Ex: Convert decimal 2811 to hexa as follows: = AFB 16

93 End Show What is BIT (BINARY DIGIT) ? A bit is the smallest element of information used in a computer A bit holds ONE of TWO possible values, 2.2 Data Representation A bit which is OFF is also considered to be FALSE or NOT SET; a bit which is ON is also considered to be TRUE or SET Only one of two values(0 or 1) can be stored in a single bit.

94 End Show With a single bit, you can represent any two distinct items. Examples one or zero true or false on or off male or female right or wrong

95 End Show H H ASCII CODE IS 72 Data Representation

96 End Show What is Byte ? Bytes are a grouping of 8 bits A byte is the smallest addressable datum (data item) in the memory by the microprocessor.

97 End Show The Binary equivalent of the decimal number 205 is as follows and the Most Significant Bit(MSB) and the Least Significant Bit (LSB)can be defined as below : MSBLSB b7b6b5b4b3b2b1b0 Most Significant Bit (MSB)Least Significant Bit (LSB) The bits in a byte are filled from LSB (b0) to MSB (b7) respectively as follows:

98 End Show Since a byte consists of eight bits, it can represent 2 8, or 256, different values. Generally, we use a byte to represent: Unsigned numeric values in the range 0 to 255 Signed numbers in the range -128 to +127 ASCII( American Standard Code for Information Interchange ) character codes Other special data types requiring no more than 256 different values. Many data types have fewer than 256 items so eight bits is usually adequate.

99 End Show Capacity of Various Units 8 bits = 1Byte (2 10 ) 1024 Byte = 1 KB (kilobyte) (2 10 ) 1024 KB = 1 MB (Megabyte) (2 10 ) 1024 MB = 1 GB (Gigabyte) (2 10 ) 1024 GB = 1 TB (Terabyte) Unit conversion 1kiloByte = 2 10 bytes 1MegaByte= 2 20 bytes 1GigaByte = 2 30 bytes 1TeraByte = 2 40 bytes

100 End Show 2.2.2Coding Systems 1.BCD (Binary Coded Decimal) 2.ASCII (American Standard Code for Information Interchange)

101 End Show BCD - Binary Corded Coded Decimal is a numerical this code structure, each of the decimal digits (0-9) is represented by a four-bit binary code (eg: 3 is represented by digit is then represented by it's binary unique(different) numbers can be stored in the 4 bit binary there are 6 invalid four-bit combinations in the BCD code.

102 End Show This makes BCD easy to read, but it is not very efficient in terms of storage space, nor is it as efficiently processed in hardware The number 386 is coded in BCD as follows: BCD code is The number 59 is coded in BCD as follows BCD code is

103 End Show Cont… BCD DecimalBCD DecimalBCD Valid Combinations Invalid Combinations

104 End Show Cont ….BCD Converting the Decimal value 546 to BCD 5 = = = 0110 Thus = Converting the binary value to decimal is 0111 = = = 5 Thus =

105 End Show ASCII - The American Standard Code for Information Interchange The American National Standards Institute has published an American Standards Code for Information Interchange(ASCII) This code is now most widely used by major manufactures. so that their equipment will be compatible with those of other manufactures.

106 End Show ASCII is a computer code which uses 128 different coding combinations of a group of seven bits (2 7 = 128) to represent Characters A to Z, both upper and lower case Special characters, <,., ?, :,etc., Numbers 0 to 9 Special control codes used in device control

107 End Show HEXDECCHAR 4165A 4266B 4367C 4468D X 5989Y 5A90Z HEXDECCHAR 6197a 6298b 6399c 64100d x 79121y 7A122z HEXDECCHAR The tables below gives the ASCII character set :-

108 End Show ASCII (Cont……) Example Code the text string 'Hello.' in ASCII using hexadecimal digits. H = 48 e = 65 l = 6C l = o = 6F. = 2E Thus the string is represented by the byte sequence C 6F 2E

109 Where are we? 2.3 Logic Gates and Circuits End Show

110 A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment, every terminal is in one of the two binary conditions low (0) or high (1), represented by different voltage levels. In most logic gates, the low state is approximately zero volts (0 V), while the high state is approximately five volts positive (+5 V). There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR. End Show

111 Logic gates are small (several micron) structures which take one or more bits as input, and produce another bit as output Different logic gates use different techniques to calculate their output End Show

112 The most common logic gates used perform the following logic functions: AND : Output is True(1) if all inputs are True (1) OR : Output is False (0) if all inputs are False (0) NOT : Output is the opposite of the single input i.e., If input is true (1) the output is false (0) If input is false (0) the output is true (1) End Show

113 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. The AND gate is drawn as follows AND - Gate A B F=A.B +- A B A.B End Show

114 0 0

115 0 0 0

116 0 0 0

117 1 0

118 1 0 0

119 0 0 0

120 0 1

121 0 1 0

122 0 0 0

123 1 1

124 1 1 1

125 0 0 1

126 Truth table for AND gate ABA.B The output from the AND gate is written as A.B The truth table for a two-input AND gate looks like 0 0 F= F=1 End Show

127 OR-Gate A B F=A+B +- The OR gate has two or more inputs. The output from the OR gate is 1 if any of the inputs is 1. The gate output is 0 if and only if all inputs are 0. The OR gate is drawn as follows A B A+B End Show

128 0 0

129 0 0

130 0

131 0

132 1 0

133 1 0

134 1

135 1

136 0 1

137 0 1

138 1

139 1

140 1 1

141 1 1

142 1

143 1

144 ABA+B The output from the OR gate is written as A+B The truth table for a two-input OR gate looks like 0 0 F=0 0 1 F= Truth table for OR gate End Show

145 NOT-Gate The input to the NOT gate A is inverted i.e. The binary input state of 0 gives an output of 1 and the binary input state of 1 gives an output of 0. Ā is known as "NOT A" or alternatively as the complement of A. AĀ The NOT gate is unique in that it only has one input. It looks like AĀ End Show

146 Logic Gates from Transistors For example, we will build a NOT gate from a transistor. Transistor extra power source Input to NOT gate. Output from NOT gate. End Show

147 Logic Gates from Transistors For example, we will build a NOT gate from a transistor. Transistor OFF extra power source NOT 1 0 Input to NOT gate is ON. Output from NOT gate is OFF. End Show

148 Logic Gates from Transistors For example, we will build a NOT gate from a transistor. Transistor ON extra power source NOT 0 1 Input to NOT gate is OFF. Output from NOT gate is ON. End Show

149 0

150 0

151 1

152 1

153 1

154 1

155 0

156 0

157 NAND-Gate The truth table for a two-input NAND gate looks like ABP A B End Show

158 NOR-Gate The truth table for a two- input NOR gate looks like ABP A B End Show

159 XOR-Gate The truth table for a two- input XOR gate looks like ABP A B End Show AB P B A P

160 2.4Boolean Algebra A set of rules formulated by the English mathematician George Boole describe certain propositions whose outcome would be either true or false. With regard to digital logic, these rules are used to describe circuits whose state can be either, 1 (true) or 0 (false). In order to fully understand this, the relation between the AND gate, OR gate and NOT gate operations should be appreciated. George Boole End Show

161 Algebra : variables, values, operations In Boolean algebra, the values are the symbols 0 and 1 If a logic statement is false, it has value 0 If a logic statement is true, it has value 1 Operations : AND, OR, NOT Basic Laws in Boolean Algebra End Show

162 Laws of Boolean Algebra (a) A + B = B + A ABA+B (b) A.B = B.A ABA+B T1 : Commutative Law T1 : Commutative Law BAB+A BA End Show

163 T2 : Associate Law T2 : Associate Law (a) (A + B) + C = A + (B + C) ABC(A+B)(A+B)+ C ABC(B+C)A+(B+C ) End Show

164 (b) (A.B).C = A.(B.C) Associate Law contd ……. ABC(A.B)(A.B).C ABC(B.C)A.(B.C) End Show

165 T3 : Distributive Law (a) A.(B + C) = A.B + A.C ABC(B+C)A.(B+C) ABCABACAB+AC End Show

166 (b) A + (B.C) = (A + B) (A + C) ABCBCA+(BC) ABC(A+B)(A+C)(A+B).(A+C) End Show

167 T4 : Identity Law (a) A + A = A (b) A.A = A AAP=A+A A 0 1 AAP=A.A A 0 1 End Show

168 T5 :(a) A AB BA End Show

169 (b) A A+B BA End Show

170 T6 : Redundance Law T6 : Redundance Law (a) A + A.B = A (b) A.(A + B) = A ABA.BA+A.B A ABA+BA.(A+B) A End Show

171 T7 : T7 : (a) 0 + A = A (b) 0. A = 0 0A0+A A 0 1 0A0.A End Show

172 T8 : T8 : (a) 1 + A = 1 (b) 1. A = A 1A1+A A1.A A 0 1 End Show

173 T9 : (a) T9 : (a)(b) A A End Show

174 T10 : AB ABA+B AB ABA.B End Show

175 (a) (b) T11 : De Morgan's Theorem T11 : De Morgan's Theorem A+B BAAB A.B BAAB End Show

176


Download ppt "End Show UNIT – 2Data Representation and Internal Operations of the Computer."

Similar presentations


Ads by Google