Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Technology and Computer Fundamentals

Similar presentations


Presentation on theme: "Digital Technology and Computer Fundamentals"— Presentation transcript:

1 Digital Technology and Computer Fundamentals
Chapter 1 Data Representation and Numbering Systems

2 Objectives Describe the different methods of data representations;
Describe the characteristics of number representation; Convert a number in any numbering base to other bases; Perform binary arithmetic;

3 Objectives (Cont’d) State the methods of complements in representing negative numbers; and Perform binary subtraction using complement representations.

4 References Richard S. Sandige, “Modern Digital Design,” Mcgraw-Hill Publishing Company. Theodore F. Bogart Jr., “Introduction to Digital Circuits,” McGraw-Hill Publishing Company.

5 References (Cont’d) Thomas C. Bartee, “Digital Computer Fundamentals,” sixth edition, McGraw-Hill Publishing Company.

6 Data Representations Values in digital systems consist of only 0 and 1. A combination containing a single 0 or 1 is called a bit (Binary digit). In general, n bits can be used to distinguish amongst 2n distinct entities.

7 Data Representations Computers use strings of bits to represent numbers, letters, punctuation marks, and any other useful pieces of information.

8 Alphanumeric Codes An alphanumeric code is the assignment of letters and other characters to bit combinations. These include letters, digits and special symbols. ASCII: American Standard Code for Information Interchange.

9 Alphanumeric Codes 7-bit to represent 128 different symbols including upper-case and lower-case letters, digits and special symbols, printable and non-printable. 8-bit extension uses the eighth bit to add error-detecting capability (parity check) for transferring codes between computers.

10 Alphanumeric Codes EBCDIC: Extended Binary Coded Decimal Interchange Code. 8-bit IBM code.

11 Numbers In principal, represented in binary numbering system.
variations, such as integers, floating point numbers, negative numbers, etc.

12 Characteristics of Number representation
Binary numbering system; some characteristics being the same as decimal A numeric value is represented by a series of symbols. five thousand two hundred and thirty two represented by Positional significance exists.

13 Example = 5     100 + 2   10-2 =

14 Positional Significance
Nb =Si Si S2 S1 S0 . S-1 S-2 S S-k = Si bi + Si-1 bi S2 b2 + S1 b1 + S0 b0 + S-1 b-1 + S-2 b-2+ S-3 b S-k b-k (Exp. 1.) The Least Significant Digit (LSD), S-k, and the Most Significant Digit (MSD), Si.

15 Integers Represented in binary numbering system
For example, 10112, represents : 1     20 = = 1110

16 Integers (Cont’d) An integer usually employs 2 bytes, i.e. 16 bits, which can represent a number up to (216 – 1) or Bigger numbers, long integers may occupy 32 bits or 64 bits.

17 Binary Coded Decimal (BCD)
Integer representation. The decimal digits are stored in terms of their 4-bits binary equivalents For example: decimal number would be stored as Non-positional. Complicated in arithmetic.

18 Floating point numbers
Used when a number is very large or very small. A pair of numbers to represent the values. One is the value scaled to a standard form, the normalized mantissa in fixed-point notation. The other is a scaling factor, the exponent.

19 Floating point numbers (Cont’d)
Scientific notation, i.e. M  be, where M is the mantissa; b the base and e the exponent. Example, single-precision floating- point number in IBM 370 or series: 1-bit sign indicator, a 7-bit exponent with a base of 16, and a 24-bit mantissa.

20 Floating point numbers (Cont’d)
24 bits correspond to 6-7 decimal digits, we can assume that a number has at least 6 decimal digits of precision. The exponent of 7 bits gives a range of 0 to Because of an exponential bias, the range is actually -64 to +63, that is, 64 is automatically subtracted from the listed exponent.

21 Floating point numbers (Cont’d)
Example: The leftmost bit is a zero, i.e positive. The next seven bits, , are exponent equivalent to the decimal number 66 The final 24 bits indicate the mantissa

22 Floating point numbers (Cont’d)
The machine number represents, in decimal: + ( )  = To ensure uniqueness of representation and obtain all the available precision of the system, M  e-1.

23 Floating point numbers (Cont’d)
The smallest positive machine number that can be represented is =  10-78 while the largest is =  1076.

24 Floating point numbers (Cont’d)
Numbers less than result in what is called underflow, and are often set to zero. Numbers greater than 1663 result in an overflow condition and cause the computations to halt.

25 Commonly used Numbering Systems
Binary number system (base 2), octal (base 8), and hexadecimal (base 16) number systems. Computers only deal with binary numbers, the use of the octal and hexadecimal numbers is solely for the convenience of human people.

26 Base numbers In our daily life, for convenience the base number is always ignored such that means In computer world, the representation can be a value in other numbering systems. is different from

27 Base numbers According to the nature of positional significance,
equals to equals to When dealing with numeric values in different systems, the number indicating the base must also be present.

28 Number Conversions Conversion to decimal numbers
Conversions among binary, octal, and hexadecimal numbers

29 Conversion to decimal numbers
Simply using the polynomial expression stated in Exp. 1.1 = 127 + 126 + 025 + 024 + 1 22 + 021 + 120 = =

30 Conversion to decimal numbers (Cont’d)
13078 = 183 + 382 + 081 + 780 = = A1D16 = 10  160 = =

31 Conversion from decimal numbers
Given a decimal number, N10, its equivalent representation in base b is as Si Si S2 S1 S0 From Exp. 1.1, we have: N10 = Si bi + Si-1 bi S2 b2 + S1 b1 + S0 b0

32 Conversion from decimal numbers (Cont’d)
Steps : i. Divide the decimal number by the base number and obtain the quotient and the remainder. ii. Take away the remainder and regard the quotient as the new decimal number. iii. Repeat the steps 1 and 2 until the quotient is 0. iv. The equivalent number in base b is obtained by writing the remainder in reverse sequence.

33 Conversion from decimal numbers (Cont’d)
To obtain the binary equivalent, use 2 as the base, b, in division. To find the octal and hexadecimal equivalent numbers, the base number will be 8 and 16 respectively. In all cases, the remainders will always be less than the base numbers.

34 Conversion from decimal numbers (Cont’d)
The equivalent are , 6128, and 18A16

35 Conversions among binary, octal, and hexadecimal numbers

36 Conversions from octal or hexadecimal to binary numbers
Each octal digit comprises three binary digits and each hexadecimal digit comprises four binary digits. Conversion to a binary number from an octal or hexadecimal number is simply replacing all octal or hexadecimal digits by their binary equivalents.

37 Conversions from octal or hexadecimal to binary numbers
6128    18A16 A

38 Conversions from binary to octal or hexadecimal numbers
To group the binary digits into groups of three or four, then replace each group with their octal or hexadecimal equivalent digits. Grouping must start from the radix point. Leading zeros can be added if necessary.

39 Conversions from binary to octal or hexadecimal numbers
Leading zero     

40 Conversions from binary to octal or hexadecimal numbers
Leading zeros      2 A C B The equivalents of are and 2ACB16.

41 Conversions between octal and hexadecimal numbers
No direct method Through the binary conversions.

42 Binary Arithmetic

43 Binary Arithmetic (Cont’d)
The rules are simple. They are similar to the decimal arithmetic.

44 Binary Arithmetic (Cont’d)
Multiplication and division employ the principles of addition and subtraction respectively. Subtraction can be regarded as addition by adding a negative number. All arithmetic problems can be solved using the principles of addition provided.

45 Negative numbers Two ways to represent a negative binary number.
a signed bit to represent the positive or negative sign. the complemented form of the positive number to represent a negative value.

46 Sign bit representation
Negative number represented by a sign preceding its absolute value, e.g. -65. Similar technique can be employed to represent a negative binary number. To attach one digit to the binary number to represent the sign. This binary digit as the sign bit.

47 Sign bit representation (Cont’d)
A number with sign bit is called signed number. Sign bit is always the MSB. The number is positive if the sign bit is 0 and is negative if the sign bit is 1. For example, represents , or +510, while means , or -510.

48 Sign bit representation (Cont’d)
The advantage is simple. Disadvantages Duplication in representing zero. addition to a signed negative number gives an incorrect answer.

49 Sign bit representation (Cont’d)

50 Complement representation
The 1’s complement and the 2’s complement. The most significant bit still represents the sign. The other digits are not the same.

51 1’s complement The negative value of an n-digit binary number, N2, can be represented by its 1’s complement, N'2 It is equal to the base number, 2, to the power n minus the number N minus one, or: N'2 = 2n - N2 - 1 = (2n - 1) - N2

52 1’s complement (Cont’d)
(2n - 1) is the largest value that can be represented by an n-digit number in the binary numbering system N'2 can be obtained by subtracting each digit with 1, or by inverting all binary digits.

53 1’s complement (Cont’d)
1's complement number of : n = 8. N'2 = (28 - 1) - N2 = ( ) = =

54 2’s complement The 2’s complement, N"2, of an n- digit binary number, N2, is defined as: N"2 = 2n - N2 = (2n - 1) - N2 + 1 = N’2 + 1 where N’2 is the 1’s complement representation of the number.

55 2’s complement (Cont’d)
No duplicate representation for all numbers. N2 = N’2 = N”2 = N’2 + 1 = Since only 8 bits are used, the base complement of zero is zero, too.

56 2’s complement (Cont’d)
With 8-bit 2's complement representation, total 256 numbers (-12810) to (010) to (+12710).

57 2’s complement (Cont’d)
2's complement number of 1’s complement, N' is N” = N’ + 1 = =

58 Subtraction with 2’s complements
Subtraction of two numbers: X2 - Y2 = X2 + (- Y2) In 2’s complement representation: X2 + (2n - Y2) = X2 - Y2 + 2n If X > Y, the sum will produce an end carry, 2n, which can be discarded, and the sum is positive.

59 Subtraction with 2’s complements (Cont’d)
If X < Y, the sum is negative and will be 2n - (Y2 - X2) which is the 2’s complement of (Y2 - X2). (Y2 - X2) is positive. The sum is negative with the absolute value being (Y2 - X2).

60 Subtraction with 2’s complements (Cont’d)
Example: +93 = -65 = = (in 2’s complement)

61 Subtraction with 2’s complements (Cont’d)

62 Subtraction with 2’s complements (Cont’d)
Example: +65 = -93 = = (in 2’s complement)

63 Subtraction with 2’s complements (Cont’d)

64 Digital Technology and Computer Fundamentals
Chapter 2 Boolean Algebra and Digital Logic

65 Objectives At the end of this chapter, you should be able to:
Remember the basic logic functions and define a logic problem with a truth table; Formulate a logical expression for a logic problem from the truth table; Apply Boolean Algebraic theorems to simplify a logical expression;

66 Objectives (Cont’d) Use Karnaugh-map to simplify logical expressions;
Use logic gates to synthesis a logical circuit for a logical expression; Use single type of logic gates to synthesis a circuit; and Solve a practical problem with combinational logic circuits.

67 References Theodore F. Bogart Jr., “Introduction to Digital Circuits,” McGraw-Hill Publishing Company. M. Morris Mano, “Digital Design,” 2nd ed., Prentice Hall International, Inc. Tokheim, “Digital Electronics,” 4th ed., McGraw-Hill Publishing Company

68 Introduction Two switches to control one lamp. Two-value elements.
Represented by the binary values 1 or 0. Switches are variables The lamp is a function of the two switches.

69 Boolean Algebra An effective method to analyze logic problems.
Binary values represented by boolean variables Problems expressed as logic functions. Can be manipulated, eventually, implemented by a practical digital logic circuit.

70 Truth Table Describes a logic function.
All possible conditions are listed. Truth table for the switches and lamp problem:

71 Truth Table (Cont’d) Four rows in the table, each represents a possible condition. The truth table shows the values of the lamp under each of the different conditions. For n independent variables, there are total 2n combinations.

72 Truth Table (Example) A company cheque requires valid signatures from authorized persons, the director, the general manager, and the chief accountant. At least two signatures appearing on the cheque makes it valid. Use truth table to show the validity of the cheque.

73 Truth Table (Example) Variables A, B, C represent the appearance of the signatures of the authorized persons respectively. The validity of the cheque is represented by a function variable, V.

74 Truth Table (Example)

75 Truth Table (Cont’d) The values of A, B, and C, if viewed as 3-digit binary numbers, are in sequence from 0 to 7. A good practice. No mistakes in finding all the combinations.

76 Logical expressions A logic function expressed by different independent logic variables and logical operators. Operators: NOT, a unary operator. AND and OR, '', and '+’, are binary operators. NAND, NOR, and XOR.

77 Boolean Operators

78 Boolean Operators (Cont’d)
AND, OR, NAND, NOR, and XOR can be extended to operate on three or more operands.

79 Logical Expression Similar to an algebraic expression
Value of F can be found by giving specific values to the variables.

80 Logic gates (Symbols)

81 logic circuits Block diagram of a logic circuit.

82 logic circuits (Example)

83 Theorems

84 Theorems (Cont’d) A logic circuit implements a logic function
Cost and physical size of the circuit depend on the complexity of the logic function. Necessary to simplify the logic function as much as possible. The Boolean Algebraic theorems.

85 Theorems (Cont’d) Theorems can be proved by truth table method.
Values of two (or more) functions to be proved equal, they must be identical for all possible conditions.

86 Prove by theorems

87 Prove by theorems

88 Standard Forms A function expressed in a truth table has to be transformed to a logical expression before it can be manipulated or simplified. standard sum of products form standard product of sums form.

89 Sum and Product We use the dot () to represent the operator AND, which is the same as multiplication in algebra. Several expressions being ANDed together is called a product. The plus (+) is used to represent the operator OR. Several expressions being ORed together is called a sum.

90 Sum of products form An expression in sum of products form consists of several products ORed together. Standard sum of products form contains all independent variables, either complemented or not.

91 Sum of products form (Cont’d)
Each product in the expression is a term. F to be 1 requires minimum any one term in the expression being 1. Each term in the expression is called a minterm. The sum of products form is also called the minterm form.

92 Standard Sum of products form
Each term represents a row in the truth table.

93 Standard Sum of products form (Cont’d)
An example

94 Standard Sum of products form (Cont’d)
Rows in the truth table can be numbered Standard minterms, corresponding to each row, can be expressed in similar way: F(A, B, C) = S(0, 1, 5, 7) The sum, S (OR) of the 0th, 1st, 5th, and 7th standard minterms.

95 Product of sums form An expression consists of Several sums ANDed together Standard product of sums form requires each term in the expression to include all variables.

96 Product of sums form (Cont’d)
F, will be 1 only if all the terms are equal to 1. Therefore, each term in the product of sums form is called a maxterm. The product of sums form is sometimes called maxterm form.

97 Standard Product of sums form
Each term represents a row in the truth table.

98 Standard Product of sums form (Cont’d)
An example

99 Standard Product of sums form (Cont’d)
Product of sums expression can be expressed as a list of row numbers: F = P (2, 3, 4, 6) The product, P (AND) of the 2nd, 3rd, 4th, and 6th standard maxterms.

100 Logic Circuits

101 Logic Circuits (Cont’d)

102 Logic Circuits (Cont’d)
Both can be simplified to:

103 Logic Circuits (Cont’d)
These circuits are all equivalent. Find the simplest expression before a circuit is synthesized. Components and cost is minimized. Simplification: Boolean Algebra theorems Karnaugh-map

104 The Karnaugh map Also called K-map.
A representation of the truth table. Each K-map consists of several cells linked together. The number of cells is equal to the number of rows in a truth table. Different K-maps for different number of variables.

105 The Karnaugh Map (2 variables)

106 The Karnaugh Map (3 variabales)

107 The Karnaugh Map (4 variables)

108 The Karnaugh Map (Cont’d)
The numbers in the parentheses of each cell represent the corresponding rows in the truth table. Cells are partitioned into regions: Region A and Region Not A Region B and Region Not B, etc.

109 The Karnaugh Map (Cont’d)
In Region A, the values of A in each cell is 1. In Region Not A, the values of A in each cell is 0. Each cell is within n regions for n different variables. The cell numbered 6 is within the regions A, B, and Not C.

110 The Karnaugh Map (Cont’d)
Each cell in K-map is adjacent to n cellsfor n independent variables. Two cells are adjacent if there is only one difference in the values of independent variables in these cells. For example, cell numbered 6 is adjacent to the cells numbered 2, 4 and 7 respectively.

111 Transferring the function values
A K-map represents a truth table. Each cell represents a row. Use the phrase “1, 2, skip, back” to remember the filling sequence

112 Grouping the cells To find the expression in sum of products form, we need all the cells in which the value is 1. Grouping the cells, in which the value is 0, gets an expression in product of sums form. Correctly grouping leads to the simplest expression.

113 Grouping the cells (Cont’d)
Rules for grouping the cells: Adjacent cells only in a group. Number of cells in a group must be power of 2. Include as many cells in a group as possible. Cells can be within more than 1 group; minimize the no. of groups. No cell with specific value is left.

114 Grouping the cells (Examples)

115 Grouping the cells (Examples)

116 Grouping the cells (Examples)

117 Grouping the cells (Examples)

118 Grouping the cells (Examples)

119 Grouping the cells (Examples)

120 Grouping the cells (Examples)

121 Grouping the cells (Examples)

122 Obtaining the expression
Each group represents either a minterm or maxterm depending on the values, 1 or 0, of the cells in the group. A K-map can be split into two regions for each variable. Each minterm or maxterm is found by checking whether a group is within a region for each variable.

123 Obtaining the expression (Cont’d)
If the group is within the region of the variable, For minterm expression, the region variable is included. For maxterm expression, the complement of the region variable is included. if a group across both regions of a variable, the variable is discarded.

124 Obtaining the expression (Cont’d)

125 Obtaining the expression (Cont’d)

126 An Example

127 Same Example

128 Synthesis of logic circuits
From above example, based on

129 Synthesis of logic circuits (Cont’d)
From product of sums expression

130 Using single type of logic gates
To reduce the costs, it is common to use single type of logic gates. NAND gates are usually used. Proper use of NAND gates can simulate the functions of NOT, AND, and OR gates. NOR gates serve the same functions but less popular.

131 Universality of NAND Gates

132 Universality of NOR Gates

133 Conclusion Procedures for problem solving with Boolean Algebra:
i. Define the problem identifying the boolean variables and function; define logic values for different conditions. ii. Use truth table to list function values for all possible conditions;

134 Conclusion (Cont’d) iii. Find the simplified expression of the function either Boolean Algebraic theorems or Karnaugh-map method; iv. With the simplified expression, use logic gates to synthesis a logic circuit.

135 Conclusion (Cont’d) The functions have concrete values and only depend on the boolean variables. Different combinations of the values of the boolean variables determine the value of the function. The circuits obtained from such functions are called Combinational Logic Circuits.

136 Digital Technology and Computer Fundamentals
Chapter 3 Sequential Logic Circuits

137 Objectives At the end of this chapter, you should be able to:
define what is a sequential circuit; draw the circuit diagram of an SR flip-flop and explain its function; draw the circuit diagram of a JK flip-flop and explain its function; explain the functions of D-type and T-type flip-flops;

138 Objectives (Cont’d) differentiate the functions of triggering control;
identify the representations for different types of triggering in a circuit symbol; explain the functions of direct inputs;

139 Objectives (Cont’d) explain the operations of shift register circuits; and explain the operations of the asynchronous and synchronous counter circuits.

140 References Thomas C. Bartee, "Digital Computer Fundamentals," sixth edition, McGraw-Hill Publishing Company. Richard S. Sandige, "Modern Digital Design," McGraw-Hill Publishing Company. Theodore F. Bogart Jr., "Introduction to Digital Circuits,"” McGraw-Hill Publishing Company.

141 Introduction Those whose outputs depend on the state of inputs and the previous state of the outputs. Able to remember a logic value. Several types of sequential logic circuits. flip-flops counters shift registers.

142 Flip Flop A bi-stable element. Two stable states, 1 or 0.
Able to store a digital value. Depends on the input and the previous value stored. Basic elements of a memory device in a digital computer. The outputs of Q and are complemented to each other.

143 Flip Flop (Cont’d) To understand, one must be familiar with the functions of logic gates. NAND gate: Output is 1 whenever there is a 0 at the inputs. NOR gate: Output is 0 whenever there is a 1 at the inputs.

144 Flip Flop (Cont’d) Propagation delay of the logic gates.
Outputs of the logic gates take time to response to input changes. Outputs change in response to the change of inputs and The previous change of the outputs. Time required to settle to a stable state, i.e. the final values of outputs.

145 Flip Flop (Cont’d) An initial value, 1 or 0, must be assigned to the previous outputs for deducing the final output values. We usually use the symbol Qn to denote the initial (or previous) value of the output and Qn+1 to denote the new value of the stable output.

146 S-R (Set-Reset) Flip Flop
S-R flip-flop is the simplest one. Can be made by any logic gates.

147 S-R Flip Flop (Cont’d) Case 1: S = R = 0. Assume Q = 0 and = 1.
Substitute values into eq. 3.1 and 3.2 New output values: Q = 0 and = 1. If initially, Q = 1 and = 0 New outputs are: Q = 1 and -Q = 0. Conclusion: outputs, Q and -Q, are unchanged if both inputs are 0.

148 S-R Flip Flop (Cont’d) Case 2: S = 0, R = 1. Assume Q = 0 and -Q = 1.
Substitute values into eq. 3.1 and 3.2, New output values: Q = 0 and -Q = 1. If Q = 1 and -Q = 0 are initial state New outputs: Q = 0 and -Q = 0. Not a stable state. Subsequent changes are illustrated in timing table.

149 S-R Flip Flop (Cont’d) Time sequence starts from left to right.
Adjacent columns represent a time interval, the propagation delay. Output values at time tn determined by values of the gate inputs at time tn-1.

150 S-R Flip Flop (Cont’d) The outputs Q and -Q settle at time t3.
Their values are 0 and 1 respectively. Concluion: The output Q is reset to 0 when the S is 0 and R is 1.

151 S-R Flip Flop (Cont’d) Case 3: S = 1; R = 0.
If initially, Q = 0 and -Q = 1. New output values are: Q = 0 and -Q = 0. Analysis with the timing table required.

152 S-R Flip Flop (Cont’d) If Q = 1 and -Q = 0 are the initial state
Values of the Q and -Q settle at time t3 Values are 1 and 0 respectively. If Q = 1 and -Q = 0 are the initial state New outputs are same: Q = 1 and -Q = 0. Conclusion: The output Q is set to 1 when the S is 1 and R is 0.

153 S-R Flip Flop (Cont’d) Case 4: S = 1; R = 1.
The outputs will be all 0 no matter what their initial values are. If then, the inputs are all reset to 0: race happens between the logic gates. Which output is 1 cannot be determined. Conclusion: this case should never happen in a practical circuit.

154 S-R Flip Flop (Cont’d) Truth table of the S-R flip-flops
Different circuits can be found from the same truth table. For example: using NAND gates as in lecture notes.

155 J-K Flip Flop Disadvantage of the S-R flip-flop: only three cases of inputs are used. The J-K flip-flop is designed to overcome such limitation.

156 J-K Flip Flop (Cont’d)

157 J-K Flip Flop (Cont’d)

158 J-K Flip Flop (Cont’d) Case 1: J = 0; K = 0.
Outputs of the gates G1 and G2, will be 1 regardless the values of Q and Conclusion: Q and will remain unchanged.

159 J-K Flip Flop (Cont’d) Case 2: J = 0; K = 1.
Initially, Q is 0 and -Q is 1 Substituting all the values into the Eq.3.3 to Eq.3.6 The final values of G1, G2, Q and -Q are 1, 1, 0, and 1 respectively.

160 J-K Flip Flop (Cont’d) Initially, Q is 1 and -Q is 0
Analysis with the timing table required.

161 J-K Flip Flop (Cont’d) Conclusion: Outputs Q and -Q will be 0 and 1 respectively regardless their initial values if the inputs J and K are 0 and 1 respectively.

162 J-K Flip Flop (Cont’d) Case 3: J = 1; K = 0.
Initially, Q is 0 and -Q is 1 Substituting all the values into the Eq.3.3 to Eq.3.6 Analysis with timing table

163 J-K Flip Flop (Cont’d) The final values of G1, G2, Q and are 1, 1, 1, and 0 respectively.

164 J-K Flip Flop (Cont’d) Initially, Q is 1 and -Q is 0
The stable values of G1, G2, Q and -Q are 1, 1, 1, and 0 respectively. Conclusion: Outputs Q and -Q will be 1 and 0 respectively regardless their initial values if the inputs J and K are 1 and 0 respectively.

165 J-K Flip Flop (Cont’d) Case 4: J = 1; K = 1.
Analysis of this case must make use of the timing table.

166 J-K Flip Flop (Cont’d) Setting both J and K inputs at 1 indefinitely will make the outputs change indefinitely. The real effect of such input change is to make the output change from 0 to 1 or from 1 to 0.

167 J-K Flip Flop (Cont’d) Truth table of J-K flip-flops.

168 Symbols of the S-R and J-K flip-flops
Circuit symbols of basic flip-flops.

169 D-type Flip-Flop Truth table and circuit symbol

170 T-type Flip-Flop Truth table and circuit symbol

171 Triggering of flip-flop
With a timing diagram, we can forecast the behavior of a flip-flop

172 Triggering of flip-flop (Cont’d)
A flip-flop is triggered by the changes at its inputs. Such triggering has immediate effect on the output. Output will be out of control if unwanted situation happens Need certain control on this triggering. Use a clock signal.

173 Clock Signal

174 Triggering with Clock Level-triggered (clocked)
A flip-flop responses to the input changes when the clock is at logical 1 is called a positive clocked (positive level-triggered) flip-flop. A negative clocked (negative level-triggered) flip-flop responses to the input changes when the clock is at logical 0.

175 Triggering with Clock (Cont’d)
Edge-triggered A flip-flop responses to the input changes when the clock changes from logical 0 to logical 1 is called a positive edge-triggered flip-flop. A negative edge-triggered flip-flop responses to the input changes when the clock changes from logical 1 to logical 0.

176 Positive clocked S-R Flip-Flop
Truth table and circuit symbol

177 An Example Waveform of a positive clocked SR FF

178 Negative clocked D-type Flip-Flop
Truth table and circuit symbol

179 Positive edge-triggered T-type Flip-Flop
Truth table and circuit symbol

180 Negative edge-triggered J-K Flip-Flop
Truth table and circuit symbol

181 Another Example Waveform of a negative clocked JKFF

182 More Example Waveform of a negative edge-triggered JK FF

183

184 Direct inputs Direct inputs allow the users to assign the state of a flip-flop directly without going through the normal inputs. An example: a negative edge-triggered J-K flip-flop with direct preset and clear inputs. Q will be set to logical 1 if PS, preset, is 0. If Clr, clear, is 0, Q output will be reset to 0, i.e. Low activated.

185 Digital Technology and Computer Fundamentals
Chapter 4 Digital Components

186 Objectives At the end of this chapter, you should be able to:
remember the function and logic circuit of a half adder; describe the function of a full adder; draw the logic circuit of a full adder with two half adders and an OR gate; distinguish the functions of an encoder and a decoder;

187 Objectives (Cont’d) use truth table to define the function of a specific encoder / decoder circuit. explain the operations of shift register circuits; and explain the operations of the asynchronous and synchronous counter circuits employing flip-flops.

188 References Thomas C. Bartee, "Digital Computer Fundamentals," sixth edition, McGraw-Hill Publishing Company. Richard S. Sandige, "Modern Digital Design," McGraw-Hill Publishing Company. Theodore F. Bogart Jr., "Introduction to Digital Circuits,"” McGraw-Hill Publishing Company.

189 Adders The function of the adder circuits is to perform binary arithmetic. A major component in the CPU. All kinds of arithmetic employ adders. Half adder and full adder.

190 Half Adder It performs half of the one bit addition.
It adds two bits to give a sum and a carry. It does not consider any carry input. Therefore it called a half adder.

191 Half Adder (Cont’d) Different conditions for the addition of two binary digits A and B:

192 Half Adder (Cont’d) Carry = A . B Sum = A  B The logic circuit:

193 Full Adder The full adder circuit is able to complete the full addition process. There are three inputs, the in carry, Ci, and the two binary digits, A and B. Outputs are sum, S, and an out carry, Co.

194 Full Adder (Cont’d) The function of the full adder circuit.

195 Full Adder (Cont’d) Rearranging:

196 Full Adder (Cont’d) We can build a full adder circuit with two half adders and an OR gate.

197 Encoder The encoder produces a binary output corresponding to an input value. There are 2n or less input and n output lines in an encoder. Example: decimal-to-binary encoder.

198 Encoder (Cont’d)

199 Decoder The function of a decoder is the reverse process of an encoder. A decoder converts binary information from n coded inputs to a maximum of 2n unique outputs. Example: binary-to-decimal decoder.

200 Decoder (Cont’d)

201 Counters Used for the control of sequence and program execution.
Two categories of counters: asynchronous and synchronous. The asynchronous counters produce the outputs in sequence The outputs of the synchronous counters are available at the same time.

202 Counters (Cont’d) Counters are made with either J-K or T-type flip-flops.

203 Counters (Cont’d) Q produces one pulse for every two clock pulses input. The counter counts once for every two clock pulses. The frequency at Q is half of that at the clock. Sometimes called a divider. A J-K flip-flop can be regarded as a divide-by-2 counter.

204 Divide-by-16 Ripple (Asynchronous) Counter

205 Divide-by-16 Ripple Counter (Cont’d)

206 Divide-by-16 Ripple Counter (Cont’d)
Q0 produces one clock pulse for every two input clocks. At Q3, only one clock pulse is generated for every 16 input clocks. The output sequence in Q3, Q2, Q1 and Q0, forms the binary numbers from 0 to 15 It counts the binary numbers.

207 Divide-by-16 Ripple Counter (Cont’d)
Propagation delay happens in operations of flip-flops. Time delay for all output clocks compared with their input clocks. Outputs are not available at the same time, it is an asynchronous counter.

208 Divide-by-16 Ripple Counter (Cont’d)
A divide-by-2n counter can be built with n J-K (or T-type) flip-flops. Disadvantage: Output clock transitions do not happen at the same time. The time required for the outputs to be available is equal to n  propagation delay of one flip-flop, not suitable for high-speed circuits

209 Divide-by-16 Synchronous Counter
All output clock transitions happen at the same time. Clocks are connected together. Input connections are more complicated.

210 Divide-by-16 Synchronous Counter (Cont’d)

211 Divide-by-16 Synchronous Counter (Cont’d)
FF0 is configured to change output state for every transition of the clock. FF1 changes output state when the output of FF0 is 1. When both Q0 and Q1 are at logical 1, the output FF2 changes state after the clock. FF3 changes state after the clock pulse when all other outputs are at logical 1.

212 Divide-by-16 Synchronous Counter (Cont’d)
A divide-by-2n synchronous counter can be configured using n flip-flops and (n-2) AND gates. The inputs of the mth flip-flop is connected to the output of an AND gate with its inputs being the outputs of the flip-flop 0 to the (m-1)th flip-flip.

213 Shift Registers Store a vector of binary digits - a simple memory array. Parallel and serial input methods. Serial input method shifts the data into the shift register one bit by one bit. Right-shift: LSB first, MSB last. Left-shift:MSB first, LSB last. Parallel input method: stores the data into the register all at a time.

214 Shift Registers (Cont’d)
The data in the shift register can be retrieved either in series or in parallel. Example: 4-bit Left-Shift Register Built with J-K flip-flops with direct inputs (preset and clear). Under normal operation, values at the direct inputs are all at logical 1, so that they have no effect on the outputs.

215 Shift Registers (Cont’d)

216 Shift Registers (Cont’d)
For each flip-flop, the values at their two input terminals are always complemented to each other. Equivalent to D-type flip-flop configuration. In figure 4.. The register is initially cleared to 0000 via the clear input by giving a 0 to the clear input line.

217 Shift Registers (Cont’d)
The waveform for input data 1101

218 Shift Registers (Cont’d)
The data to be stored in the register is 1101. At the end of the forth clock, the data 1011 will be shifted into the register. Because the data are shifted into the register serially from LSB to MSB, it is a left-shifted register.

219 Shift Registers (Cont’d)
At this time, the data can be read from the four Q outputs in parallel. This is called the serial in parallel out operation. The data can also be read from the Q3 serially by providing four more clock pulses. Such operation is called serial in serial out operation.

220 Shift Registers (Cont’d)
Data can also be entered in parallel using the preset terminals with suitable modifications on the circuit. In that case, we can operate the register in Parallel in parallel out, and parallel in serial out modes.

221 Digital Technology and Computer Fundamentals
Chapter 5 Computer Organization

222 Objectives At the end of this chapter, you should be able to:
describe the basic units of a computer system; describe the stored program concept in computer system; describe the functions of each component in a CPU;

223 Objectives (Cont’d) describe the instruction execution process: fetch cycle and execution cycle; distinguish the different categories of memory; describe the operations of a memory; describe the organization of a memory; and

224 Objectives (Cont’d) describe the principles of operations of the different secondary storage devices.

225 References M. Marris Mano, "Computer System Architecture," third edition, Prentice Hall. V. Carl Hamacher, Zvonko G. Vranesic, Safwat G. Zaky, "Computer Organization," McGraw-Hill, 3rd ed Andrew S. Tanenbaum, "Structured Computer Organization," 3rd ed. Prentice Hall, 1990.

226 References Herman Lam, John O'Malley, "Fundamentals of Computer Engineering,” Wiley, 1988. G. Shelly, T. Cashman, G. Waggoner, W. Waggoner, “Discovering Computers 98, A link to the Future,” International Thomson, 1998.

227 General Principles Digital computers are electronic machines capable of performing arithmetic and logical operations. A typical microcomputer system consists of a Central Processing Unit (CPU), Main Memory, and Input / output devices. They are connected by different buses.

228 General Principles (Cont’d)

229 General Principles (Cont’d)
The physical parts of the computer system are called hardware. A computer performs different tasks under the command of programs. A program is a sequence of instructions.

230 General Principles (Cont’d)
A computer instruction is a binary code that specifies a sequence of micro-operations for the computer. The instruction codes together with data are stored in memory. The CPU reads each instruction from memory, decodes it, and executes it by issuing a sequence of micro-operations to different hardware components.

231 Instruction Every computer has its own unique instruction set.
Each instruction will be assigned a binary code, called the machine code, consisting of two parts, opcode and address.

232 Instruction (Cont’d) The specification of the operation to be performed by the instruction is called the operation code or the opcode. The address part specifies the source or the destination of the operand.

233 Instruction (Cont’d) Every operation must have the opcode part, the address part is not always needed. Consequently, it is unavoidable to have instructions of different lengths.

234 Central Processing Unit
The function of the CPU is to execute programs stored in the main memory by fetching and decoding them, then executing them one after another.

235 Components of CPU A simplified CPU

236 Timing and Control Unit
Responsible for synchronization of the system and generating control signals Generates the clock signal. Decoding an instruction Providing a reset function to initialize the CPU along with other components in the microprocessor system.

237 Arithmetic and Logic Unit (ALU)
Perform various arithmetic and logical operations. Placing the results into the accumulator. Changes the flags in the Processor Status Registers.

238 Accumulator Used extensively for data manipulations.
It is commonly used to store the operands and results of different operations

239 Instruction Register (IR)
Controlled only by the Timing and Control Unit A temporary store for an instruction transferred from the main memory. When instructed, IR passes the instruction to the Timing and Control Unit for instruction decoding.

240 Program Counter (PC) Place to store the address information of the next instruction to be executed. The content of the Program Counter is updated by the Timing and Control Unit after the instruction decoding.

241 Stack Pointer (SP) Stack is a special implementation of memories. (Last In First Out operation). The Stack pointer (SP) contains the address of next free memory location.

242 Stack Operations Push: Data are stored in the location pointed to by the Stack Pointer. After the operation, the content of the SP will be incremented. Pop: Content of the SP is decremented and the data in the memory location pointed by the SP will be retrieved.

243 Processor Status Register (PSR)
Contains various bits of status information. Common flags include: zero, carry, overflow, interrupt, and negative. These flags are set or cleared by the various components in CPU, after an operation. Programmers know from these flags the result of an operation.

244 General Purpose Registers
Store temporary data, usually the result from an operation and will be used again in a later operation. Fast storage, inside the CPU without selecting external chips. Sometimes used for indexing purposes.

245 Instruction fetch-execute cycle
The instruction cycle consists of the fetch cycle and the execute cycle. The fetch cycle is identical for all instructions. The execute cycle is different for different instructions.

246 The fetch cycle The address of the next instruction is stored in PC.
A Memory Data Register (MDR) resides in the CPU which holds data items for communication. The address information to the memory is held in the Memory Address Register (MAR).

247 The fetch cycle (Cont’d)
Fetching: transfer of the address from the PC to MAR generation of the READ control signal, waiting for the memory to transfer the instruction or data into MDR.

248 The fetch cycle (Cont’d)
The instruction code is then stored temporarily in IR for decoding. After the instruction is decoded, the content of the program counter will be updated and the fetch cycle completes.

249 The execute cycle The CPU performs the different tasks according to the instruction. Different resources will be required for different types of instructions. At the end of the execute cycle, the contents of the Processor Status Register will be updated

250 Semiconductor Memories
An integrated circuit capable of storing a binary number and recalling it when addressed or selected. One of the storage devices used in computers. Store either programs or data in a computer.

251 Categorizing Memories
Based on the way a memory is accessed. Time required to locate and access a memory is called access time.

252 Categorizing Memories (Cont’d)
Random access devices: in which any location may be selected at random, equal access time for each location. Sequential access devices: in which the locations are sequentially arranged, access time varies according to the location.

253 Categorizing Memories (Cont’d)
Volatile devices: in which the data stored will be lost when power supply is off. Non-volatile devices: in which the data stored will not be lost when power is off.

254 Random access memory Random Access Memory (RAM) is a read / write memory. Random access and volatile device. There are two basic types of RAM in use today, dynamic RAM and Static RAM.

255 Dynamic RAM Designed for high capacity, moderate speeds, and low power consumption. Memory cells are charge-storage capacitors with driver transistors. The presence or absence of charge in a capacitor interpreted as 1 or 0.

256 Dynamic RAM (Cont’d) The charge in a capacitor has tendency to discharge itself. Required periodic charging to maintain the data stored - refreshing.

257 Static RAM Made of flip-flops and logic gates.
The two stable states in flip-flops represent binary values. Do not require refreshing. Low capacity, high power consumption and relatively high cost per unit storage.

258 Read Only Memory (ROM) Read only refers to the applications at the end user’s view. Data is permanently programmed either at the time of manufacture or by the user prior to the memory being installed. Non-volatile and random access. Several types.

259 Standard ROMs Programmed by the manufacturer.
Users can only read the data or execute programs in the ROM. Store certain standard applications for general user applications.

260 Programmable ROMs (PROM)
Can be programmed permanently by the user or distributor using special equipment. Only programmed once.

261 Erasable Programmable ROMs (EPROM)
Can be programmed and erased by the user for many times. Erasure is carried out by shining high intensity ultra-violet light through a special transparent window at the top of the memory IC. Special device called EPROM writer is needed.

262 Electrically Erasable Programmable ROMs (EEPROM)
Similar to EPROM. User can erase a single bit electrically in one operation. Operations require a special equipment.

263 Memory Organization Usually organized into N locations where N is generally some power of 2. The content in each location is called a word. Each word consists of same number of bits, word length. Each word is assigned an address.

264 Operations on a memory Reading from a memory: retrieving data, and writing to a memory: storing data. Assisted by two external circuits, the memory address register (MAR) and memory data register (MDR)

265 MDR and MAR

266 MDR and MAR (Cont’d) In general, for an n-bit address information, a total of 2n locations can be addressed. MAR consists of n binary devices, so that a total number of 2n words can be addressed. The size of the MDR is the same as the word length.

267 Reading a memory Reading a memory location will usually not destroy or change the contents in the location - non- destructive read. The address is placed in the MAR Then a read signal is passed to the memory. Data in the specified location will be passed to MDR.

268 Writing a memory The data is first placed in the MDR, and the address in the MAR. Then a write signal is passed to the memory. The memory will store the data in MDR into the specified location. After the operation, the data originally stored in the location will be lost.

269 Locality of Reference References to memory at any given interval of time confined within a few localized areas in memory. Over short interval, addresses generated by a typical program refer to a few localized areas of memory repeatedly. Remainder of memory is accessed relatively infrequently.

270 Cache Memory Keeping the most frequently accessed instructions and data in fast small memory. The average memory access time will be less. Such a fast small memory is referred to as a cache memory.

271 Cache Memory (Cont’d) Because of the locality of reference property of programs, although cache is small, most memory requests will be found in the fast cache memory. Between CPU and main memory. Access time of cache less by a factor of 5 to 10.

272 Cache Memory (Operation)
When the CPU needs to access memory, the cache is examined. If the word is found in the cache, it is read from the fast memory. If not, main memory is accessed to read the word. A block (1 - 16) of words containing the one just accessed is then transferred to cache memory.

273 Virtual Memory Current active programs and data do not fit into the physical main memory space. Secondary storage devices hold the overflow. OS automatically moves programs between the main memory and secondary storage, called virtual memory technique.

274 Virtual Memory (Cont’d)
The binary addresses issued by the processor are called virtual or logical addresses. Translation from virtual addresses to physical addresses is implemented by a combination of hardware and software components.

275 Virtual Memory (Cont’d)
If a virtual address refers to an address in the physical memory, then the contents of the appropriate location in the main memory are accessed immediately. If not, its contents must be brought into a suitable location in the main memory before they can be used.

276 Virtual Memory (Cont’d)
The simplest method: arrange files in fixed-length units called pages. Each page consists of a block of contiguous locations in the main memory or in secondary storage. When required, a page of information is moved back and forth between the main memory and secondary storage.

277 Virtual Memory (Cont’d)
Bridging the size gap between the main memory and secondary storage Usually implemented in part by software techniques.

278 Secondary Storage A kind of non-volatile memory.
Relative low cost and large storage. Directly addressed. External to the microprocessor. Contents must be loaded into the main memory before they can be accessed.

279 Secondary Storage

280 Floppy disks Also called a diskette, consists of a circular piece of thin plastic, coated with magnetic material. Must be formatted before used. Formatting defines the tracks, cylinders, and sectors on the disk surface.

281 Formatting floppy disks

282 Formatting floppy disks (Cont’d)
A sector is a pie-shaped section of the floppy disk. A track sector is a section of track within a sector. Each track sector holds 512 bytes.

283 Formatting floppy disks (Cont’d)
A cluster consists of 2 – 8 track sectors depending on the OS. The smallest unit to store data. One file can be stored in many clusters.

284 Formatting floppy disks (Cont’d)
Formatting process also establishes a directory, the file allocation table (FAT). FAT records information about files stored on the floppy disk. The file name, size, the time and date changed, and the cluster number where the file begins.

285 Accessing floppy disks
Through a floppy disk drive. A drive motor rotates the disk. A read/write head can rest on the top and bottom surface of the rotating floppy disk. To write data, the read/write head generates electronic impulses to change the magnetic polarity, of magnetic areas along a track

286 Accessing floppy disks (Cont’d)

287 Hard disks

288 Hard disks (Cont’d) Consist of one or more rigid platters coated with magnetic material on the surface. The platters, read/write heads, and access arms are all enclosed in an airtight sealed case.

289 Accessing Hard disks Much like storing data on floppy disks except
hard disks have multiple platters read/write heads do not touch disk surface. Access time for a hard disk is faster because it spins faster and spinning constantly.

290 Accessing Hard disks (Cont’d)
Data is stored on both sides A hard disk must be formatted before it can store data. Before a hard disk is formatted, it can be divided into separate areas called partitions. Each partition can function as if it were a separate disk.

291 Disks cartridges Disk cartridges, are removable.
They provide both the storage capacity and fast access times of hard disks and the portability of floppy disks.

292 Magnetic tape Thin ribbon of plastic, one side of which is coated with magnetic material. Sequential access storage media. The most common types are cartridge tape, but some older systems use reel-to-reel tape. For backup and transferring data between systems.

293 Accessing Magnetic tape
Same as disk drives, tape drives have an electromagnetic read/write head to access magnetic patterns. On Quarter-Inch-Cartridge (QIC) tape devices, data is recorded in a single track. When the end is reached, the tape reverses direction and data is recorded in another track in opposite direction.

294 Accessing Magnetic tape (Cont’d)
Digital audio tape (DAT) uses helical scan technology to record data in tracks at a six-degree angle to the tape. Older, one-half-inch reel-to-reel tape drives record data in nine channels, eight channels for data bits and one channel for a parity bit.

295 Accessing Magnetic tape (Cont’d)

296 PC Cards Credit card-sized cards that fit into PCMCIA (Personal Computer Memory Card International Association) expansion slots. Mostly used on portable computers Only 10.5mm thick but can contain more than 200 MB of data.

297 Optical Disks

298 Optical Disks (Cont’d)
To record data on an optical disk, a high-power laser heats the surface and makes a microscopic pit. A low-power laser light is reflected from the smooth unpitted areas and is interpreted as 1. The pitted areas do not reflect the laser beam and are interpreted as 0.

299 Optical Disks (Cont’d)
A CD-ROM can store more than 800 MB data. CD-ROM drives are often advertised as x-times speed drives. The original standard established a minimum transfer rate of 150 kbps.

300 Optical Disks (Cont’d)
Most optical disks are prerecorded and cannot be modified by users. WORM devices, allow write once, read many on the disks. Most common erasable optical drives use magneto-optical technology, in which a magnetic field changes the polarity of a spot that has been heated by a laser.

301 Smart Card Same size and thickness of a credit card
Contains a thin microprocessor capable of storing information. When inserted into compatible equipment, the information on the smart card can be read and if necessary, updated.

302 Digital Technology and Computer Fundamentals
Chapter 6 Computer Organization II

303 Objectives At the end of this chapter, you should be able to:
describe the characteristics of different input and output devices; explain why I/O interfaces are required in a computer system;

304 Objectives (Cont’d) describe the three different methods for interfacing I/O; and explain the advantage and disadvantages for each of the I/O interface methods.

305 References M. Marris Mano, "Computer System Architecture," third edition, Prentice Hall. G. Shelly, T. Cashman, G. Waggoner, W. Waggoner, “Discovering Computers 98, A link to the Future,” International Thomson, 1998.

306 Input / Output Devices Provide communication for the CPU and the outside world Keyboard Mouse Pointing Devices Terminal Visual Display Unit Printers Others

307 Keyboard Most commonly used Keys are micro-switches. Alphabetic keys.
Numeric keypad. Arrow keys or cursor control keys Function keys

308 Mouse A pointing device.
Controls the movement of an on- screen symbol called the pointer. A ball or light reflection on the bottom to sense its movement. Electronic circuits translate to electrical signals that are sent to the computer to direct the pointer.

309 Trackball Similar to a mouse The ball is on top of the device.

310 Touch pad A flat surface usually attached in a notebook computer.
Controls the movement of the pointer by sensing the motion of a finger on its exterior.

311 Pen Pen input devices accept input with hand written characters.
Usually a special software must be required for this type of input. Can also be used as a mouse

312 Touch screen Allows users to touch areas of the screen to enter data.
The action of screen-touching is equivalent to the movement and clicking the mouse. Two types of touch screens: combined with the monitor attached in front of the monitor

313 Image scanner Electronically captures an entire page and converts the document into digital format. Special software required to capture images. To convert the image to text, Optical Character Recognition (OCR) software is needed.

314 Optical recognition devices
Using a light source to read optical codes. For example, a bar code reader reads the standard Universal Product Code (UPC) and converts them into digital format.

315 Microphone Accepts voice input
Voice recognition software is required to convert into digital format. For voice to text conversion, familiarization is need for the conversion software to recognize the characteristics of the voice of the user.

316 Terminal Consists of a keyboard and a screen.
Dumb terminals have no independent processing capability. Intelligent terminals have built-in processing capabilities. Special purpose terminals uniquely designed for use in a particular industry.

317 Visual Display Unit (VDU)
A visual output device. A monitor looks like a television and consists of a cathode ray tube (CRT) display screen. An LCD display is a thin display screen, and most often used in notebook computers.

318 Printers Used to produce hard copies.
Two categories: impact and non- impact printers. Impact printers: striking a ribbon to deposit ink on the paper. Non-impact printers: use some non-mechanical technique for printing.

319 Dot-matrix printers Consists of a printer head with a vertical column of 9 or 24 needles. The needles are selectively energized and forced against the ribbon in proper combinations, to form the desired character image on the paper. Major advantage: capability to print multiple copies simultaneously.

320 Laser printers Based on the principle of photocopying machines.
A laser beam produces mirrored images on a photo-sensitize selenium drum. Toner gets stuck to the drum by an electrostatic process, then transferred to the paper.

321 Laser printers (Cont’d)
Finally, The inked image on the paper is fused by heat. Provide very good quality printing at a moderately fast rate.

322 Ink-jet printers Using the dot-matrix approach with droplets shot at the paper to form the desired character. Quiet in operation with good print quality.

323 Plotters Used to produce high-quality line drawings.
Usually, the outputs of plotters are large size posters, graphics, etc.

324 Data projectors It takes the image that appears on a computer screen and project it. It is a very effective method for presentation.

325 I/O Interface Usually, I/O devices are not connected directly to the system bus in the computer system. An interface module for each device is needed.

326 Need of interface module
I/O Operations are different from CPU and memory operations . Operations of different peripheral devices are different. Data format and word lengths are different. Conversion of signal values for each device may be required.

327 Need of interface module (Cont’d)
The data transfer rate of these devices are much slower than that of the memory or CPU. Direct connection to the system bus is impractical.

328 Solutions Special hardware components are required to supervise and synchronize the input and output data transfer. These components between the CPU and the peripheral devices are called interface.

329 I/O Bus and Interface Modules
Each peripheral device connects to a separate interface module All interfaces are attached to the I/O buses.

330 Interface Module Each interface
decodes the address and control signals received from I/O bus; interprets and provides signals for the peripheral controller; synchronizes the data flow and supervises the transfer.

331 Accessing I/O CPU places an address on the address bus.
The addressed interface detects it and activates the path. Other devices are disabled. CPU provides an I/O command in the control lines. The interface selected responds and proceeds to execute it.

332 I/O Bus and Memory Bus CPU communicates with both the I/O and the memory. Memory bus contains data, address, and read/write control lines. Need to separate them.

333 Distinguish between I/O bus and Memory bus
Three different ways: Two separate buses are used, one for memory and the other for I/O. Common data bus and common address bus with separate control buses for memory and I/O. All buses are common for memory and I/O.

334 Separate buses for memory and I/O
Two independent sets of buses, one for memory, other for I/O. A separate I/O processor (IOP) is provided in addition to the CPU. Memory communicates with both CPU and IOP through memory bus.

335 Separate buses for memory and I/O (Cont’d)
IOP also communicates with the I/O devices through a separate I/O bus with its own address, data and control lines. The purpose of the IOP is to provide an independent pathway for the transfer of information between external devices and internal memory.

336 Isolated I/O One common bus to transfer data and address information between memory or I/O and the CPU. Separate read and write lines are used to distinguish the memory and I/O operations.

337 Isolated I/O (Cont’d) CPU places the address information on the address bus. It then enables one of the two possible read/write lines (memory R/W or I/O R/W) to specify the operation. Specified device will be activated.

338 Isolated I/O (Cont’d) Distinct input and output instructions are available. Each is associated with the address of an interface because of the small number of I/O devices. Thus, the program size reduced and decoding speed increased.

339 Isolated I/O (Cont’d) Extra cost for the separate sets of read/write buses.

340 Memory-mapped I/O Only one set of read and write signals and common address bus for both memory and I/O The CPU treats an interface as being part of the memory.

341 Memory-mapped I/O (Cont’d)
Each interface is assigned an address same as the one in the physical memory space. The physical memory space cannot be used. Therefore, the total number of memory address range is reduced.

342 Memory-mapped I/O (Cont’d)
Usually, a segment of memory address space is reserved for interface. References to these addresses will be ignored by the memory and responded by the specific I/O interface.

343 Memory-mapped I/O (Cont’d)
No specific input or output instructions All access to the I/O can be made used of the large amount of memory-reference instructions. Increases the flexibility for the programmer to design programs.


Download ppt "Digital Technology and Computer Fundamentals"

Similar presentations


Ads by Google