Topics in Computer Organization (based on old class notes) D. Salomon Feb 2008 (619) 443-6528 [email protected] http://www.davidsalomon.name/ Modern computer programming is a race between programmers striving to write bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. —Rich Cook Preface The dictionary definition of the term “organizing” is “to put together into an orderly, functional, structured whole.” This term applies twice to this text because it tries to “put together into an orderly, functional, structured whole” the main components of computers; the way computers are organized. More and more people use computers, but to most computer users the computer is a “black box,” and writing a program is akin to uttering magical incantations. This text tries to clear up these mysteries. It attempts to give the reader a robust framework to which new knowledge can later be added by more studying. Specifically, the text answers the question “how do computers work?” It describes the main components of the computer and their interrelationships. It includes material on the control unit, memory, and input/output processing, as well as topics such as logic devices, microprocessor components, microprogramming, machine instructions, assembly language and assembler operation, and a survey of the main features of some existing computers. The title of this text is “Computer Organization.” This term refers to a conceptual understanding, rather than an engineering understanding, of the inner workings of computers. A more formal definition of this term is “the logical arrangement of the hardware components and how they are interconnected.” Another important term commonly used with computers is “computer architecture.” This term answers the question “how is a computer designed?” rather than “how does the computer work?”. An alternative definition of computer architecture is “the components or attributes of the computer that are visible to the assembler language programmer.” As a result of these definitions, features such as the instruction set, the word size, addressing modes, and interrupt handling are architectural. Features such as memory technology, bus organization, and handshaking signals are organizational. A typical example is input/output (abbreviated I/O). The I/O instructions in the instruction set are an architectural feature. The physical implementation of those instructions (by way of a DMA device, a channel, or something else) is an organizational feature. The distinction between organization and architecture can be traced back to 1964. In that year, IBM released its system/360, the first family of computers. The different models in the family had different performances (and prices) and, as a result, different organizations. However, they were upward compatible, which means they had the same architecture. The success of the 360 family encouraged IBM and other manufacturers to design many more families of computers, thereby establishing the distinction between organization and architecture. Here are a few more general terms used with computers. “Software” refers to how the computer is used. “Hardware” refers to how the computer is constructed (its physical building blocks). The general term “computing” refers to problem solving on computers by means of programming. The computer itself is a machine that performs tasks and solve problems by storing and manipulating information. Information stored in computers is digital (it consists of discrete digits). ii Preface These notes are based on experience gained from teaching computer organization over many years. Much of the material found here was originally included in response to questions and requests from students. The exercises constitute an important part of the notes and should be worked out! The answers are provided, but should be consulted only as a last resort. Remember what the Dodo said: “Why,” said the Dodo, “the best way to explain it is to do it.” —Lewis Carroll (1832–1898) The text is divided into three parts as follows: Part I consists of the first six chapters and covers the main concepts of computer organization. Chap- ter 1 introduces the control unit, instruction fetch and execution, memory, ALU, microprogramming, and interrupts. Chapter 2 is a review of machine instructions and data types. It discusses instruction formats, opcodes, addressing modes, instruction types, floating-point, BCD, and fixed-point numbers, and carry and overflow. Chapter 3 is devoted to the important topic of input/output (I/O). It consists of three parts, the I/O processor, I/O codes, and computer communications. The first part discusses register I/O, memory- mapped I/O, DMA, and other types of I/O processors. The second part introduces the ASCII and Unicode codes, continues with a coverage of reliable (i.e., error-detecting and error-correcting) codes, and of data compression methods, and concludes with a description of important cryptographic methods (secure codes). Part three explains serial I/O and how computers are connected in local-area and wide-area networks. Microprogramming is the topic of chapter 4. The chapter includes a review of the basic concepts and a detailed example of a simple, microprogrammed computer. Parallel computers are discussed in chapter 5. The discussion concentrates on MIMD computers, but SIMD and data flow computers are also mentioned. The short chapter 6 introduces the reader to the concept of reduced instruction-set computers (RISC). Part II consists of chapters 7 through 9. This is an introduction to digital devices and computer design. Chapter 7 introduces the main digital devices used in computers. It starts with the logic gates and covers latches, counters, decoders, multiplexors, and other devices. Chapter 8 is an introduction to computer memory. The main types of memory and their internal operations are discussed. The ALU and its circuits is the topic of chapter 9. Digital circuits for integer arithmetic, for shifts, and for comparisons are explained in detail. Part III consists of appendixes that provide information on the history of computers, Unicode, and CD-ROMs. Hating, as I mortally do, all long unnecessary preface, I shall give you good quarter in this, and use no farther apology, than to prepare you for seeing the loose part of my life, wrote with the same liberty that I led it. —John Cleland, 1749, Fanny Hill Contents Preface i 1. Introduction 1 1 Terminology 1 2 The Control Unit 2 3 The Memory 5 4 Instruction Execution 11 5 CPU Bus Structure 17 6 Microprogramming 18 7 Interrupts 20 8 I/O Interrupts 26 9 Interrupts in a Microprocessor 28 10 The ALU 30 2. Machine Instructions 33 1 Instruction Formats 33 2 The Opcode Size 34 3 Addressing Modes 36 4 The Direct Mode 37 5 The Relative Mode 37 6 The Immediate Mode 38 7 The Index Mode 38 8 The Indirect Mode 38 9 Multilevel or Cascaded Indirect 39 10 Other Addressing Modes 40 11 Instruction Types 41 12 Data Movement Instructions 41 13 Operations 42 14 N-Operand Instructions 48 15 Actual Instruction Sets 48 16 The VAX Instruction Set 49 17 The RISC I Instruction Set 52 18 Non-Numeric Data Types 53 19 Numeric Data Types 54 20 Signed Integers 54 21 Floating-Point Numbers 57 22 Fixed-Point Numbers 63 23 Decimal (BCD) Numbers 64 24 Other BCD Codes 65 25 Rational Numbers 67 26 Carry and Overflow 68 iv Contents 3. Input/Output 71 1 The I/O Processor 71 2 Polled I/O 73 3 Interrupt I/O 75 4 DMA 75 5 I/O Channels 78 6 I/O Codes 79 7 ASCII and Other Codes 80 8 Information Theory and Algebraic Coding 83 9 Error-Detecting and Error-Correcting Codes 84 10 Data Compression 93 11 Variable-Size Codes 94 12 Huffman Codes 95 13 Facsimile Compression 97 14 Dictionary-Based Methods 100 15 Approaches to Image Compression 102 16 Secure Codes 107 17 Transposition Ciphers 114 18 Transposition by Turning Template 116 19 Columnar Transposition Cipher 118 20 Steganography 126 21 Computer Communications 131 22 Serial I/O 131 23 Modern Modems 143 24 ISDN and DSL 144 25 T-1, DS-1 and Their Relatives 145 26 Computer Networks 148 27 Internet Organization 152 28 Internet: Physical Layout 153 29 CSUN in the Internet 160 30 ICANN and IANA 163 31 The World Wide Web 163 4. Microprogramming 167 1 Basic Principles 167 2 A Short History of Microprogramming 168 3 The Computer Clock 169 4 An Example Microarchitecture 169 5 The Microinstructions 170 6 Microinstruction Timing 172 7 The Control Path 175 8 The Machine Instructions 177 9 The Microcode 178 10 Final Notes 184 11 A Horizontal Example 187 Contents v 5. Parallel Computers 189 1 Introduction 189 2 Classifying Architectures 189 3 Parallel Processing Methods 190 4 Design Criteria 190 5 The Hypercube 191 6 Array Processors 193 7 Example: MPP 195 8 Example: The Connection Machine 197 9 MIMD Computers 199 10 Parallel Algorithms 200 11 The Intel iPSC/1 202 12 Vector Processors 204 13 The Von-Neumann Bottleneck 205 14 Associative Computers 206 15 Data Flow Computers 209 6. Reduced Instruction Set Computers 219 1 Reduced and Complex Instruction Sets 219 2 A Short History of RISC 221 3 The RISC I Computer 222 4 Conclusions 226 7. Digital Devices 227 1 Combinational and Sequential Devices 228 2 Multivibrators 228 3 Counters 232 4 Registers 236 5 Multiplexors 236 6 Decoders 237 7 Encoders 237 8. The Memory 241 1 A Glossary of Memory Terms 241 2 Static RAM 242 3 ROM 243 4 PLA 245 9. The ALU 247 1 Integer Addition and Subtraction 247 2 The Accumulator 250 3 Integer Multiplication 252 4 Integer Division 260 5 Shifts 261 6 Comparisons 263 10. Assemblers 267 1 Introduction 267 2 A Short History of Assemblers 270 3 Types of Assemblers and Loaders 272 4 Assembler Operation 272 5 The Two-Pass Assembler 276 6 The One-Pass Assembler 280 7 Absolute and Relocatable Object Files 283 8 Absolute and Rel.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages396 Page
-
File Size-