Successfully reported this slideshow.
Your SlideShare is downloading. ×

Computer architecture and organization

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 56 Ad

Computer architecture and organization

Download to read offline

The presentation given at MSBTE sponsored content updating program on 'PC Maintenance and Troubleshooting' for Diploma Engineering teachers of Maharashtra. Venue: Government Polytechnic, Nashik Date: 17/01/2011 Session-2: Computer Organization and Architecture.

The presentation given at MSBTE sponsored content updating program on 'PC Maintenance and Troubleshooting' for Diploma Engineering teachers of Maharashtra. Venue: Government Polytechnic, Nashik Date: 17/01/2011 Session-2: Computer Organization and Architecture.

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Advertisement

Similar to Computer architecture and organization (20)

More from Tushar B Kute (20)

Advertisement

Recently uploaded (20)

Computer architecture and organization

  1. 1. Computer Organization and Architecture<br />Tushar B Kute,<br />Department of Information Technology, Sandip Institute of Technology and Research Centre, Nashik.<br />
  2. 2. What is Computer Organization?<br />Electronic<br />Devices<br />Desired<br />Behavior<br />… a very wide semantic gap between the intended behavior and the workings of the underlying electronic devices that will actually do all the work.<br />The forerunners to modern computers attempted to assemble the raw devices (mechanical, electrical, or electronic) into a separate purpose-built machine for each desired behavior.<br />http://www.tusharkute.com <br />
  3. 3. Role of General Purpose Computers<br />computer<br />organization<br />software<br />Electronic<br />Devices<br />Desired<br />Behavior<br />General<br />Purpose<br />Computer<br />A general purpose computer is like an island that helps span the gap between the desired behavior (application) and the basic building blocks (electronic devices).<br />http://www.tusharkute.com <br />
  4. 4. Computer Architecture - Definition<br />Computer Architecture = ISA + MO<br />Instruction Set Architecture<br />What the executable can “see” as underlying hardware<br />Logical View<br />Machine Organization<br />How the hardware implements ISA ?<br />Physical View<br />http://www.tusharkute.com <br />
  5. 5. Impact of changing ISA<br />Early 1990’s Apple switched instruction set architecture of the Macintosh<br />From Motorola 68000-based machines<br />To PowerPC architecture<br />Intel 80x86 Family: many implementations of same architecture<br />program written in 1978 for 8086 can be run on latest Pentium chip<br />http://www.tusharkute.com <br />
  6. 6. Factors affecting ISA ???<br />Technology<br />Programming<br />Languages<br />Applications<br />Computer<br />Architecture<br />Operating<br />Systems<br />History<br />http://www.tusharkute.com <br />
  7. 7. ISA: Critical Interface<br />software<br />instruction set<br />hardware<br />Examples: 80x86 50,000,000 vs. MIPS 5500,000 ??? <br />http://www.tusharkute.com <br />
  8. 8. Designing Computers<br /><ul><li>All computers more or less based on the same basic design, the Von Neumann Architecture!</li></ul>http://www.tusharkute.com <br />
  9. 9. The Von Neumann Architecture<br /><ul><li>Model for designing and building computers, based on the following three characteristics:</li></ul>The computer consists of four main sub-systems:<br /><ul><li>Memory
  10. 10. ALU (Arithmetic/Logic Unit)
  11. 11. Control Unit
  12. 12. Input / Output System (I/O)</li></ul>Program is stored in memory during execution.<br />Program instructions are executed sequentially.<br />http://www.tusharkute.com <br />
  13. 13. Communicate with<br />"outside world", e.g. <br /><ul><li> Screen
  14. 14. Keyboard
  15. 15. Storage devices
  16. 16. ...</li></ul>Store data and program<br />Execute program<br />Do arithmetic/logic operationsrequested by program<br />The Von Neumann Architecture<br />Bus<br />Memory<br />Processor (CPU)<br />Input-Output<br />Control Unit<br />ALU<br />http://www.tusharkute.com <br />
  17. 17. Simplified Architecture<br />Source: Wikipedia<br />http://www.tusharkute.com <br />
  18. 18. http://www.tusharkute.com <br />
  19. 19. Memory Subsystem<br /><ul><li>Memory, also called RAM (Random Access Memory),
  20. 20. Consists of many memory cells (storage units) of a fixed size. Each cell has an address associated with it: 0, 1, …
  21. 21. All accesses to memory are to a specified address.A cell is the minimum unit of access (fetch/store a complete cell).
  22. 22. The time it takes to fetch/store a cell is the same for all cells.
  23. 23. When the computer is running, both
  24. 24. Program
  25. 25. Data (variables)</li></ul> are stored in the memory.<br />http://www.tusharkute.com <br />
  26. 26. RAM<br />N<br /><ul><li>Need to distinguish between
  27. 27. the address of a memory cell and the content of a memory cell
  28. 28. Memory width (W):
  29. 29. How many bits is each memory cell, typically one byte (=8 bits)
  30. 30. Address width (N):
  31. 31. How many bits used to represent each address, determines the maximum memory size = address space
  32. 32. If address width is N-bits, then address space is 2N (0,1,...,2N-1)</li></ul>0000000000000001<br />1 bit<br />0<br />1<br />2<br />...<br />2N<br />2N-1<br />W<br />14<br />http://www.tusharkute.com <br />
  33. 33. Memory Size / Speed<br /><ul><li>Typical memory in a personal computer (PC):
  34. 34. 64MB - 256MB
  35. 35. Memory sizes:
  36. 36. Kilobyte (KB) = 210 = 1,024 bytes ~ 1 thousand
  37. 37. Megabyte(MB) = 220 = 1,048,576 bytes ~ 1 million
  38. 38. Gigabyte (GB) = 230 = 1,073,741,824 bytes ~ 1 billion
  39. 39. Memory Access Time (read from/ write to memory)
  40. 40. 50-75 nanoseconds (1 nsec. = 0.000000001 sec.)
  41. 41. RAM is
  42. 42. volatile (can only store when power is on)
  43. 43. relatively expensive</li></ul>http://www.tusharkute.com <br />
  44. 44. Operations on Memory <br /><ul><li>Fetch (address):
  45. 45. Fetch a copy of the content of memory cell with the specified address.
  46. 46. Non-destructive, copies value in memory cell.
  47. 47. Store (address, value):
  48. 48. Store the specified value into the memory cell specified by address.
  49. 49. Destructive, overwrites the previous value of the memory cell.
  50. 50. The memory system is interfaced via:
  51. 51. Memory Address Register (MAR)
  52. 52. Memory Data Register (MDR)
  53. 53. Fetch/Store signal</li></ul>http://www.tusharkute.com <br />
  54. 54. Structure of the Memory Subsystem<br /><ul><li>Fetch(address)
  55. 55. Load address into MAR.
  56. 56. Decode the address in MAR.
  57. 57. Copy the content of memory cell with specified address into MDR.
  58. 58. Store(address, value)
  59. 59. Load the address into MAR.
  60. 60. Load the value into MDR.
  61. 61. Decode the address in MAR
  62. 62. Copy the content of MDR into memory cell with the specified address.</li></ul>http://www.tusharkute.com <br />
  63. 63. Input / Output Subsystem<br /><ul><li>Handles devices that allow the computer system to:
  64. 64. Communicate and interact with the outside world
  65. 65. Screen, keyboard, printer, ...
  66. 66. Store information (mass-storage)
  67. 67. Hard-drives, floppies, CD, tapes, …
  68. 68. Mass-Storage Device Access Methods:
  69. 69. Direct Access Storage Devices (DASDs)
  70. 70. Hard-drives, floppy-disks, CD-ROMs, ...
  71. 71. Sequential Access Storage Devices (SASDs)
  72. 72. Tapes (for example, used as backup devices)</li></ul>http://www.tusharkute.com <br />
  73. 73. I/O Controllers<br /><ul><li>Speed of I/O devices is slow compared to RAM
  74. 74. RAM ~ 50 nsec.
  75. 75. Hard-Drive ~ 10msec. = (10,000,000 nsec)
  76. 76. Solution:
  77. 77. I/O Controller, a special purpose processor:
  78. 78. Has a small memory buffer, and a control logic to control I/O device (e.g. move disk arm).
  79. 79. Sends an interrupt signal to CPU when done read/write.
  80. 80. Data transferred between RAM and memory buffer.
  81. 81. Processor free to do something else while I/O controller reads/writes data from/to device into I/O buffer.</li></ul>http://www.tusharkute.com <br />
  82. 82. Structure of the I/O Subsystem<br />http://www.tusharkute.com <br />
  83. 83. The ALU Subsystem<br /><ul><li>The ALU (Arithmetic/Logic Unit) performs
  84. 84. mathematical operations (+, -, x, /, …)
  85. 85. logic operations (=, <, >, and, or, not, ...)
  86. 86. In today's computers integrated into the CPU
  87. 87. Consists of:
  88. 88. Circuits to do the arithmetic/logic operations.
  89. 89. Registers (fast storage units) to store intermediate computational results.
  90. 90. Bus that connects the two.</li></ul>http://www.tusharkute.com <br />
  91. 91. Structure of the ALU<br /><ul><li>Registers:
  92. 92. Very fast local memory cells, that store operands of operations and intermediate results.
  93. 93. CCR (condition code register), a special purpose register that stores the result of <, = , > operations
  94. 94. ALU circuitry:
  95. 95. Contains an array of circuits to do mathematical/logic operations.
  96. 96. Bus:
  97. 97. Data path interconnecting the registers to the ALU circuitry.</li></ul>http://www.tusharkute.com <br />
  98. 98. The Control Unit<br /><ul><li>Program is stored in memory
  99. 99. as machine language instructions, in binary
  100. 100. The task of the control unit is to execute programs by repeatedly:
  101. 101. Fetch from memory the next instruction to be executed.
  102. 102. Decode it, that is, determine what is to be done.
  103. 103. Execute it by issuing the appropriate signals to the ALU, memory, and I/O subsystems.
  104. 104. Continues until the HALT instruction</li></ul>http://www.tusharkute.com <br />
  105. 105. Machine Language Instructions<br /><ul><li>A machine language instruction consists of:
  106. 106. Operation code, telling which operation to perform
  107. 107. Address field(s), telling the memory addresses of the values on which the operation works.
  108. 108. Example: ADD X, Y (Add content of memory locations X and Y, and store back in memory location Y).
  109. 109. Assume: opcode for ADD is 9, and addresses X=99, Y=100</li></ul>Opcode (8 bits)<br />Address 1 (16 bits)<br />Address 2 (16 bits)<br />00001001<br />0000000001100011<br />0000000001100100<br />http://www.tusharkute.com <br />
  110. 110. Instruction Set Design<br /><ul><li>Two different approaches:
  111. 111. Reduced Instruction Set Computers (RISC)
  112. 112. Instruction set as small and simple as possible.
  113. 113. Minimizes amount of circuitry --> faster computers
  114. 114. Complex Instruction Set Computers (CISC)
  115. 115. More instructions, many very complex
  116. 116. Each instruction can do more work, but require more circuitry.</li></ul>http://www.tusharkute.com <br />
  117. 117. Typical Machine Instructions<br /><ul><li>Notation:
  118. 118. We use X, Y, Z to denote RAM cells
  119. 119. Assume only one register R (for simplicity)
  120. 120. Use English-like descriptions (should be binary)
  121. 121. Data Transfer Instructions
  122. 122. LOAD X Load content of memory location X to R
  123. 123. STORE X Load content of R to memory location X
  124. 124. MOVE X, Y Copy content of memory location X to loc. Y(not absolutely necessary)</li></ul>http://www.tusharkute.com <br />
  125. 125. Machine Instructions (cont.) <br /><ul><li>Arithmetic
  126. 126. ADD X, Y, Z CON(Z) = CON(X) + CON(Y)
  127. 127. ADD X, Y CON(Y) = CON(X) + CON(Y)
  128. 128. ADD X R = CON(X) + R
  129. 129. similar instructions for other operators, e.g. SUBTR,OR, ...
  130. 130. Compare
  131. 131. COMPARE X, YCompare the content of memory cell X to the content of memory cell Y and set the condition codes (CCR) accordingly.
  132. 132. E.g. If CON(X) = R then set EQ=1, GT=0, LT=0</li></ul>http://www.tusharkute.com <br />
  133. 133. Machine Instructions (cont.)<br /><ul><li>Branch
  134. 134. JUMP X Load next instruction from memory loc. X
  135. 135. JUMPGT X Load next instruction from memory loc. X only if GT flag in CCR is set, otherwise load statement from next sequence loc. as usual.
  136. 136. JUMPEQ, JUMPLT, JUMPGE, JUMPLE,JUMPNEQ
  137. 137. Control
  138. 138. HALT Stop program execution.</li></ul>http://www.tusharkute.com <br />
  139. 139. Example<br /><ul><li>Pseudo-code: Set A to B + C
  140. 140. Assuming variable:
  141. 141. A stored in memory cell 100, B stored in memory cell 150, C stored in memory cell 151
  142. 142. Machine language (really in binary)
  143. 143. LOAD 150
  144. 144. ADD 151
  145. 145. STORE 100
  146. 146. or
  147. 147. (ADD 150, 151, 100)</li></ul>http://www.tusharkute.com <br />
  148. 148. Structure of the Control Unit<br /><ul><li>PC (Program Counter):
  149. 149. stores the address of next instruction to fetch
  150. 150. IR (Instruction Register):
  151. 151. stores the instruction fetched from memory
  152. 152. Instruction Decoder:
  153. 153. Decodes instruction and activates necessary circuitry</li></ul>IR<br />PC<br />+1<br />Instruction <br />Decoder<br />http://www.tusharkute.com <br />
  154. 154. von Neumann<br />Architecture<br />
  155. 155. How does this all work together?<br /><ul><li>Program Execution:
  156. 156. PC is set to the address where the first program instruction is stored in memory.
  157. 157. Repeat until HALT instruction or fatal error</li></ul> Fetch instruction<br /> Decode instruction<br /> Execute instruction<br /> End of loop<br />http://www.tusharkute.com <br />
  158. 158. Program Execution (cont.)<br /><ul><li>Fetch phase
  159. 159. PC --> MAR (put address in PC into MAR)
  160. 160. Fetch signal (signal memory to fetch value into MDR)
  161. 161. MDR --> IR (move value to Instruction Register)
  162. 162. PC + 1 --> PC (Increase address in program counter)
  163. 163. Decode Phase
  164. 164. IR -> Instruction decoder (decode instruction in IR)
  165. 165. Instruction decoder will then generate the signals to activate the circuitry to carry out the instruction</li></ul>http://www.tusharkute.com <br />
  166. 166. Program Execution (cont.)<br /><ul><li>Execute Phase
  167. 167. Differs from one instruction to the next.
  168. 168. Example:
  169. 169. LOAD X (load value in addr. X into register)
  170. 170. IR_address -> MAR
  171. 171. Fetch signal
  172. 172. MDR --> R
  173. 173. ADD X
  174. 174. left as an exercise</li></ul>http://www.tusharkute.com <br />
  175. 175. Instruction Set for Our Von Neumann Machine<br />http://www.tusharkute.com <br />
  176. 176. Fundamental Components of Computer<br />The CPU (ALU, Control Unit, Registers)<br />The Memory Subsystem (Stored Data)<br />The I/O subsystem (I/O devices)<br />Address Bus<br />Data Bus<br />Memory<br />Subsystem<br />CPU<br />Control Bus<br />I/O Device<br />Subsystem<br />http://www.tusharkute.com <br />
  177. 177. Each of these Components are connected through Buses.<br />BUS - Physically a set of wires. The components of the Computer are connected to these buses.<br />Address Bus<br />Data Bus<br />Control Bus<br />http://www.tusharkute.com <br />
  178. 178. Address Bus<br />Used to specify the address of the memory location to access.<br />Each I/O devices has a unique address. (monitor, mouse, cd-rom)<br />CPU reads data or instructions from other locations by specifying the address of its location.<br />CPU always outputs to the address bus and never reads from it.<br />http://www.tusharkute.com <br />
  179. 179. Data Bus<br />Actual data is transferred via the data bus.<br />When the cpu sends an address to memory, the memory will send data via the data bus in return to the cpu.<br />http://www.tusharkute.com <br />
  180. 180. Control Bus<br />Collection of individual control signals.<br />Whether the cpu will read or write data.<br />CPU is accessing memory or an I/O device<br />Memory or I/O is ready to transfer data<br />http://www.tusharkute.com <br />
  181. 181. I/O Bus or Local Bus<br />In today’s computers the the I/O controller will have an extra bus called the I/O bus.<br />The I/O bus will be used to access all other I/O devices connected to the system.<br />Example: PCI bus<br />http://www.tusharkute.com <br />
  182. 182. Bus<br />Processor<br />Memory<br />Devices<br />Control<br />Input<br />Cache<br />Datapath<br />Output<br />Registers<br />Bus Organisation<br />http://www.tusharkute.com <br />
  183. 183. Fundamental Concepts<br /><ul><li>Processor (CPU): the active part of the computer, which does all the work (data manipulation and decision-making).
  184. 184. Datapath: portion of the processor which contains hardware necessary to perform all operations required by the computer (the brawn).
  185. 185. Control: portion of the processor (also in hardware) which tells the datapath what needs to be done (the brain).</li></ul>http://www.tusharkute.com <br />
  186. 186. Instruction<br />Fetch<br />Instruction<br />Decode<br />Operand<br />Fetch<br />Execute<br />Result<br />Store<br />Next<br />Instruction<br />Fundamental Concepts (2)<br /><ul><li>Instruction execution cycle: fetch, decode, execute.
  187. 187. Fetch: fetch next instruction (using PC) from memory into IR.
  188. 188. Decode: decode the instruction.
  189. 189. Execute: execute instruction.</li></ul>http://www.tusharkute.com <br />
  190. 190. Fundamental Concepts (3)<br /><ul><li>Fetch: Fetch next instruction into IR (Instruction Register).
  191. 191. Assume each word is 4 bytes and each instruction is stored in a word, and that the memory is byte addressable.
  192. 192. PC (Program Counter) contains address of next instruction. </li></ul> IR  [[PC]]<br /> PC [PC] + 4<br />http://www.tusharkute.com <br />
  193. 193. Internal processor bus<br />Control signals<br />Address line<br />PC<br />. . .<br />Instruction decoder and control logic<br />MAR<br />Data line<br />MDR<br />IR<br />Constant 4<br />Y<br />MUX<br />RO<br />Select<br />:<br />:<br />Add<br />ALU control lines<br />R(n–1)<br />Sub<br />A<br />B<br />Carry-in<br />ALU<br />:<br />XOR<br />TEMP<br />Z<br />Single Bus Organization<br />http://www.tusharkute.com <br />
  194. 194. Instruction Cycles<br />Procedure the CPU goes through to process an instruction.<br />1. Fetch - get instruction<br />2. Decode - interperate the instruction<br />3. Execute - run the instruction.<br />http://www.tusharkute.com <br />
  195. 195. Timing Diagram: Memory Read <br />Address is placed at beginning of clock<br />after one clock cycle the CPU asserts the read.<br />Causes the memory to place its data onto the data bus.<br />CLK : System Clock used to synchronize<br />CLK<br />Bus<br />Address<br />Bus<br />Data<br />Read<br />http://www.tusharkute.com <br />
  196. 196. Timing Diagram : Memory Write <br />CPU places the Address and data on the first clock cycle.<br />At the start of the second clock the CPU will assert the write control signal.<br />This will then start memory to store data.<br />After some time the write is then deasserted by the CPU after removing the address and data from the subsystem.<br />CLK<br />Address Bus<br />Address<br />Data Bus<br />Data<br />Read<br />http://www.tusharkute.com <br />
  197. 197. I/O read and Write Cycles<br />The I/O read and Write cycles are similar to the memory read and write.<br />Memory mapped I/O : Same sequences as input output to read and write.<br />The processor treats an I/O port as a memory location.<br />This results in the same treatment as a memory access.<br />http://www.tusharkute.com <br />
  198. 198. Technology Trends<br />Processor<br />logic capacity: about 30% per year<br />clock rate: about 20% per year<br />Memory<br />DRAM capacity: about 60% per year (4x every 3 years)<br />Memory speed: about 10% per year<br />Cost per bit: improves about 25% per year<br />Disk<br />capacity: about 60% per year<br />Total use of data: 100% per 9 months!<br />Network Bandwidth<br />Bandwidth increasing more than 100% per year!<br />http://www.tusharkute.com <br />
  199. 199. Microprocessor Logic Density<br />DRAM chip capacity<br /> DRAM<br />Year Size<br />1980 64 Kb<br />1983 256 Kb<br />1986 1 Mb<br />1989 4 Mb<br />1992 16 Mb<br />1996 64 Mb<br />1999 256 Mb<br />2002 1 Gb<br /><ul><li>In ~1985 the single-chip processor (32-bit) and the single-board computer emerged
  200. 200. In the 2002+ timeframe, these may well look like mainframes compared single-chip computer (maybe 2 chips) </li></ul>Technology Trends<br />http://www.tusharkute.com <br />
  201. 201. Technology Trends<br />Smaller feature sizes – higher speed, density<br />http://www.tusharkute.com <br />
  202. 202. Technology Trends<br />Number of transistors doubles every 18 months<br />(amended to 24 months)<br />http://www.tusharkute.com <br />
  203. 203. References<br /><ul><li>Computer Organization and Architecture, Designing for performance by William Stallings, Prentice Hall of India.
  204. 204. Modern Computer Architecture, by Morris Mano, Prentice Hall of India.
  205. 205. Computer Architecture and Organization by John P. Hayes, McGraw Hill Publishing Company.
  206. 206. Computer Organization by V. Carl Hamacher, Zvonko G. Vranesic, Safwat G. Zaky, McGraw Hill Publishing Company.</li></ul>http://www.tusharkute.com <br />
  207. 207. Thank You<br />http://www.tusharkute.com <br />

×