Docsity

The Marie: A Simple Computer - Lecture Notes | CPSC 2105, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
The MARIE: A Simple Computer
Goals for this chapter:
1. Describe the top–level organization of a modern stored–program computer;
specifically name and describe the four main components.
2. Describe some of the lower–level components, such as registers,
that are common to three of the four main components of the computer.
3. Define an assembly language for this simple computer and use that assembly
language to investigate the functioning of a stored program computer.
NOTES:
1. The hypothetical computer designed by our textbook’s authors is called
the MARIE. See the textbook for the origin of the name.
2. The MARIE has an extremely simple design. Any computer the student sees or
uses, including the computers in one’s microwave oven and washing machine,
are more powerful than the MARIE.
3. While a very simple design, the MARIE illustrates all of the important features
of a modern stored–program computer. “Simpler” means “easier to learn”.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download The Marie: A Simple Computer - Lecture Notes | CPSC 2105 and more Study notes Computer Architecture and Organization in PDF only on Docsity!

The MARIE: A Simple Computer

Goals for this chapter:

  1. Describe the top–level organization of a modern stored–program computer; specifically name and describe the four main components.
  2. Describe some of the lower–level components, such as registers, that are common to three of the four main components of the computer.
  3. Define an assembly language for this simple computer and use that assembly language to investigate the functioning of a stored program computer. NOTES:
  4. The hypothetical computer designed by our textbook’s authors is called the MARIE. See the textbook for the origin of the name.
  5. The MARIE has an extremely simple design. Any computer the student sees or uses, including the computers in one’s microwave oven and washing machine, are more powerful than the MARIE.
  6. While a very simple design, the MARIE illustrates all of the important features of a modern stored–program computer. “Simpler” means “easier to learn”.

Computer Basics and Organization

The computer has four top–level components.

  1. The CPU (Central Processing Unit)
  2. The Main Memory
  3. Input/Output Devices, including a Hard Disk
  4. A Bus Structure to facilitate communications between the other components.

The System Clock

We discussed the system clock when we discussed the basic flip–flops. Here are two depictions of the system clock that will be used in this course. The top representation is used when discussing the system bus and the I/O bus. The bottom representation is used elsewhere. The system clock regulates the execution of instructions in the CPU and synchronizes all of the CPU components to prevent errors due to bad timing.

The System Bus

The system bus comprises a set of digital lines; each of which carries a signal, power, or ground. The ground is used to complete circuits. If the line carries a signal that line is set either to logic 1 (often +5 volts) or logic 0 (often 0 volts). Consider it as transmitting a Boolean variable, in that the value on that line can be changed by some control unit as a program is executed. The ground lines also provide isolation between the signal lines, which can act as little antennas – either to “broadcast” signals or receive them from other signal lines. This is called “cross talk”. It is not desirable. Here is a small bus with three data lines (D 2 , D 1 , D 0 ), two address lines (A 1 , A 0 ), a system clock () and a voltage line (+ V).

Bus Protocol and Arbitration

The computer has three major sets of busses.

  1. The system bus, allowing all major components to communicate.
  2. The I/O bus, allowing the CPU to communicate with the I/O devices.
  3. A set of busses internal to the CPU to allow its components to communicate. All busses in the computer must be controlled to avoid “collisions” (a networking term), in which two or more sources attempt to place signals on the bus at the same time. In the CPU, this control is exercised by the control unit , which explicitly enables and disables the tri–state buffers used to connect the signal sources to an internal bus. For other busses, such as an I/O bus, the situation is a bit more involved. We shall discuss bus arbitration in a later chapter.

Reality Intrudes (Part 1 of Many)

The design on the previous slide is logically correct, but IT WON’T WORK. IT IS TOO SLOW. Problem: A single system level bus cannot handle the load. Modern gamers demand fast video; this requires a fast bus to the video chip. The memory system is always a performance bottleneck. We need a dedicated memory bus in order to allow acceptable performance. Here is a refinement of the above diagram. This design is getting closer to reality. At least, it acknowledges two of the devices requiring high data rates in access to the CPU.

The Memory Component

The memory stores the instructions and data for an executing program. Memory is characterized by the smallest addressable unit: Byte addressable the smallest unit is an 8–bit byte. Word addressable the smallest unit is a word, usually 16 or 32 bits in length. Most modern computers are byte addressable, facilitating access to character data. Logically, computer memory should be considered as an array. The index into this array is called the address or “memory address”. A logical view of such a byte addressable memory might be written in code as: Const MemSize = byte Memory[MemSize] // Indexed 0 … (MemSize – 1) The CPU has two registers dedicated to handling memory. The MAR (Memory Address Register) holds the address being accessed. The MBR (Memory Buffer Register) holds the data being written to the memory or being read from the memory. This is sometimes called the Memory Data Register.

The Simplistic Physical View of Memory

I call this the “linear view”, as memory is still modeled as one large linear array. The N–bit address selects one of the 2N entities, numbered 0 through (2N – 1). Read sequence: First address to MAR; command a READ. then copy the contents of the MBR. Write sequence: First address to MAR; data to the MBR. then command a WRITE. This is logically correct, but difficult to implement at an acceptable price.

The Central Processing Unit (CPU)

The CPU also has four main components:

  1. The Control Unit (along with the IR) interprets the machine language instruction and issues the control signals to make the CPU execute it.
  2. The ALU (Arithmetic Logic Unit) that does the arithmetic and logic.
  3. The Register Set (Register File) that stores temporary results related to the computations. There are also Special Purpose Registers used by the Control Unit.
  4. An internal bus structure for communication.

The Register File

There are two sets of registers, called “General Purpose” and “Special Purpose”. The origin of the register set is simply the need to have some sort of memory on the computer and the inability to build what we now call “main memory”. When reliable technologies, such as magnetic cores, became available for main memory, the concept of CPU registers was retained. Registers are now implemented as a set of flip–flops physically located on the CPU chip. These are used because access times for registers are two orders of magnitude faster than access times for main memory: 1 nanosecond vs. 80 nanoseconds. General Purpose Registers These are mostly used to store intermediate results of computation. The count of such registers is often a power of 2, say 2 4 = 16 or 2 5 = 32, because N bits address 2 N items. The registers are often numbered and named with a strange notation so that the assembler will not confuse them for variables; e.g. %R0 … %R15. %R0 is often fixed at 0. NOTE: The MARIE has only one general purpose register – the AC (Accumulator). Think of the AC as the display on a standard calculator.

Registers and D Flip–Flops

Registers are often built from D flip–flops. A 16–bit register has 16 D flip–flops. Here is a diagram of a 2–bit register to show how the flip–flops are used. There are two 2–bit busses, one carrying data to the registers and one data from them. When Clock = 1 and Load = 1, the register accepts input from the “To Register” bus. When Clock = 1 and Read = 1, the register puts data onto the “From Register” bus.

Memory Creeps onto the CPU Chip

Modern computers, such as the P4, have placed both L1 caches and the L2 cache

on the CPU chip itself. Here is a picture of the P4 chip, annotated by Intel.

In older computers, the main difference between CPU registers and memory was

that the registers were on the chip and memory was not. This no longer holds.

The ALU (Arithmetic Logic Unit)

The ALU performs all of the arithmetic and logical operations for the CPU.

These include the following:

Arithmetic: addition, subtraction, negation, etc.

Logical: AND, OR, NOT, Exclusive OR, etc.

This symbol has been used for the ALU since the mid 1950’s.

It shows to inputs and one output.

The reason for two inputs is the fact that many operations, such as addition and

logical AND, are dyadic ; that is, they take two input arguments.

The Fetch–Execute Cycle

This cycle is the logical basis of all stored program computers.

Instructions are stored in memory as machine language.

Instructions are fetched from memory and then executed.

The common fetch cycle can be expressed in the following control sequence.

MAR  PC. // The PC contains the address of the instruction.

READ. // Put the address into the MAR and read memory.

IR  MBR. // Place the instruction into the MBR.

This cycle is described in many different ways, most of which serve to highlight

additional steps required to execute the instruction. Examples of additional

steps are: Decode the Instruction, Fetch the Arguments, Store the Result, etc.

A stored program computer is often called a “von Neumann Machine” after one

of the originators of the EDVAC.

This Fetch–Execute cycle is often called the “von Neumann bottleneck” , as the

necessity for fetching every instruction from memory slows the computer.