Transcription of MARIE: An Introduction to a Simple Computer
1 195 CHAPTER When you wish to produce a result by means of an instrument, do notallow yourself to complicate it. Leonardo da Vinci4 MARIE: An Introductionto a Simple INTRODUCTIOND esigning a Computer nowadays is a job for a Computer engineer with plenty oftraining. It is impossible in an introductory textbook such as this (and in anintroductory course in Computer organization and architecture) to present every-thing necessary to design and build a working Computer such as those we can buytoday. However, in this chapter, we first look at a very Simple Computer calledMARIE: a Machine Architecture that is Really Intuitive and Easy.
2 We then pro-vide brief overviews of Intel and MIPs machines, two popular architecturesreflecting the CISC and RISC design philosophies. The objective of this chapteris to give you an understanding of how a Computer functions. We have, therefore,kept the architecture as uncomplicated as possible, following the advice in theopening quote by Leonardo da CPU BASICS AND ORGANIZATIONFrom our studies in Chapter 2 (data representation) we know that a computermust manipulate binary-coded data.
3 We also know from Chapter 3 that memory isused to store both data and program instructions (also in binary). Somehow, theprogram must be executed and the data must be processed correctly. The centralprocessing unit(CPU) is responsible for fetching program instructions, decod-ing each instruction that is fetched, and performing the indicated sequence ofoperations on the correct data. To understand how computers work, you must firstbecome familiar with their various components and the interaction among 10/18/10 12:03 PM Page 195196 Chapter 4/ MARIE: An Introduction to a Simple Computercomponents.
4 To introduce the Simple architecture in the next section, we firstexamine, in general, the microarchitecture that exists at the control level of mod-ern computers have a CPU that can be divided into two pieces. The first is thedatapath, which is a network of storage units (registers) and arithmetic and logicunits (for performing various operations on data) connected by buses (capable ofmoving data from place to place) where the timing is controlled by clocks. Thesecond CPU component is the control unit, a module responsible for sequencingoperations and making sure the correct data are where they need to be at the cor-rect time.
5 Together, these components perform the tasks of the CPU: fetchinginstructions, decoding them, and finally performing the indicated sequence ofoperations. The performance of a machine is directly affected by the design of thedatapath and the control unit. Therefore, we cover these components of the CPUin detail in the following The RegistersRegisters are used in Computer systems as places to store a wide variety of data,such as addresses, program counters, or data necessary for program simply, a registeris a hardware device that stores binary data.
6 Registers arelocated on the processor so information can be accessed very quickly. We saw inChapter 3 that D flip-flops can be used to implement registers. One D flip-flop isequivalent to a 1-bit register, so a collection of D flip-flops is necessary to storemulti-bit values. For example, to build a 16-bit register, we need to connect 16 Dflip-flops together. We saw in our binary counter figure from Chapter 3 that thesecollections of flip-flops must be clocked to work in unison. At each pulse of theclock, input enters the register and cannot be changed (and thus is stored) untilthe clock pulses processing on a Computer is usually done on fixed-size binary wordsstored in registers.
7 Therefore, most computers have registers of a certain sizes include 16, 32, and 64 bits. The number of registers in a machinevaries from architecture to architecture, but is typically a power of 2, with 16 and32 being most common. Registers contain data, addresses, or control registers are specified as special purpose and may contain only data, onlyaddresses, or only control information. Other registers are more generic and mayhold data, addresses, and control information at various is written to registers, read from registers, and transferred fromregister to register.
8 Registers are not addressed in the same way memory isaddressed (recall that each memory word has a unique binary address beginningwith location 0). Registers are addressed and manipulated by the control unit modern Computer systems, there are many types of specialized registers:registers to store information, registers to shift values, registers to compare val-ues, and registers that count. There are scratchpad registers that store temporaryvalues, index registers to control program looping, stack pointer registers to 10/18/10 12:03 PM Page The Bus197age stacks of information for processes, status (or flag) registers to hold the statusor mode of operation (such as overflow, carry, or zero conditions), and generalpurpose registers that are the registers available to the programmer.
9 Most comput-ers have register sets, and each set is used in a specific way. For example, thePentium architecture has a data register set and an address register set. Certainarchitectures have very large sets of registers that can be used in quite novel waysto speed up execution of instructions. (We discuss this topic when we coveradvanced architectures in Chapter 9.) The ALUThe arithmetic logic unit(ALU) carries out the logic operations (such as com-parisons) and arithmetic operations (such as add or multiply) required during theprogram execution.
10 You saw an example of a Simple ALU in Chapter 3. Generallyan ALU has two data inputs and one data output. Operations performed in theALU often affect bits in the status register(bits are set to indicate actions suchas whether an overflow has occurred). The ALU knows which operations to per-form because it is controlled by signals from the control The Control UnitThe control unitis the policeman or traffic manager of the CPU. It monitorsthe execution of all instructions and the transfer of all information.